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

Physics class for Incompressible Navier-Stokes. More...

#include <inc_navier_stokes.h>

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

Public Member Functions

 IncompressibleNavierStokes (const std::string &physics_name, const GetPot &input)
 
 ~IncompressibleNavierStokes ()
 
virtual void read_input_options (const GetPot &input)
 Read options from GetPot input file. More...
 
virtual void register_postprocessing_vars (const GetPot &input, PostProcessedQuantities< libMesh::Real > &postprocessing)
 Register postprocessing variables for IncompressibleNavierStokes. 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 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 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 compute_postprocessed_quantity (unsigned int quantity_index, const AssemblyContext &context, const libMesh::Point &point, libMesh::Real &value)
 Compute value of postprocessed quantities at libMesh::Point. More...
 
virtual void init_variables (libMesh::FEMSystem *system)
 Initialization of Navier-Stokes variables. More...
 
virtual void set_time_evolving_vars (libMesh::FEMSystem *system)
 Sets velocity variables to be time-evolving. More...
 
virtual void init_context (AssemblyContext &context)
 Initialize context for added physics variables. More...
 
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 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 nonlocal_constraint (bool compute_jacobian, AssemblyContext &context, CachedValues &cache)
 Constraint part(s) of physics for scalar variables. 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)
 
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

PressurePinning _p_pinning
 
bool _pin_pressure
 Enable pressure pinning. More...
 
unsigned int _mu_index
 Index from registering this quantity. More...
 
unsigned int _dim
 Physical dimension of problem. More...
 
PrimitiveFlowFEVariables _flow_vars
 
libMesh::Number _rho
 Material parameters, read from input. More...
 
Viscosity _mu
 Viscosity object. More...
 
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

 IncompressibleNavierStokes ()
 

Detailed Description

template<class Viscosity>
class GRINS::IncompressibleNavierStokes< Viscosity >

Physics class for Incompressible Navier-Stokes.

This physics class implements the classical Incompressible Navier-Stokes equations. This is a templated class, the class Viscosity can be instantiated as a specific type (right now:ConstantViscosity or SpatiallyVaryingViscosity) to allow the user to specify a constant or spatially varying viscosity in the input file

Definition at line 44 of file inc_navier_stokes.h.

Constructor & Destructor Documentation

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

Definition at line 43 of file inc_navier_stokes.C.

References GRINS::Physics::_bc_handler, GRINS::Physics::_ic_handler, GRINS::Physics::_is_axisymmetric, GRINS::BCHandlingBase::is_axisymmetric(), and GRINS::IncompressibleNavierStokes< Viscosity >::read_input_options().

44  : IncompressibleNavierStokesBase<Mu>(physics_name,
45  incompressible_navier_stokes, /* "core" Physics name */
46  input),
47  _p_pinning(input,physics_name),
48  _mu_index(0)
49  {
50  this->read_input_options(input);
51 
52  // This is deleted in the base class
53  this->_bc_handler = new IncompressibleNavierStokesBCHandling( physics_name, input );
54 
55  if( this->_bc_handler->is_axisymmetric() )
56  {
57  this->_is_axisymmetric = true;
58  }
59 
60  this->_ic_handler = new GenericICHandler( physics_name, input );
61 
62  return;
63  }
const PhysicsName incompressible_navier_stokes
GRINS::ICHandlingBase * _ic_handler
Definition: physics.h:258
GRINS::BCHandlingBase * _bc_handler
Definition: physics.h:256
bool is_axisymmetric() const
unsigned int _mu_index
Index from registering this quantity.
virtual void read_input_options(const GetPot &input)
Read options from GetPot input file.
bool _is_axisymmetric
Definition: physics.h:268

Definition at line 66 of file inc_navier_stokes.C.

67  {
68  return;
69  }
template<class Viscosity >
GRINS::IncompressibleNavierStokes< Viscosity >::IncompressibleNavierStokes ( )
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
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  }
template<class Mu >
void GRINS::IncompressibleNavierStokes< Mu >::compute_postprocessed_quantity ( unsigned int  quantity_index,
const AssemblyContext context,
const libMesh::Point &  point,
libMesh::Real &  value 
)
virtual

Compute value of postprocessed quantities at libMesh::Point.

Reimplemented from GRINS::Physics.

Definition at line 575 of file inc_navier_stokes.C.

579  {
580  if( quantity_index == this->_mu_index )
581  {
582  value = this->_mu(point, context.get_time());
583  }
584 
585  return;
586  }
unsigned int _mu_index
Index from registering this quantity.
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::IncompressibleNavierStokes< 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 351 of file inc_navier_stokes.C.

354  {
355 #ifdef GRINS_USE_GRVY_TIMERS
356  this->_timer->BeginTimer("IncompressibleNavierStokes::element_constraint");
357 #endif
358 
359  // The number of local degrees of freedom in each variable.
360  const unsigned int n_u_dofs = context.get_dof_indices(this->_flow_vars.u_var()).size();
361  const unsigned int n_p_dofs = context.get_dof_indices(this->_flow_vars.p_var()).size();
362 
363  // We get some references to cell-specific data that
364  // will be used to assemble the linear system.
365 
366  // Element Jacobian * quadrature weights for interior integration.
367  const std::vector<libMesh::Real> &JxW =
368  context.get_element_fe(this->_flow_vars.u_var())->get_JxW();
369 
370  // The velocity shape function gradients (in global coords.)
371  // at interior quadrature points.
372  const std::vector<std::vector<libMesh::RealGradient> >& u_gradphi =
373  context.get_element_fe(this->_flow_vars.u_var())->get_dphi();
374 
375  // The velocity shape function gradients (in global coords.)
376  // at interior quadrature points.
377  const std::vector<std::vector<libMesh::Real> >& u_phi =
378  context.get_element_fe(this->_flow_vars.u_var())->get_phi();
379 
380  // The pressure shape functions at interior quadrature points.
381  const std::vector<std::vector<libMesh::Real> >& p_phi =
382  context.get_element_fe(this->_flow_vars.p_var())->get_phi();
383 
384  const std::vector<libMesh::Point>& u_qpoint =
385  context.get_element_fe(this->_flow_vars.u_var())->get_xyz();
386 
387  // The subvectors and submatrices we need to fill:
388  //
389  // Kpu, Kpv, Kpw, Fp
390 
391  libMesh::DenseSubMatrix<libMesh::Number> &Kpu = context.get_elem_jacobian(this->_flow_vars.p_var(), this->_flow_vars.u_var()); // R_{p},{u}
392  libMesh::DenseSubMatrix<libMesh::Number> &Kpv = context.get_elem_jacobian(this->_flow_vars.p_var(), this->_flow_vars.v_var()); // R_{p},{v}
393  libMesh::DenseSubMatrix<libMesh::Number>* Kpw = NULL;
394 
395  libMesh::DenseSubVector<libMesh::Number> &Fp = context.get_elem_residual(this->_flow_vars.p_var()); // R_{p}
396 
397  if( this->_dim == 3 )
398  {
399  Kpw = &context.get_elem_jacobian(this->_flow_vars.p_var(), this->_flow_vars.w_var()); // R_{p},{w}
400  }
401 
402  // Add the constraint given by the continuity equation.
403  unsigned int n_qpoints = context.get_element_qrule().n_points();
404  for (unsigned int qp=0; qp != n_qpoints; qp++)
405  {
406  // Compute the velocity gradient at the old Newton iterate.
407  libMesh::Gradient grad_u, grad_v, grad_w;
408  grad_u = context.interior_gradient(this->_flow_vars.u_var(), qp);
409  grad_v = context.interior_gradient(this->_flow_vars.v_var(), qp);
410  if (this->_dim == 3)
411  grad_w = context.interior_gradient(this->_flow_vars.w_var(), qp);
412 
413  libMesh::Number divU = grad_u(0) + grad_v(1);
414  if (this->_dim == 3)
415  divU += grad_w(2);
416 
417  const libMesh::Number r = u_qpoint[qp](0);
418 
419  libMesh::Real jac = JxW[qp];
420 
421  if( this->_is_axisymmetric )
422  {
423  libMesh::Number u = context.interior_value( this->_flow_vars.u_var(), qp );
424  divU += u/r;
425  jac *= r;
426  }
427 
428  // Now a loop over the pressure degrees of freedom. This
429  // computes the contributions of the continuity equation.
430  for (unsigned int i=0; i != n_p_dofs; i++)
431  {
432  Fp(i) += p_phi[i][qp]*divU*jac;
433 
434  if (compute_jacobian)
435  {
436  libmesh_assert_equal_to (context.get_elem_solution_derivative(), 1.0);
437 
438  for (unsigned int j=0; j != n_u_dofs; j++)
439  {
440  Kpu(i,j) += p_phi[i][qp]*u_gradphi[j][qp](0)*jac * context.get_elem_solution_derivative();
441  Kpv(i,j) += p_phi[i][qp]*u_gradphi[j][qp](1)*jac * context.get_elem_solution_derivative();
442  if (this->_dim == 3)
443  (*Kpw)(i,j) += p_phi[i][qp]*u_gradphi[j][qp](2)*jac * context.get_elem_solution_derivative();
444 
445  if( this->_is_axisymmetric )
446  {
447  Kpu(i,j) += p_phi[i][qp]*u_phi[j][qp]/r*jac * context.get_elem_solution_derivative();
448  }
449  } // end of the inner dof (j) loop
450 
451  } // end - if (compute_jacobian)
452 
453  } // end of the outer dof (i) loop
454  } // end of the quadrature point (qp) loop
455 
456 
457 
458 
459 
460 #ifdef GRINS_USE_GRVY_TIMERS
461  this->_timer->EndTimer("IncompressibleNavierStokes::element_constraint");
462 #endif
463 
464  return;
465  }
unsigned int _dim
Physical dimension of problem.
bool _is_axisymmetric
Definition: physics.h:268
template<class Mu >
void GRINS::IncompressibleNavierStokes< Mu >::element_time_derivative ( bool  compute_jacobian,
AssemblyContext context,
CachedValues cache 
)
virtual

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

Todo:
Would it be better to put this in its own DoF loop and do the if check once?

Reimplemented from GRINS::Physics.

Definition at line 114 of file inc_navier_stokes.C.

117  {
118 #ifdef GRINS_USE_GRVY_TIMERS
119  this->_timer->BeginTimer("IncompressibleNavierStokes::element_time_derivative");
120 #endif
121 
122  // The number of local degrees of freedom in each variable.
123  const unsigned int n_u_dofs = context.get_dof_indices(this->_flow_vars.u_var()).size();
124  const unsigned int n_p_dofs = context.get_dof_indices(this->_flow_vars.p_var()).size();
125 
126  // Check number of dofs is same for this->_flow_vars.u_var(), v_var and w_var.
127  libmesh_assert (n_u_dofs == context.get_dof_indices(this->_flow_vars.v_var()).size());
128  if (this->_dim == 3)
129  libmesh_assert (n_u_dofs == context.get_dof_indices(this->_flow_vars.w_var()).size());
130 
131  // We get some references to cell-specific data that
132  // will be used to assemble the linear system.
133 
134  // Element Jacobian * quadrature weights for interior integration.
135  const std::vector<libMesh::Real> &JxW =
136  context.get_element_fe(this->_flow_vars.u_var())->get_JxW();
137 
138  // The velocity shape functions at interior quadrature points.
139  const std::vector<std::vector<libMesh::Real> >& u_phi =
140  context.get_element_fe(this->_flow_vars.u_var())->get_phi();
141 
142  // The velocity shape function gradients (in global coords.)
143  // at interior quadrature points.
144  const std::vector<std::vector<libMesh::RealGradient> >& u_gradphi =
145  context.get_element_fe(this->_flow_vars.u_var())->get_dphi();
146 
147  // The pressure shape functions at interior quadrature points.
148  const std::vector<std::vector<libMesh::Real> >& p_phi =
149  context.get_element_fe(this->_flow_vars.p_var())->get_phi();
150 
151  const std::vector<libMesh::Point>& u_qpoint =
152  context.get_element_fe(this->_flow_vars.u_var())->get_xyz();
153 
154  // The subvectors and submatrices we need to fill:
155  //
156  // K_{\alpha \beta} = R_{\alpha},{\beta} = \partial{ R_{\alpha} } / \partial{ {\beta} } (where R denotes residual)
157  // e.g., for \alpha = v and \beta = u we get: K{vu} = R_{v},{u}
158  // Note that Kpu, Kpv, Kpw and Fp comes as constraint.
159 
160  libMesh::DenseSubMatrix<libMesh::Number> &Kuu = context.get_elem_jacobian(this->_flow_vars.u_var(), this->_flow_vars.u_var()); // R_{u},{u}
161  libMesh::DenseSubMatrix<libMesh::Number> &Kuv = context.get_elem_jacobian(this->_flow_vars.u_var(), this->_flow_vars.v_var()); // R_{u},{v}
162  libMesh::DenseSubMatrix<libMesh::Number>* Kuw = NULL;
163 
164  libMesh::DenseSubMatrix<libMesh::Number> &Kvu = context.get_elem_jacobian(this->_flow_vars.v_var(), this->_flow_vars.u_var()); // R_{v},{u}
165  libMesh::DenseSubMatrix<libMesh::Number> &Kvv = context.get_elem_jacobian(this->_flow_vars.v_var(), this->_flow_vars.v_var()); // R_{v},{v}
166  libMesh::DenseSubMatrix<libMesh::Number>* Kvw = NULL;
167 
168  libMesh::DenseSubMatrix<libMesh::Number>* Kwu = NULL;
169  libMesh::DenseSubMatrix<libMesh::Number>* Kwv = NULL;
170  libMesh::DenseSubMatrix<libMesh::Number>* Kww = NULL;
171 
172  libMesh::DenseSubMatrix<libMesh::Number> &Kup = context.get_elem_jacobian(this->_flow_vars.u_var(), this->_flow_vars.p_var()); // R_{u},{p}
173  libMesh::DenseSubMatrix<libMesh::Number> &Kvp = context.get_elem_jacobian(this->_flow_vars.v_var(), this->_flow_vars.p_var()); // R_{v},{p}
174  libMesh::DenseSubMatrix<libMesh::Number>* Kwp = NULL;
175 
176  libMesh::DenseSubVector<libMesh::Number> &Fu = context.get_elem_residual(this->_flow_vars.u_var()); // R_{u}
177  libMesh::DenseSubVector<libMesh::Number> &Fv = context.get_elem_residual(this->_flow_vars.v_var()); // R_{v}
178  libMesh::DenseSubVector<libMesh::Number>* Fw = NULL;
179 
180  if( this->_dim == 3 )
181  {
182  Kuw = &context.get_elem_jacobian(this->_flow_vars.u_var(), this->_flow_vars.w_var()); // R_{u},{w}
183  Kvw = &context.get_elem_jacobian(this->_flow_vars.v_var(), this->_flow_vars.w_var()); // R_{v},{w}
184  Kwu = &context.get_elem_jacobian(this->_flow_vars.w_var(), this->_flow_vars.u_var()); // R_{w},{u};
185  Kwv = &context.get_elem_jacobian(this->_flow_vars.w_var(), this->_flow_vars.v_var()); // R_{w},{v};
186  Kww = &context.get_elem_jacobian(this->_flow_vars.w_var(), this->_flow_vars.w_var()); // R_{w},{w}
187  Kwp = &context.get_elem_jacobian(this->_flow_vars.w_var(), this->_flow_vars.p_var()); // R_{w},{p}
188  Fw = &context.get_elem_residual(this->_flow_vars.w_var()); // R_{w}
189  }
190 
191  // Now we will build the element Jacobian and residual.
192  // Constructing the residual requires the solution and its
193  // gradient from the previous timestep. This must be
194  // calculated at each quadrature point by summing the
195  // solution degree-of-freedom values by the appropriate
196  // weight functions.
197  unsigned int n_qpoints = context.get_element_qrule().n_points();
198 
199  for (unsigned int qp=0; qp != n_qpoints; qp++)
200  {
201  // Compute the solution & its gradient at the old Newton iterate.
202  libMesh::Number p, u, v;
203  p = context.interior_value(this->_flow_vars.p_var(), qp);
204  u = context.interior_value(this->_flow_vars.u_var(), qp);
205  v = context.interior_value(this->_flow_vars.v_var(), qp);
206 
207  libMesh::Gradient grad_u, grad_v, grad_w;
208  grad_u = context.interior_gradient(this->_flow_vars.u_var(), qp);
209  grad_v = context.interior_gradient(this->_flow_vars.v_var(), qp);
210  if (this->_dim == 3)
211  grad_w = context.interior_gradient(this->_flow_vars.w_var(), qp);
212 
213  libMesh::NumberVectorValue U(u,v);
214  if (this->_dim == 3)
215  U(2) = context.interior_value(this->_flow_vars.w_var(), qp); // w
216 
217  const libMesh::Number grad_u_x = grad_u(0);
218  const libMesh::Number grad_u_y = grad_u(1);
219  const libMesh::Number grad_u_z = (this->_dim == 3)?grad_u(2):0;
220  const libMesh::Number grad_v_x = grad_v(0);
221  const libMesh::Number grad_v_y = grad_v(1);
222  const libMesh::Number grad_v_z = (this->_dim == 3)?grad_v(2):0;
223  const libMesh::Number grad_w_x = (this->_dim == 3)?grad_w(0):0;
224  const libMesh::Number grad_w_y = (this->_dim == 3)?grad_w(1):0;
225  const libMesh::Number grad_w_z = (this->_dim == 3)?grad_w(2):0;
226 
227  const libMesh::Number r = u_qpoint[qp](0);
228 
229  libMesh::Real jac = JxW[qp];
230 
231  // Compute the viscosity at this qp
232  libMesh::Real _mu_qp = this->_mu(context, qp);
233 
234  if( this->_is_axisymmetric )
235  {
236  jac *= r;
237  }
238 
239  // First, an i-loop over the velocity degrees of freedom.
240  // We know that n_u_dofs == n_v_dofs so we can compute contributions
241  // for both at the same time.
242  for (unsigned int i=0; i != n_u_dofs; i++)
243  {
244  Fu(i) += jac *
245  (-this->_rho*u_phi[i][qp]*(U*grad_u) // convection term
246  +p*u_gradphi[i][qp](0) // pressure term
247  -_mu_qp*(u_gradphi[i][qp]*grad_u) ); // diffusion term
248 
250  if( this->_is_axisymmetric )
251  {
252  Fu(i) += u_phi[i][qp]*( p/r - _mu_qp*U(0)/(r*r) )*jac;
253  }
254 
255  Fv(i) += jac *
256  (-this->_rho*u_phi[i][qp]*(U*grad_v) // convection term
257  +p*u_gradphi[i][qp](1) // pressure term
258  -_mu_qp*(u_gradphi[i][qp]*grad_v) ); // diffusion term
259 
260  if (this->_dim == 3)
261  {
262  (*Fw)(i) += jac *
263  (-this->_rho*u_phi[i][qp]*(U*grad_w) // convection term
264  +p*u_gradphi[i][qp](2) // pressure term
265  -_mu_qp*(u_gradphi[i][qp]*grad_w) ); // diffusion term
266  }
267 
268  if (compute_jacobian)
269  {
270  for (unsigned int j=0; j != n_u_dofs; j++)
271  {
272  // TODO: precompute some terms like:
273  // (Uvec*u_gradphi[j][qp]),
274  // u_phi[i][qp]*u_phi[j][qp],
275  // (u_gradphi[i][qp]*u_gradphi[j][qp])
276 
277  Kuu(i,j) += jac * context.get_elem_solution_derivative() *
278  (-this->_rho*u_phi[i][qp]*(U*u_gradphi[j][qp]) // convection term
279  -this->_rho*u_phi[i][qp]*grad_u_x*u_phi[j][qp] // convection term
280  -_mu_qp*(u_gradphi[i][qp]*u_gradphi[j][qp])); // diffusion term
281 
282 
283  if( this->_is_axisymmetric )
284  {
285  Kuu(i,j) -= u_phi[i][qp]*_mu_qp*u_phi[j][qp]/(r*r)*jac * context.get_elem_solution_derivative();
286  }
287 
288  Kuv(i,j) += jac * context.get_elem_solution_derivative() *
289  (-this->_rho*u_phi[i][qp]*grad_u_y*u_phi[j][qp]); // convection term
290 
291  Kvv(i,j) += jac * context.get_elem_solution_derivative() *
292  (-this->_rho*u_phi[i][qp]*(U*u_gradphi[j][qp]) // convection term
293  -this->_rho*u_phi[i][qp]*grad_v_y*u_phi[j][qp] // convection term
294  -_mu_qp*(u_gradphi[i][qp]*u_gradphi[j][qp])); // diffusion term
295 
296  Kvu(i,j) += jac * context.get_elem_solution_derivative() *
297  (-this->_rho*u_phi[i][qp]*grad_v_x*u_phi[j][qp]); // convection term
298 
299  if (this->_dim == 3)
300  {
301  (*Kuw)(i,j) += jac * context.get_elem_solution_derivative() *
302  (-this->_rho*u_phi[i][qp]*grad_u_z*u_phi[j][qp]); // convection term
303 
304  (*Kvw)(i,j) += jac * context.get_elem_solution_derivative() *
305  (-this->_rho*u_phi[i][qp]*grad_v_z*u_phi[j][qp]); // convection term
306 
307  (*Kww)(i,j) += jac * context.get_elem_solution_derivative() *
308  (-this->_rho*u_phi[i][qp]*(U*u_gradphi[j][qp]) // convection term
309  -this->_rho*u_phi[i][qp]*grad_w_z*u_phi[j][qp] // convection term
310  -_mu_qp*(u_gradphi[i][qp]*u_gradphi[j][qp])); // diffusion term
311  (*Kwu)(i,j) += jac * context.get_elem_solution_derivative() *
312  (-this->_rho*u_phi[i][qp]*grad_w_x*u_phi[j][qp]); // convection term
313  (*Kwv)(i,j) += jac * context.get_elem_solution_derivative() *
314  (-this->_rho*u_phi[i][qp]*grad_w_y*u_phi[j][qp]); // convection term
315  }
316  } // end of the inner dof (j) loop
317 
318  // Matrix contributions for the up, vp and wp couplings
319  for (unsigned int j=0; j != n_p_dofs; j++)
320  {
321  Kup(i,j) += u_gradphi[i][qp](0)*p_phi[j][qp]*jac * context.get_elem_solution_derivative();
322  Kvp(i,j) += u_gradphi[i][qp](1)*p_phi[j][qp]*jac * context.get_elem_solution_derivative();
323 
324  if (this->_dim == 3)
325  {
326  (*Kwp)(i,j) += u_gradphi[i][qp](2)*p_phi[j][qp]*jac * context.get_elem_solution_derivative();
327  }
328 
329  if( this->_is_axisymmetric )
330  {
331  Kup(i,j) += u_phi[i][qp]*p_phi[j][qp]/r*jac * context.get_elem_solution_derivative();
332  }
333 
334  } // end of the inner dof (j) loop
335 
336 
337 
338  } // end - if (compute_jacobian)
339 
340  } // end of the outer dof (i) loop
341  } // end of the quadrature point (qp) loop
342 
343 #ifdef GRINS_USE_GRVY_TIMERS
344  this->_timer->EndTimer("IncompressibleNavierStokes::element_time_derivative");
345 #endif
346 
347  return;
348  }
libMesh::Number _rho
Material parameters, read from input.
unsigned int _dim
Physical dimension of problem.
bool _is_axisymmetric
Definition: physics.h:268
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
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::IncompressibleNavierStokesBase< Mu >::init_context ( AssemblyContext context)
virtualinherited

Initialize context for added physics variables.

Reimplemented from GRINS::Physics.

Reimplemented in GRINS::AveragedTurbine< Viscosity >, GRINS::VelocityDrag< Viscosity >, GRINS::AveragedFan< Viscosity >, GRINS::ParsedVelocitySource< Viscosity >, GRINS::VelocityPenalty< Viscosity >, GRINS::AveragedTurbineAdjointStabilization< Viscosity >, GRINS::VelocityDragAdjointStabilization< Viscosity >, GRINS::AveragedFanAdjointStabilization< Viscosity >, GRINS::ParsedVelocitySourceAdjointStabilization< Viscosity >, GRINS::VelocityPenaltyAdjointStabilization< Viscosity >, and GRINS::IncompressibleNavierStokesStabilizationBase< Viscosity >.

Definition at line 91 of file inc_navier_stokes_base.C.

Referenced by GRINS::IncompressibleNavierStokesStabilizationBase< Viscosity >::init_context().

92  {
93  // We should prerequest all the data
94  // we will need to build the linear system
95  // or evaluate a quantity of interest.
96  context.get_element_fe(_flow_vars.u_var())->get_JxW();
97  context.get_element_fe(_flow_vars.u_var())->get_phi();
98  context.get_element_fe(_flow_vars.u_var())->get_dphi();
99  context.get_element_fe(_flow_vars.u_var())->get_xyz();
100 
101  context.get_element_fe(_flow_vars.p_var())->get_phi();
102  context.get_element_fe(_flow_vars.p_var())->get_xyz();
103 
104  context.get_side_fe(_flow_vars.u_var())->get_JxW();
105  context.get_side_fe(_flow_vars.u_var())->get_phi();
106  context.get_side_fe(_flow_vars.u_var())->get_dphi();
107  context.get_side_fe(_flow_vars.u_var())->get_xyz();
108 
109  return;
110  }
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::IncompressibleNavierStokesBase< Mu >::init_variables ( libMesh::FEMSystem *  system)
virtualinherited

Initialization of Navier-Stokes variables.

Add velocity and pressure variables to system.

Implements GRINS::Physics.

Reimplemented in GRINS::AveragedTurbineBase< Viscosity >, and GRINS::IncompressibleNavierStokesStabilizationBase< Viscosity >.

Definition at line 63 of file inc_navier_stokes_base.C.

Referenced by GRINS::IncompressibleNavierStokesStabilizationBase< Viscosity >::init_variables(), and GRINS::AveragedTurbineBase< Viscosity >::init_variables().

64  {
65  this->_dim = system->get_mesh().mesh_dimension();
66 
67  this->_flow_vars.init(system);
68 
69  this->_mu.init(system);
70 
71  return;
72  }
virtual void init(libMesh::FEMSystem *system)
unsigned int _dim
Physical dimension of problem.
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
template<class Mu >
void GRINS::IncompressibleNavierStokes< Mu >::mass_residual ( bool  compute_jacobian,
AssemblyContext context,
CachedValues cache 
)
virtual

Mass matrix part(s) for element interiors. All boundary terms lie within the time_derivative part.

Reimplemented from GRINS::Physics.

Definition at line 482 of file inc_navier_stokes.C.

485  {
486  // Element Jacobian * quadrature weights for interior integration
487  // We assume the same for each flow variable
488  const std::vector<libMesh::Real> &JxW =
489  context.get_element_fe(this->_flow_vars.u_var())->get_JxW();
490 
491  // The shape functions at interior quadrature points.
492  // We assume the same for each flow variable
493  const std::vector<std::vector<libMesh::Real> >& u_phi =
494  context.get_element_fe(this->_flow_vars.u_var())->get_phi();
495 
496  const std::vector<libMesh::Point>& u_qpoint =
497  context.get_element_fe(this->_flow_vars.u_var())->get_xyz();
498 
499  // The number of local degrees of freedom in each variable
500  const unsigned int n_u_dofs = context.get_dof_indices(this->_flow_vars.u_var()).size();
501 
502  // The subvectors and submatrices we need to fill:
503  libMesh::DenseSubVector<libMesh::Real> &F_u = context.get_elem_residual(this->_flow_vars.u_var());
504  libMesh::DenseSubVector<libMesh::Real> &F_v = context.get_elem_residual(this->_flow_vars.v_var());
505  libMesh::DenseSubVector<libMesh::Real>* F_w = NULL;
506 
507  libMesh::DenseSubMatrix<libMesh::Real> &M_uu = context.get_elem_jacobian(this->_flow_vars.u_var(), this->_flow_vars.u_var());
508  libMesh::DenseSubMatrix<libMesh::Real> &M_vv = context.get_elem_jacobian(this->_flow_vars.v_var(), this->_flow_vars.v_var());
509  libMesh::DenseSubMatrix<libMesh::Real>* M_ww = NULL;
510 
511  if( this->_dim == 3 )
512  {
513  F_w = &context.get_elem_residual(this->_flow_vars.w_var()); // R_{w}
514  M_ww = &context.get_elem_jacobian(this->_flow_vars.w_var(), this->_flow_vars.w_var());
515  }
516 
517  unsigned int n_qpoints = context.get_element_qrule().n_points();
518 
519  for (unsigned int qp = 0; qp != n_qpoints; ++qp)
520  {
521  // For the mass residual, we need to be a little careful.
522  // The time integrator is handling the time-discretization
523  // for us so we need to supply M(u_fixed)*u' for the residual.
524  // u_fixed will be given by the fixed_interior_value function
525  // while u' will be given by the interior_rate function.
526  libMesh::Real u_dot, v_dot, w_dot = 0.0;
527  context.interior_rate(this->_flow_vars.u_var(), qp, u_dot);
528  context.interior_rate(this->_flow_vars.v_var(), qp, v_dot);
529 
530  if(this->_dim == 3 )
531  context.interior_rate(this->_flow_vars.w_var(), qp, w_dot);
532 
533  const libMesh::Number r = u_qpoint[qp](0);
534 
535  libMesh::Real jac = JxW[qp];
536 
537  if( this->_is_axisymmetric )
538  {
539  jac *= r;
540  }
541 
542  for (unsigned int i = 0; i != n_u_dofs; ++i)
543  {
544  F_u(i) -= this->_rho*u_dot*u_phi[i][qp]*jac;
545  F_v(i) -= this->_rho*v_dot*u_phi[i][qp]*jac;
546 
547  if( this->_dim == 3 )
548  (*F_w)(i) -= this->_rho*w_dot*u_phi[i][qp]*jac;
549 
550  if( compute_jacobian )
551  {
552  for (unsigned int j=0; j != n_u_dofs; j++)
553  {
554  // Assuming rho is constant w.r.t. u, v, w
555  // and T (if Boussinesq added).
556  libMesh::Real value = this->_rho*u_phi[i][qp]*u_phi[j][qp]*jac * context.get_elem_solution_rate_derivative();
557 
558  M_uu(i,j) -= value;
559  M_vv(i,j) -= value;
560 
561  if( this->_dim == 3)
562  {
563  (*M_ww)(i,j) -= value;
564  }
565 
566  } // End dof loop
567  } // End Jacobian check
568  } // End dof loop
569  } // End quadrature loop
570 
571  return;
572  }
libMesh::Number _rho
Material parameters, read from input.
unsigned int _dim
Physical dimension of problem.
bool _is_axisymmetric
Definition: physics.h:268
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::IncompressibleNavierStokes< Mu >::read_input_options ( const GetPot &  input)
virtual

Read options from GetPot input file.

Reimplemented from GRINS::Physics.

Definition at line 72 of file inc_navier_stokes.C.

References GRINS::incompressible_navier_stokes.

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

73  {
74  // Other quantities read in base class
75 
76  // Read pressure pinning information
77  this->_pin_pressure = input("Physics/"+incompressible_navier_stokes+"/pin_pressure", false );
78 
79  return;
80  }
const PhysicsName incompressible_navier_stokes
bool _pin_pressure
Enable pressure pinning.
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.
template<class Mu >
void GRINS::IncompressibleNavierStokes< Mu >::register_postprocessing_vars ( const GetPot &  input,
PostProcessedQuantities< libMesh::Real > &  postprocessing 
)
virtual

Register postprocessing variables for IncompressibleNavierStokes.

Reimplemented from GRINS::Physics.

Definition at line 83 of file inc_navier_stokes.C.

References GRINS::incompressible_navier_stokes, and GRINS::PostProcessedQuantities< NumericType >::register_quantity().

85  {
86  std::string section = "Physics/"+incompressible_navier_stokes+"/output_vars";
87 
88  if( input.have_variable(section) )
89  {
90  unsigned int n_vars = input.vector_variable_size(section);
91 
92  for( unsigned int v = 0; v < n_vars; v++ )
93  {
94  std::string name = input(section,"DIE!",v);
95 
96  if( name == std::string("mu") )
97  {
98  this->_mu_index = postprocessing.register_quantity( name );
99  }
100  else
101  {
102  std::cerr << "Error: Invalid output_vars value for "+incompressible_navier_stokes << std::endl
103  << " Found " << name << std::endl
104  << " Acceptable values are: mu" << std::endl;
105  libmesh_error();
106  }
107  }
108  }
109 
110  return;
111  }
const PhysicsName incompressible_navier_stokes
unsigned int _mu_index
Index from registering this quantity.
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::IncompressibleNavierStokesBase< Mu >::set_time_evolving_vars ( libMesh::FEMSystem *  system)
virtualinherited

Sets velocity variables to be time-evolving.

Reimplemented from GRINS::Physics.

Reimplemented in GRINS::AveragedTurbineBase< Viscosity >, and GRINS::ParsedVelocitySourceBase< Viscosity >.

Definition at line 75 of file inc_navier_stokes_base.C.

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

76  {
77  const unsigned int dim = system->get_mesh().mesh_dimension();
78 
79  // Tell the system to march velocity forward in time, but
80  // leave p as a constraint only
81  system->time_evolving(_flow_vars.u_var());
82  system->time_evolving(_flow_vars.v_var());
83 
84  if (dim == 3)
85  system->time_evolving(_flow_vars.w_var());
86 
87  return;
88  }
template<class Mu >
void GRINS::IncompressibleNavierStokes< Mu >::side_constraint ( bool  compute_jacobian,
AssemblyContext context,
CachedValues cache 
)
virtual

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

Reimplemented from GRINS::Physics.

Definition at line 468 of file inc_navier_stokes.C.

471  {
472  // Pin p = p_value at p_point
473  if( _pin_pressure )
474  {
475  _p_pinning.pin_value( context, compute_jacobian, this->_flow_vars.p_var() );
476  }
477 
478  return;
479  }
bool _pin_pressure
Enable pressure pinning.
void pin_value(libMesh::DiffContext &context, const bool request_jacobian, const GRINS::VariableIndex var, const double penalty=1.0)
The idea here is to pin a variable to a particular value if there is a null space - e...
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 >
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::IncompressibleNavierStokesBase< Viscosity >::_mu
protectedinherited

Viscosity object.

Definition at line 88 of file inc_navier_stokes_base.h.

template<class Viscosity >
unsigned int GRINS::IncompressibleNavierStokes< Viscosity >::_mu_index
protected

Index from registering this quantity.

Definition at line 95 of file inc_navier_stokes.h.

template<class Viscosity >
PressurePinning GRINS::IncompressibleNavierStokes< Viscosity >::_p_pinning
protected

Definition at line 89 of file inc_navier_stokes.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 >
bool GRINS::IncompressibleNavierStokes< Viscosity >::_pin_pressure
protected

Enable pressure pinning.

Definition at line 92 of file inc_navier_stokes.h.

template<class Viscosity >
libMesh::Number GRINS::IncompressibleNavierStokesBase< Viscosity >::_rho
protectedinherited

Material parameters, read from input.

Todo:
Create objects to allow for function specification

Definition at line 85 of file inc_navier_stokes_base.h.

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


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

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