GRINS-0.8.0
List of all members | Public Member Functions | Protected Attributes | Private Member Functions
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)
 Time dependent part(s) of physics for element interiors. More...
 
virtual void element_constraint (bool compute_jacobian, AssemblyContext &context)
 Constraint part(s) of physics for element interiors. More...
 
- Public Member Functions inherited from GRINS::AveragedTurbineBase< Viscosity >
 AveragedTurbineBase (const std::string &physics_name, const GetPot &input)
 
 ~AveragedTurbineBase ()
 
virtual void set_time_evolving_vars (libMesh::FEMSystem *system)
 Sets turbine_speed and velocity variables to be time-evolving. 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
 
- Public Member Functions inherited from GRINS::IncompressibleNavierStokesBase< Viscosity >
 IncompressibleNavierStokesBase (const std::string &my_physics_name, const std::string &core_physics_name, const GetPot &input)
 
 ~IncompressibleNavierStokesBase ()
 
virtual void register_parameter (const std::string &param_name, libMesh::ParameterMultiAccessor< libMesh::Number > &param_pointer) const
 Each subclass will register its copy of an independent. More...
 
libMesh::Real get_viscosity_value (AssemblyContext &context, unsigned int qp) const
 
- Public Member Functions inherited from GRINS::Physics
 Physics (const GRINS::PhysicsName &physics_name, const GetPot &input)
 
virtual ~Physics ()
 
virtual void init_variables (libMesh::FEMSystem *)
 Initialize variables for this physics. 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 preassembly (MultiphysicsSystem &)
 Perform any necessary setup before element assembly begins. More...
 
virtual void reinit (MultiphysicsSystem &)
 Any reinitialization that needs to be done. More...
 
virtual void side_time_derivative (bool, AssemblyContext &)
 Time dependent part(s) of physics for boundaries of elements on the domain boundary. More...
 
virtual void nonlocal_time_derivative (bool, AssemblyContext &)
 Time dependent part(s) of physics for scalar variables. More...
 
virtual void side_constraint (bool, AssemblyContext &)
 Constraint part(s) of physics for boundaries of elements on the domain boundary. More...
 
virtual void nonlocal_constraint (bool, AssemblyContext &)
 Constraint part(s) of physics for scalar variables. More...
 
virtual void damping_residual (bool, AssemblyContext &)
 Damping matrix part(s) for element interiors. All boundary terms lie within the time_derivative part. More...
 
virtual void mass_residual (bool, AssemblyContext &)
 Mass matrix part(s) for element interiors. All boundary terms lie within the time_derivative part. More...
 
virtual void nonlocal_mass_residual (bool, AssemblyContext &)
 Mass matrix part(s) for scalar variables. More...
 
void init_ics (libMesh::FEMSystem *system, libMesh::CompositeFunction< libMesh::Number > &all_ics)
 
virtual void compute_element_time_derivative_cache (AssemblyContext &)
 
virtual void compute_side_time_derivative_cache (AssemblyContext &)
 
virtual void compute_nonlocal_time_derivative_cache (AssemblyContext &)
 
virtual void compute_element_constraint_cache (AssemblyContext &)
 
virtual void compute_side_constraint_cache (AssemblyContext &)
 
virtual void compute_nonlocal_constraint_cache (AssemblyContext &)
 
virtual void compute_damping_residual_cache (AssemblyContext &)
 
virtual void compute_mass_residual_cache (AssemblyContext &)
 
virtual void compute_nonlocal_mass_residual_cache (AssemblyContext &)
 
virtual void compute_postprocessed_quantity (unsigned int quantity_index, const AssemblyContext &context, const libMesh::Point &point, libMesh::Real &value)
 
ICHandlingBaseget_ic_handler ()
 
- Public Member Functions inherited from GRINS::ParameterUser
 ParameterUser (const std::string &user_name)
 
virtual ~ParameterUser ()
 
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...
 
virtual void set_parameter (libMesh::ParsedFunction< libMesh::Number, libMesh::Gradient > &func, const GetPot &input, const std::string &func_param_name, const std::string &param_default)
 Each subclass can simultaneously read a parsed function from. More...
 
virtual void set_parameter (libMesh::ParsedFEMFunction< libMesh::Number > &func, const GetPot &input, const std::string &func_param_name, const std::string &param_default)
 Each subclass can simultaneously read a parsed function from. More...
 
virtual void move_parameter (const libMesh::Number &old_parameter, libMesh::Number &new_parameter)
 When cloning an object, we need to update parameter pointers. More...
 
virtual void move_parameter (const libMesh::ParsedFunction< libMesh::Number, libMesh::Gradient > &old_func, libMesh::ParsedFunction< libMesh::Number, libMesh::Gradient > &new_func)
 When cloning an object, we need to update parameter pointers. More...
 
virtual void move_parameter (const libMesh::ParsedFEMFunction< libMesh::Number > &old_func, libMesh::ParsedFEMFunction< libMesh::Number > &new_func)
 When cloning an object, we need to update parameter pointers. More...
 

Protected Attributes

IncompressibleNavierStokesStabilizationHelper _stab_helper
 
- Protected Attributes inherited from GRINS::AveragedTurbineBase< Viscosity >
libMesh::ParsedFunction< libMesh::Number > base_velocity_function
 
libMesh::ParsedFunction< libMesh::Number > local_vertical_function
 
libMesh::ParsedFunction< libMesh::Number > lift_function
 
libMesh::ParsedFunction< libMesh::Number > drag_function
 
libMesh::ParsedFunction< libMesh::Number > torque_function
 
libMesh::Number moment_of_inertia
 
libMesh::Number initial_speed
 
libMesh::ParsedFunction< libMesh::Number > chord_function
 
libMesh::ParsedFunction< libMesh::Number > area_swept_function
 
libMesh::ParsedFunction< libMesh::Number > aoa_function
 
ScalarVariable_var
 
- Protected Attributes inherited from GRINS::IncompressibleNavierStokesBase< Viscosity >
VelocityVariable_flow_vars
 
PressureFEVariable_press_var
 
libMesh::Number _rho
 Material parameters, read from input. More...
 
Viscosity _mu
 Viscosity object. More...
 
- Protected Attributes inherited from GRINS::Physics
const PhysicsName _physics_name
 Name of the physics object. Used for reading physics specific inputs. More...
 
GRINS::ICHandlingBase_ic_handler
 
std::set< libMesh::subdomain_id_type > _enabled_subdomains
 Subdomains on which the current Physics class is enabled. More...
 

Private Member Functions

 AveragedTurbineAdjointStabilization ()
 

Additional Inherited Members

- Static Public Member Functions inherited from GRINS::Physics
static void set_is_axisymmetric (bool is_axisymmetric)
 Set whether we should treat the problem as axisymmetric. More...
 
static bool is_axisymmetric ()
 
- Static Public Attributes inherited from GRINS::ParameterUser
static std::string zero_vector_function = std::string("{0}")
 A parseable function string with LIBMESH_DIM components, all 0. More...
 
- Protected Member Functions inherited from GRINS::Physics
libMesh::UniquePtr< libMesh::FEGenericBase< libMesh::Real > > build_new_fe (const libMesh::Elem *elem, const libMesh::FEGenericBase< libMesh::Real > *fe, const libMesh::Point p)
 
void parse_enabled_subdomains (const GetPot &input, const std::string &physics_name)
 
void check_var_subdomain_consistency (const FEVariablesBase &var) const
 Check that var is enabled on at least the subdomains this Physics is. More...
 
- Static Protected Attributes inherited from GRINS::Physics
static bool _is_steady = false
 Caches whether or not the solver that's being used is steady or not. More...
 
static bool _is_axisymmetric = false
 Caches whether we are solving an axisymmetric problem or not. More...
 

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.

42  : AveragedTurbineBase<Mu>(physics_name, input),
43  _stab_helper( physics_name+"StabHelper", input )
44  {}
IncompressibleNavierStokesStabilizationHelper _stab_helper

Definition at line 47 of file averaged_turbine_adjoint_stab.C.

48  {
49  return;
50  }
template<class Viscosity >
GRINS::AveragedTurbineAdjointStabilization< Viscosity >::AveragedTurbineAdjointStabilization ( )
private

Member Function Documentation

template<class Mu >
void GRINS::AveragedTurbineAdjointStabilization< Mu >::element_constraint ( bool  ,
AssemblyContext  
)
virtual

Constraint part(s) of physics for element interiors.

Reimplemented from GRINS::Physics.

Definition at line 242 of file averaged_turbine_adjoint_stab.C.

243  {
244  // The number of local degrees of freedom in each variable.
245  const unsigned int n_p_dofs = context.get_dof_indices(this->_press_var.p()).size();
246  const unsigned int n_u_dofs = context.get_dof_indices(this->_flow_vars.u()).size();
247 
248  // Element Jacobian * quadrature weights for interior integration.
249  const std::vector<libMesh::Real> &JxW =
250  context.get_element_fe(this->_flow_vars.u())->get_JxW();
251 
252  const std::vector<libMesh::Point>& u_qpoint =
253  context.get_element_fe(this->_flow_vars.u())->get_xyz();
254 
255  const std::vector<std::vector<libMesh::Real> >& u_phi =
256  context.get_element_fe(this->_flow_vars.u())->get_phi();
257 
258  const std::vector<std::vector<libMesh::RealGradient> >& p_dphi =
259  context.get_element_fe(this->_press_var.p())->get_dphi();
260 
261  libMesh::DenseSubVector<libMesh::Number> &Fp = context.get_elem_residual(this->_press_var.p()); // R_{p}
262 
263  libMesh::DenseSubMatrix<libMesh::Number> &Kpu =
264  context.get_elem_jacobian(this->_press_var.p(), this->_flow_vars.u()); // J_{pu}
265  libMesh::DenseSubMatrix<libMesh::Number> &Kpv =
266  context.get_elem_jacobian(this->_press_var.p(), this->_flow_vars.v()); // J_{pv}
267  libMesh::DenseSubMatrix<libMesh::Number> &Kps =
268  context.get_elem_jacobian(this->_press_var.p(), this->fan_speed_var()); // J_{ps}
269 
270  libMesh::DenseSubMatrix<libMesh::Number> *Kpw = NULL;
271 
272  if(this->_flow_vars.dim() == 3)
273  {
274  Kpw = &context.get_elem_jacobian
275  (this->_press_var.p(), this->_flow_vars.w()); // J_{pw}
276  }
277 
278  // Now we will build the element Jacobian and residual.
279  // Constructing the residual requires the solution and its
280  // gradient from the previous timestep. This must be
281  // calculated at each quadrature point by summing the
282  // solution degree-of-freedom values by the appropriate
283  // weight functions.
284  unsigned int n_qpoints = context.get_element_qrule().n_points();
285 
286  libMesh::FEBase* fe = context.get_element_fe(this->_flow_vars.u());
287 
288  for (unsigned int qp=0; qp != n_qpoints; qp++)
289  {
290  libMesh::RealGradient g = this->_stab_helper.compute_g( fe, context, qp );
291  libMesh::RealTensor G = this->_stab_helper.compute_G( fe, context, qp );
292 
293  libMesh::RealGradient U( context.interior_value( this->_flow_vars.u(), qp ),
294  context.interior_value( this->_flow_vars.v(), qp ) );
295 
296  if( this->_flow_vars.dim() == 3 )
297  {
298  U(2) = context.interior_value( this->_flow_vars.w(), qp );
299  }
300 
301  libMesh::Number s = context.interior_value(this->fan_speed_var(), qp);
302 
303  // Compute the viscosity at this qp
304  libMesh::Real mu_qp = this->_mu(context, qp);
305 
306  libMesh::Real tau_M;
307  libMesh::Real d_tau_M_d_rho;
308  libMesh::Gradient d_tau_M_dU;
309 
310  if (compute_jacobian)
312  ( context, qp, g, G, this->_rho, U, mu_qp,
313  tau_M, d_tau_M_d_rho, d_tau_M_dU,
314  this->_is_steady );
315  else
316  tau_M = this->_stab_helper.compute_tau_momentum
317  ( context, qp, g, G, this->_rho, U, mu_qp,
318  this->_is_steady );
319 
320  libMesh::NumberVectorValue U_B_1;
321  libMesh::NumberVectorValue F;
322  libMesh::NumberTensorValue dFdU;
323  libMesh::NumberTensorValue* dFdU_ptr =
324  compute_jacobian ? &dFdU : NULL;
325  libMesh::NumberVectorValue dFds;
326  libMesh::NumberVectorValue* dFds_ptr =
327  compute_jacobian ? &dFds : NULL;
328  if (!this->compute_force(u_qpoint[qp], context.time, U, s,
329  U_B_1, F, dFdU_ptr, dFds_ptr))
330  continue;
331 
332  // First, an i-loop over the velocity degrees of freedom.
333  // We know that n_u_dofs == n_v_dofs so we can compute contributions
334  // for both at the same time.
335  for (unsigned int i=0; i != n_p_dofs; i++)
336  {
337  Fp(i) += -tau_M*(F*p_dphi[i][qp])*JxW[qp];
338 
339  if (compute_jacobian)
340  {
341  Kps(i,0) += -tau_M*(dFds*p_dphi[i][qp])*JxW[qp];
342 
343  for (unsigned int j=0; j != n_u_dofs; ++j)
344  {
345  Kpu(i,j) += -d_tau_M_dU(0)*u_phi[j][qp]*(F*p_dphi[i][qp])*JxW[qp];
346  Kpv(i,j) += -d_tau_M_dU(1)*u_phi[j][qp]*(F*p_dphi[i][qp])*JxW[qp];
347  for (unsigned int d=0; d != 3; ++d)
348  {
349  Kpu(i,j) += -tau_M*dFdU(d,0)*u_phi[j][qp]*p_dphi[i][qp](d)*JxW[qp];
350  Kpv(i,j) += -tau_M*dFdU(d,1)*u_phi[j][qp]*p_dphi[i][qp](d)*JxW[qp];
351  }
352  }
353  if( this->_flow_vars.dim() == 3 )
354  for (unsigned int j=0; j != n_u_dofs; ++j)
355  {
356  (*Kpw)(i,j) += -d_tau_M_dU(2)*u_phi[j][qp]*F*p_dphi[i][qp]*JxW[qp];
357  for (unsigned int d=0; d != 3; ++d)
358  {
359  (*Kpw)(i,j) += -tau_M*dFdU(d,2)*u_phi[j][qp]*p_dphi[i][qp](d)*JxW[qp];
360  }
361  }
362  }
363  }
364  } // End quadrature loop
365  }
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:69
libMesh::Number _rho
Material parameters, read from input.
libMesh::RealGradient compute_g(libMesh::FEBase *fe, AssemblyContext &c, unsigned int qp) const
Definition: stab_helper.C:47
VariableIndex p() const
static bool _is_steady
Caches whether or not the solver that's being used is steady or not.
Definition: physics.h:266
unsigned int dim() const
Number of components.
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  ,
AssemblyContext  
)
virtual

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

Reimplemented from GRINS::Physics.

Definition at line 67 of file averaged_turbine_adjoint_stab.C.

69  {
70  libMesh::FEBase* fe = context.get_element_fe(this->_flow_vars.u());
71 
72  // Element Jacobian * quadrature weights for interior integration
73  const std::vector<libMesh::Real> &JxW = fe->get_JxW();
74 
75  // The shape functions at interior quadrature points.
76  const std::vector<std::vector<libMesh::Real> >& u_phi = fe->get_phi();
77 
78  const std::vector<std::vector<libMesh::RealGradient> >& u_gradphi =
79  context.get_element_fe(this->_flow_vars.u())->get_dphi();
80 
81  const std::vector<std::vector<libMesh::RealTensor> >& u_hessphi =
82  context.get_element_fe(this->_flow_vars.u())->get_d2phi();
83 
84  const std::vector<libMesh::Point>& u_qpoint = fe->get_xyz();
85 
86  // The number of local degrees of freedom in each variable
87  const unsigned int n_u_dofs = context.get_dof_indices(this->_flow_vars.u()).size();
88 
89  // The subvectors and submatrices we need to fill:
90  libMesh::DenseSubMatrix<libMesh::Number> &Kuu = context.get_elem_jacobian(this->_flow_vars.u(), this->_flow_vars.u()); // R_{u},{u}
91  libMesh::DenseSubMatrix<libMesh::Number> &Kuv = context.get_elem_jacobian(this->_flow_vars.u(), this->_flow_vars.v()); // R_{u},{v}
92  libMesh::DenseSubMatrix<libMesh::Number> &Kvu = context.get_elem_jacobian(this->_flow_vars.v(), this->_flow_vars.u()); // R_{v},{u}
93  libMesh::DenseSubMatrix<libMesh::Number> &Kvv = context.get_elem_jacobian(this->_flow_vars.v(), this->_flow_vars.v()); // R_{v},{v}
94 
95  libMesh::DenseSubMatrix<libMesh::Number> &Kus =
96  context.get_elem_jacobian(this->_flow_vars.u(),
97  this->fan_speed_var()); // R_{u},{s}
98  libMesh::DenseSubMatrix<libMesh::Number> &Kvs =
99  context.get_elem_jacobian(this->_flow_vars.v(),
100  this->fan_speed_var()); // R_{v},{s}
101 
102  libMesh::DenseSubMatrix<libMesh::Number>* Kwu = NULL;
103  libMesh::DenseSubMatrix<libMesh::Number>* Kwv = NULL;
104  libMesh::DenseSubMatrix<libMesh::Number>* Kww = NULL;
105  libMesh::DenseSubMatrix<libMesh::Number>* Kuw = NULL;
106  libMesh::DenseSubMatrix<libMesh::Number>* Kvw = NULL;
107 
108  libMesh::DenseSubMatrix<libMesh::Number>* Kws = NULL;
109 
110  libMesh::DenseSubVector<libMesh::Number> &Fu = context.get_elem_residual(this->_flow_vars.u()); // R_{u}
111  libMesh::DenseSubVector<libMesh::Number> &Fv = context.get_elem_residual(this->_flow_vars.v()); // R_{v}
112  libMesh::DenseSubVector<libMesh::Number>* Fw = NULL;
113 
114  if( this->_flow_vars.dim() == 3 )
115  {
116  Kuw = &context.get_elem_jacobian(this->_flow_vars.u(), this->_flow_vars.w()); // R_{u},{w}
117  Kvw = &context.get_elem_jacobian(this->_flow_vars.v(), this->_flow_vars.w()); // R_{v},{w}
118 
119  Kwu = &context.get_elem_jacobian(this->_flow_vars.w(), this->_flow_vars.u()); // R_{w},{u}
120  Kwv = &context.get_elem_jacobian(this->_flow_vars.w(), this->_flow_vars.v()); // R_{w},{v}
121  Kww = &context.get_elem_jacobian(this->_flow_vars.w(), this->_flow_vars.w()); // R_{w},{w}
122 
123  Kws = &context.get_elem_jacobian(this->_flow_vars.w(), this->fan_speed_var()); // R_{w},{s}
124 
125  Fw = &context.get_elem_residual(this->_flow_vars.w()); // R_{w}
126  }
127 
128  unsigned int n_qpoints = context.get_element_qrule().n_points();
129 
130  for (unsigned int qp=0; qp != n_qpoints; qp++)
131  {
132  libMesh::RealGradient g = this->_stab_helper.compute_g( fe, context, qp );
133  libMesh::RealTensor G = this->_stab_helper.compute_G( fe, context, qp );
134 
135  libMesh::RealGradient U( context.interior_value( this->_flow_vars.u(), qp ),
136  context.interior_value( this->_flow_vars.v(), qp ) );
137 
138  if( this->_flow_vars.dim() == 3 )
139  {
140  U(2) = context.interior_value( this->_flow_vars.w(), qp );
141  }
142 
143  libMesh::Number s = context.interior_value(this->fan_speed_var(), qp);
144 
145  // Compute the viscosity at this qp
146  libMesh::Real mu_qp = this->_mu(context, qp);
147 
148  libMesh::Real tau_M;
149  libMesh::Real d_tau_M_d_rho;
150  libMesh::Gradient d_tau_M_dU;
151 
152  if (compute_jacobian)
154  ( context, qp, g, G, this->_rho, U, mu_qp,
155  tau_M, d_tau_M_d_rho, d_tau_M_dU,
156  this->_is_steady );
157  else
158  tau_M = this->_stab_helper.compute_tau_momentum
159  ( context, qp, g, G, this->_rho, U, mu_qp,
160  this->_is_steady );
161 
162  libMesh::NumberVectorValue U_B_1;
163  libMesh::NumberVectorValue F;
164  libMesh::NumberTensorValue dFdU;
165  libMesh::NumberTensorValue* dFdU_ptr =
166  compute_jacobian ? &dFdU : NULL;
167  libMesh::NumberVectorValue dFds;
168  libMesh::NumberVectorValue* dFds_ptr =
169  compute_jacobian ? &dFds : NULL;
170  if (!this->compute_force(u_qpoint[qp], context.time, U, s,
171  U_B_1, F, dFdU_ptr, dFds_ptr))
172  continue;
173 
174  for (unsigned int i=0; i != n_u_dofs; i++)
175  {
176  libMesh::Real test_func = this->_rho*U*u_gradphi[i][qp] +
177  mu_qp*( u_hessphi[i][qp](0,0) + u_hessphi[i][qp](1,1) + u_hessphi[i][qp](2,2) );
178  Fu(i) += tau_M*F(0)*test_func*JxW[qp];
179 
180  Fv(i) += tau_M*F(1)*test_func*JxW[qp];
181 
182  if (this->_flow_vars.dim() == 3)
183  {
184  (*Fw)(i) += tau_M*F(2)*test_func*JxW[qp];
185  }
186 
187  if (compute_jacobian)
188  {
189  libMesh::Gradient d_test_func_dU = this->_rho*u_gradphi[i][qp];
190 
191  for (unsigned int j=0; j != n_u_dofs; ++j)
192  {
193  Kuu(i,j) += tau_M*F(0)*d_test_func_dU(0)*u_phi[j][qp]*JxW[qp];
194  Kuu(i,j) += d_tau_M_dU(0)*u_phi[j][qp]*F(0)*test_func*JxW[qp];
195  Kuu(i,j) += tau_M*dFdU(0,0)*u_phi[j][qp]*test_func*JxW[qp];
196  Kuv(i,j) += tau_M*F(0)*d_test_func_dU(1)*u_phi[j][qp]*JxW[qp];
197  Kuv(i,j) += d_tau_M_dU(1)*u_phi[j][qp]*F(0)*test_func*JxW[qp];
198  Kuv(i,j) += tau_M*dFdU(0,1)*u_phi[j][qp]*test_func*JxW[qp];
199  Kvu(i,j) += tau_M*F(1)*d_test_func_dU(0)*u_phi[j][qp]*JxW[qp];
200  Kvu(i,j) += d_tau_M_dU(0)*u_phi[j][qp]*F(1)*test_func*JxW[qp];
201  Kvu(i,j) += tau_M*dFdU(1,0)*u_phi[j][qp]*test_func*JxW[qp];
202  Kvv(i,j) += tau_M*F(1)*d_test_func_dU(1)*u_phi[j][qp]*JxW[qp];
203  Kvv(i,j) += d_tau_M_dU(1)*u_phi[j][qp]*F(1)*test_func*JxW[qp];
204  Kvv(i,j) += tau_M*dFdU(1,1)*u_phi[j][qp]*test_func*JxW[qp];
205 
206  Kus(i,0) += tau_M*dFds(0)*test_func*JxW[qp];
207  Kvs(i,0) += tau_M*dFds(1)*test_func*JxW[qp];
208  }
209 
210  if (this->_flow_vars.dim() == 3)
211  {
212  for (unsigned int j=0; j != n_u_dofs; ++j)
213  {
214  (*Kuw)(i,j) += tau_M*F(0)*d_test_func_dU(2)*u_phi[j][qp]*JxW[qp];
215  (*Kuw)(i,j) += d_tau_M_dU(2)*u_phi[j][qp]*F(0)*test_func*JxW[qp];
216  (*Kuw)(i,j) += tau_M*dFdU(0,2)*u_phi[j][qp]*test_func*JxW[qp];
217  (*Kvw)(i,j) += tau_M*F(1)*d_test_func_dU(2)*u_phi[j][qp]*JxW[qp];
218  (*Kvw)(i,j) += d_tau_M_dU(2)*u_phi[j][qp]*F(1)*test_func*JxW[qp];
219  (*Kvw)(i,j) += tau_M*dFdU(1,2)*u_phi[j][qp]*test_func*JxW[qp];
220  (*Kwu)(i,j) += tau_M*F(2)*d_test_func_dU(0)*u_phi[j][qp]*JxW[qp];
221  (*Kwu)(i,j) += d_tau_M_dU(0)*u_phi[j][qp]*F(2)*test_func*JxW[qp];
222  (*Kwu)(i,j) += tau_M*dFdU(2,0)*u_phi[j][qp]*test_func*JxW[qp];
223  (*Kwv)(i,j) += tau_M*F(2)*d_test_func_dU(1)*u_phi[j][qp]*JxW[qp];
224  (*Kwv)(i,j) += d_tau_M_dU(1)*u_phi[j][qp]*F(2)*test_func*JxW[qp];
225  (*Kwv)(i,j) += tau_M*dFdU(2,1)*u_phi[j][qp]*test_func*JxW[qp];
226  (*Kww)(i,j) += tau_M*F(2)*d_test_func_dU(2)*u_phi[j][qp]*JxW[qp];
227  (*Kww)(i,j) += d_tau_M_dU(2)*u_phi[j][qp]*F(2)*test_func*JxW[qp];
228  (*Kww)(i,j) += tau_M*dFdU(2,2)*u_phi[j][qp]*test_func*JxW[qp];
229 
230  (*Kws)(i,0) += tau_M*dFds(2)*test_func*JxW[qp];
231  }
232  }
233 
234  } // End compute_jacobian check
235 
236  } // End i dof loop
237  }
238  }
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:69
libMesh::Number _rho
Material parameters, read from input.
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
unsigned int dim() const
Number of components.
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 >::init_context ( AssemblyContext context)
virtual

Initialize context for added physics variables.

Reimplemented from GRINS::IncompressibleNavierStokesBase< Viscosity >.

Definition at line 53 of file averaged_turbine_adjoint_stab.C.

54  {
55  context.get_element_fe(this->_press_var.p())->get_dphi();
56 
57  context.get_element_fe(this->_flow_vars.u())->get_xyz();
58  context.get_element_fe(this->_flow_vars.u())->get_phi();
59  context.get_element_fe(this->_flow_vars.u())->get_dphi();
60  context.get_element_fe(this->_flow_vars.u())->get_d2phi();
61 
62  return;
63  }
VariableIndex p() const

Member Data Documentation

template<class Viscosity >
IncompressibleNavierStokesStabilizationHelper GRINS::AveragedTurbineAdjointStabilization< Viscosity >::_stab_helper
protected

Definition at line 67 of file averaged_turbine_adjoint_stab.h.


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

Generated on Tue Dec 19 2017 12:47:30 for GRINS-0.8.0 by  doxygen 1.8.9.1