GRINS-0.6.0
Public Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | List of all members
GRINS::AveragedTurbineAdjointStabilization< Viscosity > Class Template Reference

Physics class for spatially-averaged turbine. More...

#include <averaged_turbine_adjoint_stab.h>

Inheritance diagram for GRINS::AveragedTurbineAdjointStabilization< Viscosity >:
Inheritance graph
[legend]
Collaboration diagram for GRINS::AveragedTurbineAdjointStabilization< Viscosity >:
Collaboration graph
[legend]

Public Member Functions

 AveragedTurbineAdjointStabilization (const std::string &physics_name, const GetPot &input)
 
 ~AveragedTurbineAdjointStabilization ()
 
virtual void init_context (AssemblyContext &context)
 Initialize context for added physics variables. More...
 
virtual void element_time_derivative (bool compute_jacobian, AssemblyContext &context, CachedValues &cache)
 Time dependent part(s) of physics for element interiors. More...
 
virtual void element_constraint (bool compute_jacobian, AssemblyContext &context, CachedValues &cache)
 Constraint part(s) of physics for element interiors. More...
 
virtual void init_variables (libMesh::FEMSystem *system)
 Initialization of variables. More...
 
virtual void set_time_evolving_vars (libMesh::FEMSystem *system)
 Sets turbine_speed and velocity variables to be time-evolving. More...
 
virtual void read_input_options (const GetPot &input)
 Read options from GetPot input file. More...
 
bool compute_force (const libMesh::Point &point, const libMesh::Real time, const libMesh::NumberVectorValue &U, libMesh::Number s, libMesh::NumberVectorValue &U_B_1, libMesh::NumberVectorValue &F, libMesh::NumberTensorValue *dFdU=NULL, libMesh::NumberVectorValue *dFds=NULL)
 
VariableIndex fan_speed_var () const
 
virtual void register_parameter (const std::string &param_name, libMesh::ParameterMultiPointer< libMesh::Number > &param_pointer) const
 Each subclass will register its copy of an independent. More...
 
virtual bool enabled_on_elem (const libMesh::Elem *elem)
 Find if current physics is active on supplied element. More...
 
void set_is_steady (bool is_steady)
 Sets whether this physics is to be solved with a steady solver or not. More...
 
bool is_steady () const
 Returns whether or not this physics is being solved with a steady solver. More...
 
virtual void auxiliary_init (MultiphysicsSystem &system)
 Any auxillary initialization a Physics class may need. More...
 
virtual void register_postprocessing_vars (const GetPot &input, PostProcessedQuantities< libMesh::Real > &postprocessing)
 Register name of postprocessed quantity with PostProcessedQuantities. More...
 
virtual void side_time_derivative (bool compute_jacobian, AssemblyContext &context, CachedValues &cache)
 Time dependent part(s) of physics for boundaries of elements on the domain boundary. More...
 
virtual void nonlocal_time_derivative (bool compute_jacobian, AssemblyContext &context, CachedValues &cache)
 Time dependent part(s) of physics for scalar variables. More...
 
virtual void side_constraint (bool compute_jacobian, AssemblyContext &context, CachedValues &cache)
 Constraint part(s) of physics for boundaries of elements on the domain boundary. More...
 
virtual void nonlocal_constraint (bool compute_jacobian, AssemblyContext &context, CachedValues &cache)
 Constraint part(s) of physics for scalar variables. More...
 
virtual void mass_residual (bool compute_jacobian, AssemblyContext &context, CachedValues &cache)
 Mass matrix part(s) for element interiors. All boundary terms lie within the time_derivative part. More...
 
virtual void nonlocal_mass_residual (bool compute_jacobian, AssemblyContext &context, CachedValues &cache)
 Mass matrix part(s) for scalar variables. More...
 
void init_bcs (libMesh::FEMSystem *system)
 
void init_ics (libMesh::FEMSystem *system, libMesh::CompositeFunction< libMesh::Number > &all_ics)
 
void attach_neumann_bound_func (GRINS::NBCContainer &neumann_bcs)
 
void attach_dirichlet_bound_func (const GRINS::DBCContainer &dirichlet_bc)
 
virtual void compute_element_time_derivative_cache (const AssemblyContext &context, CachedValues &cache)
 
virtual void compute_side_time_derivative_cache (const AssemblyContext &context, CachedValues &cache)
 
virtual void compute_nonlocal_time_derivative_cache (const AssemblyContext &context, CachedValues &cache)
 
virtual void compute_element_constraint_cache (const AssemblyContext &context, CachedValues &cache)
 
virtual void compute_side_constraint_cache (const AssemblyContext &context, CachedValues &cache)
 
virtual void compute_nonlocal_constraint_cache (const AssemblyContext &context, CachedValues &cache)
 
virtual void compute_mass_residual_cache (const AssemblyContext &context, CachedValues &cache)
 
virtual void compute_nonlocal_mass_residual_cache (const AssemblyContext &context, CachedValues &cache)
 
virtual void compute_postprocessed_quantity (unsigned int quantity_index, const AssemblyContext &context, const libMesh::Point &point, libMesh::Real &value)
 
BCHandlingBaseget_bc_handler ()
 
ICHandlingBaseget_ic_handler ()
 
virtual void set_parameter (libMesh::Number &param_variable, const GetPot &input, const std::string &param_name, libMesh::Number param_default)
 Each subclass can simultaneously read a parameter value from. More...
 

Protected Attributes

libMesh::Number _rho
 
Viscosity _mu
 
IncompressibleNavierStokesStabilizationHelper _stab_helper
 
libMesh::AutoPtr< libMesh::FunctionBase< libMesh::Number > > base_velocity_function
 
libMesh::AutoPtr< libMesh::FunctionBase< libMesh::Number > > local_vertical_function
 
libMesh::AutoPtr< libMesh::FunctionBase< libMesh::Number > > lift_function
 
libMesh::AutoPtr< libMesh::FunctionBase< libMesh::Number > > drag_function
 
libMesh::AutoPtr< libMesh::FunctionBase< libMesh::Number > > torque_function
 
libMesh::Number moment_of_inertia
 
libMesh::Number initial_speed
 
libMesh::AutoPtr< libMesh::FunctionBase< libMesh::Number > > chord_function
 
libMesh::AutoPtr< libMesh::FunctionBase< libMesh::Number > > area_swept_function
 
libMesh::AutoPtr< libMesh::FunctionBase< libMesh::Number > > aoa_function
 
VariableIndex _fan_speed_var
 
std::string _fan_speed_var_name
 
unsigned int _dim
 Physical dimension of problem. More...
 
PrimitiveFlowFEVariables _flow_vars
 
const PhysicsName _physics_name
 Name of the physics object. Used for reading physics specific inputs. More...
 
GRINS::BCHandlingBase_bc_handler
 
GRINS::ICHandlingBase_ic_handler
 
std::set< libMesh::subdomain_id_type > _enabled_subdomains
 Subdomains on which the current Physics class is enabled. More...
 
bool _is_axisymmetric
 

Static Protected Attributes

static bool _is_steady = false
 Caches whether or not the solver that's being used is steady or not. More...
 

Private Member Functions

 AveragedTurbineAdjointStabilization ()
 

Detailed Description

template<class Viscosity>
class GRINS::AveragedTurbineAdjointStabilization< Viscosity >

Physics class for spatially-averaged turbine.

Definition at line 46 of file averaged_turbine_adjoint_stab.h.

Constructor & Destructor Documentation

template<class Mu >
GRINS::AveragedTurbineAdjointStabilization< Mu >::AveragedTurbineAdjointStabilization ( const std::string &  physics_name,
const GetPot &  input 
)

Definition at line 41 of file averaged_turbine_adjoint_stab.C.

References GRINS::AveragedTurbineAdjointStabilization< Viscosity >::_rho, GRINS::incompressible_navier_stokes, and GRINS::ParameterUser::set_parameter().

42  : AveragedTurbineBase<Mu>(physics_name, input),
43  _rho(1.0),
44  _mu( input ),
45  _stab_helper( physics_name+"StabHelper", input )
46  {
47  this->set_parameter
48  (_rho, input, "Physics/"+incompressible_navier_stokes+"/rho", _rho);
49  }
virtual void set_parameter(libMesh::Number &param_variable, const GetPot &input, const std::string &param_name, libMesh::Number param_default)
Each subclass can simultaneously read a parameter value from.
const PhysicsName incompressible_navier_stokes
IncompressibleNavierStokesStabilizationHelper _stab_helper

Definition at line 52 of file averaged_turbine_adjoint_stab.C.

53  {
54  return;
55  }
template<class Viscosity >
GRINS::AveragedTurbineAdjointStabilization< Viscosity >::AveragedTurbineAdjointStabilization ( )
private

Member Function Documentation

void GRINS::Physics::attach_dirichlet_bound_func ( const GRINS::DBCContainer dirichlet_bc)
inherited

Definition at line 150 of file physics.C.

References GRINS::Physics::_bc_handler, and GRINS::BCHandlingBase::attach_dirichlet_bound_func().

151  {
152  _bc_handler->attach_dirichlet_bound_func( dirichlet_bc );
153  return;
154  }
GRINS::BCHandlingBase * _bc_handler
Definition: physics.h:256
void attach_dirichlet_bound_func(const GRINS::DBCContainer &dirichlet_bc)
void GRINS::Physics::attach_neumann_bound_func ( GRINS::NBCContainer neumann_bcs)
inherited

Definition at line 144 of file physics.C.

References GRINS::Physics::_bc_handler, and GRINS::BCHandlingBase::attach_neumann_bound_func().

145  {
146  _bc_handler->attach_neumann_bound_func( neumann_bcs );
147  return;
148  }
GRINS::BCHandlingBase * _bc_handler
Definition: physics.h:256
void attach_neumann_bound_func(GRINS::NBCContainer &neumann_bcs)
void GRINS::Physics::auxiliary_init ( MultiphysicsSystem system)
virtualinherited

Any auxillary initialization a Physics class may need.

This is called after all variables are added, so this method can safely query the MultiphysicsSystem about variable information.

Definition at line 113 of file physics.C.

114  {
115  return;
116  }
void GRINS::Physics::compute_element_constraint_cache ( const AssemblyContext context,
CachedValues cache 
)
virtualinherited

Definition at line 185 of file physics.C.

Referenced by GRINS::MultiphysicsSystem::element_constraint().

187  {
188  return;
189  }
void GRINS::Physics::compute_element_time_derivative_cache ( const AssemblyContext context,
CachedValues cache 
)
virtualinherited
template<class Mu >
bool GRINS::AveragedTurbineBase< Mu >::compute_force ( const libMesh::Point &  point,
const libMesh::Real  time,
const libMesh::NumberVectorValue &  U,
libMesh::Number  s,
libMesh::NumberVectorValue &  U_B_1,
libMesh::NumberVectorValue &  F,
libMesh::NumberTensorValue *  dFdU = NULL,
libMesh::NumberVectorValue *  dFds = NULL 
)
inherited

Definition at line 189 of file averaged_turbine_base.C.

197  {
198  // Find base velocity of moving fan at this point
199  libmesh_assert(base_velocity_function.get());
200 
201  libMesh::DenseVector<libMesh::Number> output_vec(3);
202 
203  (*base_velocity_function)(point, time,
204  output_vec);
205 
206  U_B_1(0) = output_vec(0);
207  U_B_1(1) = output_vec(1);
208  U_B_1(2) = output_vec(2);
209 
210  const libMesh::NumberVectorValue U_B = U_B_1 * s;
211 
212  const libMesh::Number U_B_size = U_B.size();
213 
214  // If there's no base velocity there's no fan
215  if (!U_B_size)
216  return false;
217 
218  // Normal in fan velocity direction
219  const libMesh::NumberVectorValue N_B =
220  libMesh::NumberVectorValue(U_B/U_B_size);
221 
222  (*local_vertical_function)(point, time,
223  output_vec);
224 
225  // Normal in fan vertical direction
226  const libMesh::NumberVectorValue N_V(output_vec(0),
227  output_vec(1),
228  output_vec(2));
229 
230  // Normal in radial direction (or opposite radial direction,
231  // for fans turning clockwise!)
232  const libMesh::NumberVectorValue N_R = N_B.cross(N_V);
233 
234  // Fan-wing-plane component of local relative velocity
235  const libMesh::NumberVectorValue U_P = U - (U*N_R)*N_R - U_B;
236 
237  const libMesh::Number U_P_size = U_P.size();
238 
239  // If there's no flow in the fan's frame of reference, there's no
240  // lift or drag. FIXME - should we account for drag in the
241  // out-of-plane direction?
242  if (!U_P_size)
243  return false;
244 
245  // Direction opposing drag
246  const libMesh::NumberVectorValue N_drag =
247  libMesh::NumberVectorValue(-U_P/U_P_size);
248 
249  // Direction opposing lift
250  const libMesh::NumberVectorValue N_lift = N_drag.cross(N_R);
251 
252  // "Forward" velocity
253  const libMesh::Number u_fwd = -(U_P * N_B);
254 
255  // "Upward" velocity
256  const libMesh::Number u_up = U_P * N_V;
257 
258  // If there's no forward or upward velocity we should have already
259  // returned false
260  libmesh_assert (u_up || u_fwd);
261 
262  // Angle WRT fan velocity direction
263  const libMesh::Number part_angle = std::atan2(u_up, u_fwd);
264 
265  // Angle WRT fan chord
266  const libMesh::Number angle = part_angle +
267  (*aoa_function)(point, time);
268 
269  const libMesh::Number C_lift = (*lift_function)(point, angle);
270  const libMesh::Number C_drag = (*drag_function)(point, angle);
271 
272  const libMesh::Number chord = (*chord_function)(point, time);
273  const libMesh::Number area = (*area_swept_function)(point, time);
274 
275  const libMesh::Number v_sq = U_P*U_P;
276 
277  const libMesh::Number LDfactor = 0.5 * this->_rho * v_sq * chord / area;
278  const libMesh::Number lift = C_lift * LDfactor;
279  const libMesh::Number drag = C_drag * LDfactor;
280 
281  // Force
282  F = lift * N_lift + drag * N_drag;
283 
284  if (dFdU)
285  {
286  const libMesh::NumberVectorValue LDderivfactor =
287  (N_lift*C_lift+N_drag*C_drag) *
288  this->_rho * chord / area;
289 
290  const libMesh::Number sfactor = -(U_P*U_B_1);
291 
292  (*dFds) = LDderivfactor * sfactor;
293 
294  for (unsigned int i=0; i != 3; ++i)
295  for (unsigned int j=0; j != 3; ++j)
296  (*dFdU)(i,j) = LDderivfactor(i) * U_P(j);
297  }
298 
299  return true;
300  }
libMesh::Number _rho
Material parameters, read from input.
libMesh::AutoPtr< libMesh::FunctionBase< libMesh::Number > > base_velocity_function
void GRINS::Physics::compute_mass_residual_cache ( const AssemblyContext context,
CachedValues cache 
)
virtualinherited

Definition at line 203 of file physics.C.

Referenced by GRINS::MultiphysicsSystem::mass_residual().

205  {
206  return;
207  }
void GRINS::Physics::compute_nonlocal_constraint_cache ( const AssemblyContext context,
CachedValues cache 
)
virtualinherited

Definition at line 197 of file physics.C.

Referenced by GRINS::MultiphysicsSystem::nonlocal_constraint().

199  {
200  return;
201  }
void GRINS::Physics::compute_nonlocal_mass_residual_cache ( const AssemblyContext context,
CachedValues cache 
)
virtualinherited

Definition at line 209 of file physics.C.

Referenced by GRINS::MultiphysicsSystem::nonlocal_mass_residual().

211  {
212  return;
213  }
void GRINS::Physics::compute_nonlocal_time_derivative_cache ( const AssemblyContext context,
CachedValues cache 
)
virtualinherited

Definition at line 179 of file physics.C.

Referenced by GRINS::MultiphysicsSystem::nonlocal_time_derivative().

181  {
182  return;
183  }
void GRINS::Physics::compute_postprocessed_quantity ( unsigned int  quantity_index,
const AssemblyContext context,
const libMesh::Point &  point,
libMesh::Real &  value 
)
virtualinherited
void GRINS::Physics::compute_side_constraint_cache ( const AssemblyContext context,
CachedValues cache 
)
virtualinherited

Definition at line 191 of file physics.C.

Referenced by GRINS::MultiphysicsSystem::side_constraint().

193  {
194  return;
195  }
void GRINS::Physics::compute_side_time_derivative_cache ( const AssemblyContext context,
CachedValues cache 
)
virtualinherited

Reimplemented in GRINS::ReactingLowMachNavierStokes< Mixture, Evaluator >.

Definition at line 173 of file physics.C.

Referenced by GRINS::MultiphysicsSystem::side_time_derivative().

175  {
176  return;
177  }
template<class Mu >
void GRINS::AveragedTurbineAdjointStabilization< Mu >::element_constraint ( bool  compute_jacobian,
AssemblyContext context,
CachedValues cache 
)
virtual

Constraint part(s) of physics for element interiors.

Reimplemented from GRINS::Physics.

Definition at line 257 of file averaged_turbine_adjoint_stab.C.

260  {
261 #ifdef GRINS_USE_GRVY_TIMERS
262  this->_timer->BeginTimer("AveragedTurbineAdjointStabilization::element_constraint");
263 #endif
264 
265  // The number of local degrees of freedom in each variable.
266  const unsigned int n_p_dofs = context.get_dof_indices(this->_flow_vars.p_var()).size();
267  const unsigned int n_u_dofs = context.get_dof_indices(this->_flow_vars.u_var()).size();
268 
269  // Element Jacobian * quadrature weights for interior integration.
270  const std::vector<libMesh::Real> &JxW =
271  context.get_element_fe(this->_flow_vars.u_var())->get_JxW();
272 
273  const std::vector<libMesh::Point>& u_qpoint =
274  context.get_element_fe(this->_flow_vars.u_var())->get_xyz();
275 
276  const std::vector<std::vector<libMesh::Real> >& u_phi =
277  context.get_element_fe(this->_flow_vars.u_var())->get_phi();
278 
279  const std::vector<std::vector<libMesh::RealGradient> >& p_dphi =
280  context.get_element_fe(this->_flow_vars.p_var())->get_dphi();
281 
282  libMesh::DenseSubVector<libMesh::Number> &Fp = context.get_elem_residual(this->_flow_vars.p_var()); // R_{p}
283 
284  libMesh::DenseSubMatrix<libMesh::Number> &Kpu =
285  context.get_elem_jacobian(this->_flow_vars.p_var(), this->_flow_vars.u_var()); // J_{pu}
286  libMesh::DenseSubMatrix<libMesh::Number> &Kpv =
287  context.get_elem_jacobian(this->_flow_vars.p_var(), this->_flow_vars.v_var()); // J_{pv}
288  libMesh::DenseSubMatrix<libMesh::Number> &Kps =
289  context.get_elem_jacobian(this->_flow_vars.p_var(), this->fan_speed_var()); // J_{ps}
290 
291  libMesh::DenseSubMatrix<libMesh::Number> *Kpw = NULL;
292 
293  if(this->_dim == 3)
294  {
295  Kpw = &context.get_elem_jacobian
296  (this->_flow_vars.p_var(), this->_flow_vars.w_var()); // J_{pw}
297  }
298 
299  // Now we will build the element Jacobian and residual.
300  // Constructing the residual requires the solution and its
301  // gradient from the previous timestep. This must be
302  // calculated at each quadrature point by summing the
303  // solution degree-of-freedom values by the appropriate
304  // weight functions.
305  unsigned int n_qpoints = context.get_element_qrule().n_points();
306 
307  libMesh::FEBase* fe = context.get_element_fe(this->_flow_vars.u_var());
308 
309  for (unsigned int qp=0; qp != n_qpoints; qp++)
310  {
311  libMesh::RealGradient g = this->_stab_helper.compute_g( fe, context, qp );
312  libMesh::RealTensor G = this->_stab_helper.compute_G( fe, context, qp );
313 
314  libMesh::RealGradient U( context.interior_value( this->_flow_vars.u_var(), qp ),
315  context.interior_value( this->_flow_vars.v_var(), qp ) );
316 
317  if( this->_dim == 3 )
318  {
319  U(2) = context.interior_value( this->_flow_vars.w_var(), qp );
320  }
321 
322  libMesh::Number s = context.interior_value(this->fan_speed_var(), qp);
323 
324  // Compute the viscosity at this qp
325  libMesh::Real mu_qp = this->_mu(context, qp);
326 
327  libMesh::Real tau_M;
328  libMesh::Real d_tau_M_d_rho;
329  libMesh::Gradient d_tau_M_dU;
330 
331  if (compute_jacobian)
333  ( context, qp, g, G, this->_rho, U, mu_qp,
334  tau_M, d_tau_M_d_rho, d_tau_M_dU,
335  this->_is_steady );
336  else
337  tau_M = this->_stab_helper.compute_tau_momentum
338  ( context, qp, g, G, this->_rho, U, mu_qp,
339  this->_is_steady );
340 
341  libMesh::NumberVectorValue U_B_1;
342  libMesh::NumberVectorValue F;
343  libMesh::NumberTensorValue dFdU;
344  libMesh::NumberTensorValue* dFdU_ptr =
345  compute_jacobian ? &dFdU : NULL;
346  libMesh::NumberVectorValue dFds;
347  libMesh::NumberVectorValue* dFds_ptr =
348  compute_jacobian ? &dFds : NULL;
349  if (!this->compute_force(u_qpoint[qp], context.time, U, s,
350  U_B_1, F, dFdU_ptr, dFds_ptr))
351  continue;
352 
353  // First, an i-loop over the velocity degrees of freedom.
354  // We know that n_u_dofs == n_v_dofs so we can compute contributions
355  // for both at the same time.
356  for (unsigned int i=0; i != n_p_dofs; i++)
357  {
358  Fp(i) += -tau_M*(F*p_dphi[i][qp])*JxW[qp];
359 
360  if (compute_jacobian)
361  {
362  Kps(i,0) += -tau_M*(dFds*p_dphi[i][qp])*JxW[qp];
363 
364  for (unsigned int j=0; j != n_u_dofs; ++j)
365  {
366  Kpu(i,j) += -d_tau_M_dU(0)*u_phi[j][qp]*(F*p_dphi[i][qp])*JxW[qp];
367  Kpv(i,j) += -d_tau_M_dU(1)*u_phi[j][qp]*(F*p_dphi[i][qp])*JxW[qp];
368  for (unsigned int d=0; d != 3; ++d)
369  {
370  Kpu(i,j) += -tau_M*dFdU(d,0)*u_phi[j][qp]*p_dphi[i][qp](d)*JxW[qp];
371  Kpv(i,j) += -tau_M*dFdU(d,1)*u_phi[j][qp]*p_dphi[i][qp](d)*JxW[qp];
372  }
373  }
374  if( this->_dim == 3 )
375  for (unsigned int j=0; j != n_u_dofs; ++j)
376  {
377  (*Kpw)(i,j) += -d_tau_M_dU(2)*u_phi[j][qp]*F*p_dphi[i][qp]*JxW[qp];
378  for (unsigned int d=0; d != 3; ++d)
379  {
380  (*Kpw)(i,j) += -tau_M*dFdU(d,2)*u_phi[j][qp]*p_dphi[i][qp](d)*JxW[qp];
381  }
382  }
383  }
384  }
385  } // End quadrature loop
386 
387 #ifdef GRINS_USE_GRVY_TIMERS
388  this->_timer->EndTimer("AveragedTurbineAdjointStabilization::element_constraint");
389 #endif
390 
391  return;
392  }
void compute_tau_momentum_and_derivs(AssemblyContext &c, unsigned int qp, libMesh::RealGradient &g, libMesh::RealTensor &G, libMesh::Real rho, libMesh::Gradient U, libMesh::Real T, libMesh::Real &tau_M, libMesh::Real &d_tau_M_d_rho, libMesh::Gradient &d_tau_M_d_U, bool is_steady) const
IncompressibleNavierStokesStabilizationHelper _stab_helper
libMesh::RealTensor compute_G(libMesh::FEBase *fe, AssemblyContext &c, unsigned int qp) const
Definition: stab_helper.C:64
unsigned int _dim
Physical dimension of problem.
libMesh::RealGradient compute_g(libMesh::FEBase *fe, AssemblyContext &c, unsigned int qp) const
Definition: stab_helper.C:47
static bool _is_steady
Caches whether or not the solver that's being used is steady or not.
Definition: physics.h:266
libMesh::Real compute_tau_momentum(AssemblyContext &c, unsigned int qp, libMesh::RealGradient &g, libMesh::RealTensor &G, libMesh::Real rho, libMesh::Gradient U, libMesh::Real mu, bool is_steady) const
bool compute_force(const libMesh::Point &point, const libMesh::Real time, const libMesh::NumberVectorValue &U, libMesh::Number s, libMesh::NumberVectorValue &U_B_1, libMesh::NumberVectorValue &F, libMesh::NumberTensorValue *dFdU=NULL, libMesh::NumberVectorValue *dFds=NULL)
VariableIndex fan_speed_var() const
template<class Mu >
void GRINS::AveragedTurbineAdjointStabilization< Mu >::element_time_derivative ( bool  compute_jacobian,
AssemblyContext context,
CachedValues cache 
)
virtual

Time dependent part(s) of physics for element interiors.

Reimplemented from GRINS::Physics.

Definition at line 72 of file averaged_turbine_adjoint_stab.C.

75  {
76 #ifdef GRINS_USE_GRVY_TIMERS
77  this->_timer->BeginTimer("AveragedTurbineAdjointStabilization::element_time_derivative");
78 #endif
79 
80  libMesh::FEBase* fe = context.get_element_fe(this->_flow_vars.u_var());
81 
82  // Element Jacobian * quadrature weights for interior integration
83  const std::vector<libMesh::Real> &JxW = fe->get_JxW();
84 
85  // The shape functions at interior quadrature points.
86  const std::vector<std::vector<libMesh::Real> >& u_phi = fe->get_phi();
87 
88  const std::vector<std::vector<libMesh::RealGradient> >& u_gradphi =
89  context.get_element_fe(this->_flow_vars.u_var())->get_dphi();
90 
91  const std::vector<std::vector<libMesh::RealTensor> >& u_hessphi =
92  context.get_element_fe(this->_flow_vars.u_var())->get_d2phi();
93 
94  const std::vector<libMesh::Point>& u_qpoint = fe->get_xyz();
95 
96  // The number of local degrees of freedom in each variable
97  const unsigned int n_u_dofs = context.get_dof_indices(this->_flow_vars.u_var()).size();
98 
99  // The subvectors and submatrices we need to fill:
100  libMesh::DenseSubMatrix<libMesh::Number> &Kuu = context.get_elem_jacobian(this->_flow_vars.u_var(), this->_flow_vars.u_var()); // R_{u},{u}
101  libMesh::DenseSubMatrix<libMesh::Number> &Kuv = context.get_elem_jacobian(this->_flow_vars.u_var(), this->_flow_vars.v_var()); // R_{u},{v}
102  libMesh::DenseSubMatrix<libMesh::Number> &Kvu = context.get_elem_jacobian(this->_flow_vars.v_var(), this->_flow_vars.u_var()); // R_{v},{u}
103  libMesh::DenseSubMatrix<libMesh::Number> &Kvv = context.get_elem_jacobian(this->_flow_vars.v_var(), this->_flow_vars.v_var()); // R_{v},{v}
104 
105  libMesh::DenseSubMatrix<libMesh::Number> &Kus =
106  context.get_elem_jacobian(this->_flow_vars.u_var(),
107  this->fan_speed_var()); // R_{u},{s}
108  libMesh::DenseSubMatrix<libMesh::Number> &Kvs =
109  context.get_elem_jacobian(this->_flow_vars.v_var(),
110  this->fan_speed_var()); // R_{v},{s}
111 
112  libMesh::DenseSubMatrix<libMesh::Number>* Kwu = NULL;
113  libMesh::DenseSubMatrix<libMesh::Number>* Kwv = NULL;
114  libMesh::DenseSubMatrix<libMesh::Number>* Kww = NULL;
115  libMesh::DenseSubMatrix<libMesh::Number>* Kuw = NULL;
116  libMesh::DenseSubMatrix<libMesh::Number>* Kvw = NULL;
117 
118  libMesh::DenseSubMatrix<libMesh::Number>* Kws = NULL;
119 
120  libMesh::DenseSubVector<libMesh::Number> &Fu = context.get_elem_residual(this->_flow_vars.u_var()); // R_{u}
121  libMesh::DenseSubVector<libMesh::Number> &Fv = context.get_elem_residual(this->_flow_vars.v_var()); // R_{v}
122  libMesh::DenseSubVector<libMesh::Number>* Fw = NULL;
123 
124  if( this->_dim == 3 )
125  {
126  Kuw = &context.get_elem_jacobian(this->_flow_vars.u_var(), this->_flow_vars.w_var()); // R_{u},{w}
127  Kvw = &context.get_elem_jacobian(this->_flow_vars.v_var(), this->_flow_vars.w_var()); // R_{v},{w}
128 
129  Kwu = &context.get_elem_jacobian(this->_flow_vars.w_var(), this->_flow_vars.u_var()); // R_{w},{u}
130  Kwv = &context.get_elem_jacobian(this->_flow_vars.w_var(), this->_flow_vars.v_var()); // R_{w},{v}
131  Kww = &context.get_elem_jacobian(this->_flow_vars.w_var(), this->_flow_vars.w_var()); // R_{w},{w}
132 
133  Kws = &context.get_elem_jacobian(this->_flow_vars.w_var(), this->fan_speed_var()); // R_{w},{s}
134 
135  Fw = &context.get_elem_residual(this->_flow_vars.w_var()); // R_{w}
136  }
137 
138  unsigned int n_qpoints = context.get_element_qrule().n_points();
139 
140  for (unsigned int qp=0; qp != n_qpoints; qp++)
141  {
142  libMesh::RealGradient g = this->_stab_helper.compute_g( fe, context, qp );
143  libMesh::RealTensor G = this->_stab_helper.compute_G( fe, context, qp );
144 
145  libMesh::RealGradient U( context.interior_value( this->_flow_vars.u_var(), qp ),
146  context.interior_value( this->_flow_vars.v_var(), qp ) );
147 
148  if( this->_dim == 3 )
149  {
150  U(2) = context.interior_value( this->_flow_vars.w_var(), qp );
151  }
152 
153  libMesh::Number s = context.interior_value(this->fan_speed_var(), qp);
154 
155  // Compute the viscosity at this qp
156  libMesh::Real mu_qp = this->_mu(context, qp);
157 
158  libMesh::Real tau_M;
159  libMesh::Real d_tau_M_d_rho;
160  libMesh::Gradient d_tau_M_dU;
161 
162  if (compute_jacobian)
164  ( context, qp, g, G, this->_rho, U, mu_qp,
165  tau_M, d_tau_M_d_rho, d_tau_M_dU,
166  this->_is_steady );
167  else
168  tau_M = this->_stab_helper.compute_tau_momentum
169  ( context, qp, g, G, this->_rho, U, mu_qp,
170  this->_is_steady );
171 
172  libMesh::NumberVectorValue U_B_1;
173  libMesh::NumberVectorValue F;
174  libMesh::NumberTensorValue dFdU;
175  libMesh::NumberTensorValue* dFdU_ptr =
176  compute_jacobian ? &dFdU : NULL;
177  libMesh::NumberVectorValue dFds;
178  libMesh::NumberVectorValue* dFds_ptr =
179  compute_jacobian ? &dFds : NULL;
180  if (!this->compute_force(u_qpoint[qp], context.time, U, s,
181  U_B_1, F, dFdU_ptr, dFds_ptr))
182  continue;
183 
184  for (unsigned int i=0; i != n_u_dofs; i++)
185  {
186  libMesh::Real test_func = this->_rho*U*u_gradphi[i][qp] +
187  mu_qp*( u_hessphi[i][qp](0,0) + u_hessphi[i][qp](1,1) + u_hessphi[i][qp](2,2) );
188  Fu(i) += tau_M*F(0)*test_func*JxW[qp];
189 
190  Fv(i) += tau_M*F(1)*test_func*JxW[qp];
191 
192  if (this->_dim == 3)
193  {
194  (*Fw)(i) += tau_M*F(2)*test_func*JxW[qp];
195  }
196 
197  if (compute_jacobian)
198  {
199  libMesh::Gradient d_test_func_dU = this->_rho*u_gradphi[i][qp];
200 
201  for (unsigned int j=0; j != n_u_dofs; ++j)
202  {
203  Kuu(i,j) += tau_M*F(0)*d_test_func_dU(0)*u_phi[j][qp]*JxW[qp];
204  Kuu(i,j) += d_tau_M_dU(0)*u_phi[j][qp]*F(0)*test_func*JxW[qp];
205  Kuu(i,j) += tau_M*dFdU(0,0)*u_phi[j][qp]*test_func*JxW[qp];
206  Kuv(i,j) += tau_M*F(0)*d_test_func_dU(1)*u_phi[j][qp]*JxW[qp];
207  Kuv(i,j) += d_tau_M_dU(1)*u_phi[j][qp]*F(0)*test_func*JxW[qp];
208  Kuv(i,j) += tau_M*dFdU(0,1)*u_phi[j][qp]*test_func*JxW[qp];
209  Kvu(i,j) += tau_M*F(1)*d_test_func_dU(0)*u_phi[j][qp]*JxW[qp];
210  Kvu(i,j) += d_tau_M_dU(0)*u_phi[j][qp]*F(1)*test_func*JxW[qp];
211  Kvu(i,j) += tau_M*dFdU(1,0)*u_phi[j][qp]*test_func*JxW[qp];
212  Kvv(i,j) += tau_M*F(1)*d_test_func_dU(1)*u_phi[j][qp]*JxW[qp];
213  Kvv(i,j) += d_tau_M_dU(1)*u_phi[j][qp]*F(1)*test_func*JxW[qp];
214  Kvv(i,j) += tau_M*dFdU(1,1)*u_phi[j][qp]*test_func*JxW[qp];
215 
216  Kus(i,0) += tau_M*dFds(0)*test_func*JxW[qp];
217  Kvs(i,0) += tau_M*dFds(1)*test_func*JxW[qp];
218  }
219 
220  if (this->_dim == 3)
221  {
222  for (unsigned int j=0; j != n_u_dofs; ++j)
223  {
224  (*Kuw)(i,j) += tau_M*F(0)*d_test_func_dU(2)*u_phi[j][qp]*JxW[qp];
225  (*Kuw)(i,j) += d_tau_M_dU(2)*u_phi[j][qp]*F(0)*test_func*JxW[qp];
226  (*Kuw)(i,j) += tau_M*dFdU(0,2)*u_phi[j][qp]*test_func*JxW[qp];
227  (*Kvw)(i,j) += tau_M*F(1)*d_test_func_dU(2)*u_phi[j][qp]*JxW[qp];
228  (*Kvw)(i,j) += d_tau_M_dU(2)*u_phi[j][qp]*F(1)*test_func*JxW[qp];
229  (*Kvw)(i,j) += tau_M*dFdU(1,2)*u_phi[j][qp]*test_func*JxW[qp];
230  (*Kwu)(i,j) += tau_M*F(2)*d_test_func_dU(0)*u_phi[j][qp]*JxW[qp];
231  (*Kwu)(i,j) += d_tau_M_dU(0)*u_phi[j][qp]*F(2)*test_func*JxW[qp];
232  (*Kwu)(i,j) += tau_M*dFdU(2,0)*u_phi[j][qp]*test_func*JxW[qp];
233  (*Kwv)(i,j) += tau_M*F(2)*d_test_func_dU(1)*u_phi[j][qp]*JxW[qp];
234  (*Kwv)(i,j) += d_tau_M_dU(1)*u_phi[j][qp]*F(2)*test_func*JxW[qp];
235  (*Kwv)(i,j) += tau_M*dFdU(2,1)*u_phi[j][qp]*test_func*JxW[qp];
236  (*Kww)(i,j) += tau_M*F(2)*d_test_func_dU(2)*u_phi[j][qp]*JxW[qp];
237  (*Kww)(i,j) += d_tau_M_dU(2)*u_phi[j][qp]*F(2)*test_func*JxW[qp];
238  (*Kww)(i,j) += tau_M*dFdU(2,2)*u_phi[j][qp]*test_func*JxW[qp];
239 
240  (*Kws)(i,0) += tau_M*dFds(2)*test_func*JxW[qp];
241  }
242  }
243 
244  } // End compute_jacobian check
245 
246  } // End i dof loop
247  }
248 
249 #ifdef GRINS_USE_GRVY_TIMERS
250  this->_timer->EndTimer("AveragedTurbineAdjointStabilization::element_time_derivative");
251 #endif
252 
253  return;
254  }
void compute_tau_momentum_and_derivs(AssemblyContext &c, unsigned int qp, libMesh::RealGradient &g, libMesh::RealTensor &G, libMesh::Real rho, libMesh::Gradient U, libMesh::Real T, libMesh::Real &tau_M, libMesh::Real &d_tau_M_d_rho, libMesh::Gradient &d_tau_M_d_U, bool is_steady) const
IncompressibleNavierStokesStabilizationHelper _stab_helper
libMesh::RealTensor compute_G(libMesh::FEBase *fe, AssemblyContext &c, unsigned int qp) const
Definition: stab_helper.C:64
unsigned int _dim
Physical dimension of problem.
libMesh::RealGradient compute_g(libMesh::FEBase *fe, AssemblyContext &c, unsigned int qp) const
Definition: stab_helper.C:47
static bool _is_steady
Caches whether or not the solver that's being used is steady or not.
Definition: physics.h:266
libMesh::Real compute_tau_momentum(AssemblyContext &c, unsigned int qp, libMesh::RealGradient &g, libMesh::RealTensor &G, libMesh::Real rho, libMesh::Gradient U, libMesh::Real mu, bool is_steady) const
bool compute_force(const libMesh::Point &point, const libMesh::Real time, const libMesh::NumberVectorValue &U, libMesh::Number s, libMesh::NumberVectorValue &U_B_1, libMesh::NumberVectorValue &F, libMesh::NumberTensorValue *dFdU=NULL, libMesh::NumberVectorValue *dFds=NULL)
VariableIndex fan_speed_var() const
bool GRINS::Physics::enabled_on_elem ( const libMesh::Elem *  elem)
virtualinherited

Find if current physics is active on supplied element.

Definition at line 83 of file physics.C.

References GRINS::Physics::_enabled_subdomains.

84  {
85  // Check if enabled_subdomains flag has been set and if we're
86  // looking at a real element (rather than a nonlocal evaluation)
87  if( !elem || _enabled_subdomains.empty() )
88  return true;
89 
90  // Check if current physics is enabled on elem
91  if( _enabled_subdomains.find( elem->subdomain_id() ) == _enabled_subdomains.end() )
92  return false;
93 
94  return true;
95  }
std::set< libMesh::subdomain_id_type > _enabled_subdomains
Subdomains on which the current Physics class is enabled.
Definition: physics.h:261
template<class Viscosity >
VariableIndex GRINS::AveragedTurbineBase< Viscosity >::fan_speed_var ( ) const
inlineinherited
BCHandlingBase * GRINS::Physics::get_bc_handler ( )
inlineinherited

Definition at line 282 of file physics.h.

References GRINS::Physics::_bc_handler.

283  {
284  return _bc_handler;
285  }
GRINS::BCHandlingBase * _bc_handler
Definition: physics.h:256
ICHandlingBase * GRINS::Physics::get_ic_handler ( )
inlineinherited

Definition at line 288 of file physics.h.

References GRINS::Physics::_ic_handler.

289  {
290  return _ic_handler;
291  }
GRINS::ICHandlingBase * _ic_handler
Definition: physics.h:258
void GRINS::Physics::init_bcs ( libMesh::FEMSystem *  system)
inherited

Definition at line 118 of file physics.C.

References GRINS::Physics::_bc_handler, GRINS::BCHandlingBase::init_bc_data(), GRINS::BCHandlingBase::init_dirichlet_bc_func_objs(), GRINS::BCHandlingBase::init_dirichlet_bcs(), and GRINS::BCHandlingBase::init_periodic_bcs().

119  {
120  // Only need to init BC's if the physics actually created a handler
121  if( _bc_handler )
122  {
123  _bc_handler->init_bc_data( *system );
124  _bc_handler->init_dirichlet_bcs( system );
126  _bc_handler->init_periodic_bcs( system );
127  }
128 
129  return;
130  }
GRINS::BCHandlingBase * _bc_handler
Definition: physics.h:256
virtual void init_dirichlet_bcs(libMesh::FEMSystem *system) const
virtual void init_periodic_bcs(libMesh::FEMSystem *system) const
virtual void init_dirichlet_bc_func_objs(libMesh::FEMSystem *system) const
virtual void init_bc_data(const libMesh::FEMSystem &system)
Override this method to initialize any system-dependent data.
template<class Mu >
void GRINS::AveragedTurbineAdjointStabilization< Mu >::init_context ( AssemblyContext context)
virtual

Initialize context for added physics variables.

Reimplemented from GRINS::IncompressibleNavierStokesBase< Viscosity >.

Definition at line 58 of file averaged_turbine_adjoint_stab.C.

59  {
60  context.get_element_fe(this->_flow_vars.p_var())->get_dphi();
61 
62  context.get_element_fe(this->_flow_vars.u_var())->get_xyz();
63  context.get_element_fe(this->_flow_vars.u_var())->get_phi();
64  context.get_element_fe(this->_flow_vars.u_var())->get_dphi();
65  context.get_element_fe(this->_flow_vars.u_var())->get_d2phi();
66 
67  return;
68  }
void GRINS::Physics::init_ics ( libMesh::FEMSystem *  system,
libMesh::CompositeFunction< libMesh::Number > &  all_ics 
)
inherited

Definition at line 133 of file physics.C.

References GRINS::Physics::_ic_handler, and GRINS::ICHandlingBase::init_ic_data().

135  {
136  if( _ic_handler )
137  {
138  _ic_handler->init_ic_data( *system, all_ics );
139  }
140 
141  return;
142  }
GRINS::ICHandlingBase * _ic_handler
Definition: physics.h:258
virtual void init_ic_data(const libMesh::FEMSystem &system, libMesh::CompositeFunction< libMesh::Number > &all_ics)
Override this method to initialize any system-dependent data.
template<class Mu >
void GRINS::AveragedTurbineBase< Mu >::init_variables ( libMesh::FEMSystem *  system)
virtualinherited

Initialization of variables.

Add turbine_speed variable to system; call base function to initialize Navier-Stokes variables.

Reimplemented from GRINS::IncompressibleNavierStokesBase< Viscosity >.

Definition at line 57 of file averaged_turbine_base.C.

References GRINS::IncompressibleNavierStokesBase< Viscosity >::init_variables().

58  {
59  this->_fan_speed_var = system->add_variable(_fan_speed_var_name,
60  libMesh::FIRST,
61  libMesh::SCALAR);
62 
64  }
virtual void init_variables(libMesh::FEMSystem *system)
Initialization of Navier-Stokes variables.
bool GRINS::Physics::is_steady ( ) const
inherited

Returns whether or not this physics is being solved with a steady solver.

Definition at line 103 of file physics.C.

References GRINS::Physics::_is_steady.

Referenced by GRINS::Physics::set_is_steady().

104  {
105  return _is_steady;
106  }
static bool _is_steady
Caches whether or not the solver that's being used is steady or not.
Definition: physics.h:266
void GRINS::Physics::mass_residual ( bool  compute_jacobian,
AssemblyContext context,
CachedValues cache 
)
virtualinherited
void GRINS::Physics::nonlocal_constraint ( bool  compute_jacobian,
AssemblyContext context,
CachedValues cache 
)
virtualinherited

Constraint part(s) of physics for scalar variables.

Reimplemented in GRINS::ScalarODE.

Definition at line 250 of file physics.C.

Referenced by GRINS::MultiphysicsSystem::nonlocal_constraint().

253  {
254  return;
255  }
void GRINS::Physics::nonlocal_mass_residual ( bool  compute_jacobian,
AssemblyContext context,
CachedValues cache 
)
virtualinherited

Mass matrix part(s) for scalar variables.

Reimplemented in GRINS::ScalarODE, and GRINS::AveragedTurbine< Viscosity >.

Definition at line 264 of file physics.C.

Referenced by GRINS::MultiphysicsSystem::nonlocal_mass_residual().

267  {
268  return;
269  }
void GRINS::Physics::nonlocal_time_derivative ( bool  compute_jacobian,
AssemblyContext context,
CachedValues cache 
)
virtualinherited

Time dependent part(s) of physics for scalar variables.

Reimplemented in GRINS::AveragedTurbine< Viscosity >, and GRINS::ScalarODE.

Definition at line 229 of file physics.C.

Referenced by GRINS::MultiphysicsSystem::nonlocal_time_derivative().

232  {
233  return;
234  }
template<class Mu >
void GRINS::AveragedTurbineBase< Mu >::read_input_options ( const GetPot &  input)
virtualinherited

Read options from GetPot input file.

Reimplemented from GRINS::Physics.

Definition at line 76 of file averaged_turbine_base.C.

References GRINS::averaged_turbine, and GRINS::fan_speed_var_name_default.

Referenced by GRINS::AveragedTurbineBase< Viscosity >::AveragedTurbineBase().

77  {
78  std::string base_function =
79  input("Physics/"+averaged_turbine+"/base_velocity",
80  std::string("0"));
81 
82  if (base_function == "0")
83  libmesh_error_msg("Error! Zero AveragedTurbine specified!" <<
84  std::endl);
85 
86  if (base_function == "0")
87  this->base_velocity_function.reset
88  (new libMesh::ZeroFunction<libMesh::Number>());
89  else
90  this->base_velocity_function.reset
91  (new libMesh::ParsedFunction<libMesh::Number>(base_function));
92 
93  std::string vertical_function =
94  input("Physics/"+averaged_turbine+"/local_vertical",
95  std::string("0"));
96 
97  if (vertical_function == "0")
98  libmesh_error_msg("Warning! Zero LocalVertical specified!" <<
99  std::endl);
100 
101  this->local_vertical_function.reset
102  (new libMesh::ParsedFunction<libMesh::Number>(vertical_function));
103 
104  std::string lift_function_string =
105  input("Physics/"+averaged_turbine+"/lift",
106  std::string("0"));
107 
108  if (lift_function_string == "0")
109  std::cout << "Warning! Zero lift function specified!" << std::endl;
110 
111  this->lift_function.reset
112  (new libMesh::ParsedFunction<libMesh::Number>(lift_function_string));
113 
114  std::string drag_function_string =
115  input("Physics/"+averaged_turbine+"/drag",
116  std::string("0"));
117 
118  if (drag_function_string == "0")
119  std::cout << "Warning! Zero drag function specified!" << std::endl;
120 
121  this->drag_function.reset
122  (new libMesh::ParsedFunction<libMesh::Number>(drag_function_string));
123 
124  std::string chord_function_string =
125  input("Physics/"+averaged_turbine+"/chord_length",
126  std::string("0"));
127 
128  if (chord_function_string == "0")
129  libmesh_error_msg("Warning! Zero chord function specified!" <<
130  std::endl);
131 
132  this->chord_function.reset
133  (new libMesh::ParsedFunction<libMesh::Number>(chord_function_string));
134 
135  std::string area_function_string =
136  input("Physics/"+averaged_turbine+"/area_swept",
137  std::string("0"));
138 
139  if (area_function_string == "0")
140  libmesh_error_msg("Warning! Zero area_swept_function specified!" <<
141  std::endl);
142 
143  this->area_swept_function.reset
144  (new libMesh::ParsedFunction<libMesh::Number>(area_function_string));
145 
146  std::string aoa_function_string =
147  input("Physics/"+averaged_turbine+"/angle_of_attack",
148  std::string("00000"));
149 
150  if (aoa_function_string == "00000")
151  libmesh_error_msg("Warning! No angle-of-attack specified!" <<
152  std::endl);
153 
154  this->aoa_function.reset
155  (new libMesh::ParsedFunction<libMesh::Number>(aoa_function_string));
156 
157  std::string torque_function_string =
158  input("Physics/"+averaged_turbine+"/torque",
159  std::string("0"));
160 
161  if (torque_function_string == "0")
162  std::cout << "Warning! Zero torque function specified!" << std::endl;
163 
164  this->torque_function.reset
165  (new libMesh::ParsedFunction<libMesh::Number>(torque_function_string));
166 
167  this->set_parameter
168  (this->moment_of_inertia, input,
169  "Physics/"+averaged_turbine+"/moment_of_inertia",
170  libMesh::Number(0));
171 
172  if (!moment_of_inertia)
173  libmesh_error_msg(
174  "Error! Zero AveragedTurbine moment of inertia specified!" <<
175  std::endl);
176 
177  this->set_parameter
178  (this->initial_speed, input,
179  "Physics/"+averaged_turbine+"/initial_speed",
180  libMesh::Number(0));
181 
182  this->_fan_speed_var_name = input("Physics/VariableNames/fan_speed",
184 
185  }
virtual void set_parameter(libMesh::Number &param_variable, const GetPot &input, const std::string &param_name, libMesh::Number param_default)
Each subclass can simultaneously read a parameter value from.
const std::string fan_speed_var_name_default
fan speed
libMesh::AutoPtr< libMesh::FunctionBase< libMesh::Number > > torque_function
libMesh::AutoPtr< libMesh::FunctionBase< libMesh::Number > > drag_function
libMesh::AutoPtr< libMesh::FunctionBase< libMesh::Number > > aoa_function
libMesh::AutoPtr< libMesh::FunctionBase< libMesh::Number > > area_swept_function
const PhysicsName averaged_turbine
libMesh::AutoPtr< libMesh::FunctionBase< libMesh::Number > > chord_function
libMesh::AutoPtr< libMesh::FunctionBase< libMesh::Number > > local_vertical_function
libMesh::AutoPtr< libMesh::FunctionBase< libMesh::Number > > base_velocity_function
libMesh::AutoPtr< libMesh::FunctionBase< libMesh::Number > > lift_function
template<class Mu >
void GRINS::IncompressibleNavierStokesBase< Mu >::register_parameter ( const std::string &  param_name,
libMesh::ParameterMultiPointer< libMesh::Number > &  param_pointer 
) const
virtualinherited

Each subclass will register its copy of an independent.

Reimplemented from GRINS::ParameterUser.

Definition at line 114 of file inc_navier_stokes_base.C.

References GRINS::ParameterUser::register_parameter().

117  {
118  ParameterUser::register_parameter(param_name, param_pointer);
119  _mu.register_parameter(param_name, param_pointer);
120  }
virtual void register_parameter(const std::string &param_name, libMesh::ParameterMultiPointer< libMesh::Number > &param_pointer) const
Each subclass will register its copy of an independent.
void GRINS::Physics::register_postprocessing_vars ( const GetPot &  input,
PostProcessedQuantities< libMesh::Real > &  postprocessing 
)
virtualinherited

Register name of postprocessed quantity with PostProcessedQuantities.

Each Physics class will need to cache an unsigned int corresponding to each postprocessed quantity. This will be used in computing the values and putting them in the CachedVariables object.

Reimplemented in GRINS::ParsedVelocitySource< Viscosity >, GRINS::VelocityPenalty< Viscosity >, GRINS::IncompressibleNavierStokes< Viscosity >, GRINS::LowMachNavierStokes< Viscosity, SpecificHeat, ThermalConductivity >, GRINS::HeatTransfer< Conductivity >, GRINS::ElasticCable< StressStrainLaw >, GRINS::ElasticMembrane< StressStrainLaw >, and GRINS::ReactingLowMachNavierStokes< Mixture, Evaluator >.

Definition at line 161 of file physics.C.

163  {
164  return;
165  }
void GRINS::Physics::set_is_steady ( bool  is_steady)
inherited

Sets whether this physics is to be solved with a steady solver or not.

Since the member variable is static, only needs to be called on a single physics.

Definition at line 97 of file physics.C.

References GRINS::Physics::_is_steady, and GRINS::Physics::is_steady().

98  {
100  return;
101  }
bool is_steady() const
Returns whether or not this physics is being solved with a steady solver.
Definition: physics.C:103
static bool _is_steady
Caches whether or not the solver that's being used is steady or not.
Definition: physics.h:266
void GRINS::ParameterUser::set_parameter ( libMesh::Number &  param_variable,
const GetPot &  input,
const std::string &  param_name,
libMesh::Number  param_default 
)
virtualinherited

Each subclass can simultaneously read a parameter value from.

Definition at line 35 of file parameter_user.C.

References GRINS::ParameterUser::_my_name, and GRINS::ParameterUser::_my_parameters.

Referenced by GRINS::AveragedFanAdjointStabilization< Viscosity >::AveragedFanAdjointStabilization(), GRINS::AveragedTurbineAdjointStabilization< Viscosity >::AveragedTurbineAdjointStabilization(), GRINS::BoussinesqBuoyancyAdjointStabilization< Viscosity >::BoussinesqBuoyancyAdjointStabilization(), GRINS::BoussinesqBuoyancyBase::BoussinesqBuoyancyBase(), GRINS::BoussinesqBuoyancySPGSMStabilization< Viscosity >::BoussinesqBuoyancySPGSMStabilization(), GRINS::ConstantConductivity::ConstantConductivity(), GRINS::ConstantPrandtlConductivity::ConstantPrandtlConductivity(), GRINS::ConstantSourceFunction::ConstantSourceFunction(), GRINS::ConstantSourceTerm::ConstantSourceTerm(), GRINS::ConstantSpecificHeat::ConstantSpecificHeat(), GRINS::ConstantViscosity::ConstantViscosity(), GRINS::ElasticCable< StressStrainLaw >::ElasticCable(), GRINS::ElasticCableConstantGravity::ElasticCableConstantGravity(), GRINS::ElasticMembrane< StressStrainLaw >::ElasticMembrane(), GRINS::ElasticMembraneConstantPressure::ElasticMembraneConstantPressure(), GRINS::HeatConduction< Conductivity >::HeatConduction(), GRINS::HeatTransferBase< Conductivity >::HeatTransferBase(), GRINS::IncompressibleNavierStokesBase< Viscosity >::IncompressibleNavierStokesBase(), GRINS::AverageNusseltNumber::init(), GRINS::MooneyRivlin::MooneyRivlin(), GRINS::ReactingLowMachNavierStokesBase< Mixture, Evaluator >::ReactingLowMachNavierStokesBase(), GRINS::HookesLaw1D::read_input_options(), GRINS::HookesLaw::read_input_options(), GRINS::AxisymmetricBoussinesqBuoyancy::read_input_options(), and GRINS::VelocityDragAdjointStabilization< Viscosity >::VelocityDragAdjointStabilization().

39  {
40  param_variable = input(param_name, param_default);
41 
42  libmesh_assert_msg(!_my_parameters.count(param_name),
43  "ERROR: " << _my_name << " double-registered parameter " <<
44  param_name);
45 
46  _my_parameters[param_name] = &param_variable;
47  }
std::map< std::string, libMesh::Number * > _my_parameters
template<class Mu >
void GRINS::AveragedTurbineBase< Mu >::set_time_evolving_vars ( libMesh::FEMSystem *  system)
virtualinherited

Sets turbine_speed and velocity variables to be time-evolving.

Reimplemented from GRINS::IncompressibleNavierStokesBase< Viscosity >.

Definition at line 67 of file averaged_turbine_base.C.

References GRINS::IncompressibleNavierStokesBase< Viscosity >::set_time_evolving_vars().

68  {
69  system->time_evolving(this->fan_speed_var());
70 
72  }
virtual void set_time_evolving_vars(libMesh::FEMSystem *system)
Sets velocity variables to be time-evolving.
VariableIndex fan_speed_var() const
void GRINS::Physics::side_constraint ( bool  compute_jacobian,
AssemblyContext context,
CachedValues cache 
)
virtualinherited

Constraint part(s) of physics for boundaries of elements on the domain boundary.

Reimplemented in GRINS::IncompressibleNavierStokes< Viscosity >, GRINS::LowMachNavierStokes< Viscosity, SpecificHeat, ThermalConductivity >, and GRINS::ReactingLowMachNavierStokes< Mixture, Evaluator >.

Definition at line 243 of file physics.C.

Referenced by GRINS::MultiphysicsSystem::side_constraint().

246  {
247  return;
248  }
void GRINS::Physics::side_time_derivative ( bool  compute_jacobian,
AssemblyContext context,
CachedValues cache 
)
virtualinherited

Member Data Documentation

GRINS::BCHandlingBase* GRINS::Physics::_bc_handler
protectedinherited
template<class Viscosity >
unsigned int GRINS::IncompressibleNavierStokesBase< Viscosity >::_dim
protectedinherited

Physical dimension of problem.

Todo:
Do we really need to cache this?

Definition at line 79 of file inc_navier_stokes_base.h.

std::set<libMesh::subdomain_id_type> GRINS::Physics::_enabled_subdomains
protectedinherited

Subdomains on which the current Physics class is enabled.

Definition at line 261 of file physics.h.

Referenced by GRINS::Physics::enabled_on_elem(), and GRINS::Physics::read_input_options().

template<class Viscosity >
VariableIndex GRINS::AveragedTurbineBase< Viscosity >::_fan_speed_var
protectedinherited
template<class Viscosity >
std::string GRINS::AveragedTurbineBase< Viscosity >::_fan_speed_var_name
protectedinherited

Definition at line 140 of file averaged_turbine_base.h.

template<class Viscosity >
PrimitiveFlowFEVariables GRINS::IncompressibleNavierStokesBase< Viscosity >::_flow_vars
protectedinherited

Definition at line 81 of file inc_navier_stokes_base.h.

GRINS::ICHandlingBase* GRINS::Physics::_ic_handler
protectedinherited
bool GRINS::Physics::_is_axisymmetric
protectedinherited
bool GRINS::Physics::_is_steady = false
staticprotectedinherited

Caches whether or not the solver that's being used is steady or not.

This is need, for example, in flow stabilization as the tau terms change depending on whether the solver is steady or unsteady.

Definition at line 266 of file physics.h.

Referenced by GRINS::Physics::is_steady(), and GRINS::Physics::set_is_steady().

template<class Viscosity >
Viscosity GRINS::AveragedTurbineAdjointStabilization< Viscosity >::_mu
protected

Definition at line 71 of file averaged_turbine_adjoint_stab.h.

const PhysicsName GRINS::Physics::_physics_name
protectedinherited

Name of the physics object. Used for reading physics specific inputs.

We use a reference because the physics names are const global objects in GRINS namespace

No, we use a copy, because otherwise as soon as the memory in std::set<std::string> requested_physics gets overwritten we get in trouble.

Definition at line 254 of file physics.h.

Referenced by GRINS::SourceTermBase::parse_var_info(), and GRINS::Physics::read_input_options().

template<class Viscosity >
libMesh::Number GRINS::AveragedTurbineAdjointStabilization< Viscosity >::_rho
protected
template<class Viscosity >
IncompressibleNavierStokesStabilizationHelper GRINS::AveragedTurbineAdjointStabilization< Viscosity >::_stab_helper
protected

Definition at line 73 of file averaged_turbine_adjoint_stab.h.

template<class Viscosity >
libMesh::AutoPtr<libMesh::FunctionBase<libMesh::Number> > GRINS::AveragedTurbineBase< Viscosity >::aoa_function
protectedinherited

Definition at line 136 of file averaged_turbine_base.h.

template<class Viscosity >
libMesh::AutoPtr<libMesh::FunctionBase<libMesh::Number> > GRINS::AveragedTurbineBase< Viscosity >::area_swept_function
protectedinherited

Definition at line 131 of file averaged_turbine_base.h.

template<class Viscosity >
libMesh::AutoPtr<libMesh::FunctionBase<libMesh::Number> > GRINS::AveragedTurbineBase< Viscosity >::base_velocity_function
protectedinherited

Definition at line 86 of file averaged_turbine_base.h.

template<class Viscosity >
libMesh::AutoPtr<libMesh::FunctionBase<libMesh::Number> > GRINS::AveragedTurbineBase< Viscosity >::chord_function
protectedinherited

Definition at line 126 of file averaged_turbine_base.h.

template<class Viscosity >
libMesh::AutoPtr<libMesh::FunctionBase<libMesh::Number> > GRINS::AveragedTurbineBase< Viscosity >::drag_function
protectedinherited

Definition at line 98 of file averaged_turbine_base.h.

template<class Viscosity >
libMesh::Number GRINS::AveragedTurbineBase< Viscosity >::initial_speed
protectedinherited

Definition at line 122 of file averaged_turbine_base.h.

template<class Viscosity >
libMesh::AutoPtr<libMesh::FunctionBase<libMesh::Number> > GRINS::AveragedTurbineBase< Viscosity >::lift_function
protectedinherited

Definition at line 97 of file averaged_turbine_base.h.

template<class Viscosity >
libMesh::AutoPtr<libMesh::FunctionBase<libMesh::Number> > GRINS::AveragedTurbineBase< Viscosity >::local_vertical_function
protectedinherited

Definition at line 90 of file averaged_turbine_base.h.

template<class Viscosity >
libMesh::Number GRINS::AveragedTurbineBase< Viscosity >::moment_of_inertia
protectedinherited

Definition at line 118 of file averaged_turbine_base.h.

template<class Viscosity >
libMesh::AutoPtr<libMesh::FunctionBase<libMesh::Number> > GRINS::AveragedTurbineBase< Viscosity >::torque_function
protectedinherited

Definition at line 114 of file averaged_turbine_base.h.


The documentation for this class was generated from the following files:

Generated on Mon Jun 22 2015 21:32:22 for GRINS-0.6.0 by  doxygen 1.8.9.1