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

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

#include <spalart_allmaras.h>

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

Public Member Functions

 SpalartAllmaras (const std::string &physics_name, const GetPot &input)
 
 ~SpalartAllmaras ()
 
virtual void init_variables (libMesh::FEMSystem *system)
 Initialize variables for this physics. 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 element_time_derivative (bool compute_jacobian, AssemblyContext &context)
 Time dependent part(s) of physics for element interiors. More...
 
virtual void mass_residual (bool compute_jacobian, AssemblyContext &context)
 Mass matrix part(s) for element interiors. All boundary terms lie within the time_derivative part. More...
 
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...
 
- Public Member Functions inherited from GRINS::TurbulenceModelsBase< Viscosity >
 TurbulenceModelsBase (const std::string &physics_name, const GetPot &input)
 
 ~TurbulenceModelsBase ()
 
- Public Member Functions inherited from GRINS::Physics
 Physics (const GRINS::PhysicsName &physics_name, const GetPot &input)
 
virtual ~Physics ()
 
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 element_constraint (bool, AssemblyContext &)
 Constraint part(s) of physics for element interiors. 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 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...
 

Public Attributes

libMesh::UniquePtr< DistanceFunctiondistance_function
 
libMesh::UniquePtr< libMesh::SerialMesh > boundary_mesh
 

Protected Attributes

VelocityVariable_flow_vars
 
PressureFEVariable_press_var
 
TurbulenceFEVariables_turbulence_vars
 
SpalartAllmarasHelper _spalart_allmaras_helper
 
SpalartAllmarasParameters _sa_params
 Object handling the plethora of parameters. More...
 
std::set< libMesh::boundary_id_type > _wall_ids
 
unsigned int _no_of_walls
 
bool _infinite_distance
 
- Protected Attributes inherited from GRINS::TurbulenceModelsBase< Viscosity >
unsigned int _dim
 Physical dimension of problem. More...
 
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

 SpalartAllmaras ()
 

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::SpalartAllmaras< 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 57 of file spalart_allmaras.h.

Constructor & Destructor Documentation

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

Definition at line 48 of file spalart_allmaras.C.

References GRINS::SpalartAllmaras< Viscosity >::_flow_vars, GRINS::Physics::_ic_handler, GRINS::SpalartAllmaras< Viscosity >::_no_of_walls, GRINS::SpalartAllmaras< Viscosity >::_press_var, GRINS::SpalartAllmaras< Viscosity >::_turbulence_vars, GRINS::SpalartAllmaras< Viscosity >::_wall_ids, GRINS::Physics::check_var_subdomain_consistency(), GRINS::FEVariablesBase::set_is_constraint_var(), and GRINS::PhysicsNaming::spalart_allmaras().

49  : TurbulenceModelsBase<Mu>(physics_name, input), // Define class variables
50  _flow_vars(GRINSPrivate::VariableWarehouse::get_variable_subclass<VelocityVariable>(VariablesParsing::velocity_variable_name(input,physics_name,VariablesParsing::PHYSICS))),
51  _press_var(GRINSPrivate::VariableWarehouse::get_variable_subclass<PressureFEVariable>(VariablesParsing::press_variable_name(input,physics_name,VariablesParsing::PHYSICS))),
52  _turbulence_vars(GRINSPrivate::VariableWarehouse::get_variable_subclass<TurbulenceFEVariables>(VariablesParsing::turb_variable_name(input,physics_name,VariablesParsing::PHYSICS))),
54  _sa_params(input),
55  _no_of_walls(input("Physics/"+PhysicsNaming::spalart_allmaras()+"/no_of_walls", 0)),
56  _infinite_distance(input("Physics/"+PhysicsNaming::spalart_allmaras()+"/infinite_distance", false))
57  {
59 
60  // Loop over the _no_of_walls and fill the wall_ids set
61  for(unsigned int i = 0; i != _no_of_walls; i++)
62  _wall_ids.insert(input("Physics/"+PhysicsNaming::spalart_allmaras()+"/wall_ids", 0, i ));
63 
64  this->_ic_handler = new GenericICHandler( physics_name, input );
65 
69  }
GRINS::ICHandlingBase * _ic_handler
Definition: physics.h:258
TurbulenceFEVariables & _turbulence_vars
static PhysicsName spalart_allmaras()
void check_var_subdomain_consistency(const FEVariablesBase &var) const
Check that var is enabled on at least the subdomains this Physics is.
Definition: physics.C:174
static std::string velocity_variable_name(const GetPot &input, const std::string &subsection_name, const SECTION_TYPE section_type)
PressureFEVariable & _press_var
static std::string press_variable_name(const GetPot &input, const std::string &subsection_name, const SECTION_TYPE section_type)
SpalartAllmarasParameters _sa_params
Object handling the plethora of parameters.
static std::string turb_variable_name(const GetPot &input, const std::string &subsection_name, const SECTION_TYPE section_type)
SpalartAllmarasHelper _spalart_allmaras_helper
std::set< libMesh::boundary_id_type > _wall_ids
VelocityVariable & _flow_vars
void set_is_constraint_var(bool is_constraint_var)
Set whether or not this is a "constraint" variable.
template<class Viscosity >
GRINS::SpalartAllmaras< Viscosity >::~SpalartAllmaras ( )
inline

Definition at line 63 of file spalart_allmaras.h.

63 {};
template<class Viscosity >
GRINS::SpalartAllmaras< Viscosity >::SpalartAllmaras ( )
private

Member Function Documentation

template<class Mu >
void GRINS::SpalartAllmaras< Mu >::element_time_derivative ( bool  ,
AssemblyContext  
)
virtual

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

Reimplemented from GRINS::Physics.

Reimplemented in GRINS::SpalartAllmarasSPGSMStabilization< Viscosity >.

Definition at line 124 of file spalart_allmaras.C.

125  {
126  // Get a pointer to the current element, we need this for computing
127  // the distance to wall for the quadrature points
128  libMesh::Elem &elem_pointer = context.get_elem();
129 
130  // We get some references to cell-specific data that
131  // will be used to assemble the linear system.
132 
133  // Element Jacobian * quadrature weights for interior integration.
134  const std::vector<libMesh::Real> &JxW =
135  context.get_element_fe(this->_turbulence_vars.nu())->get_JxW();
136 
137  // The viscosity shape functions at interior quadrature points.
138  const std::vector<std::vector<libMesh::Real> >& nu_phi =
139  context.get_element_fe(this->_turbulence_vars.nu())->get_phi();
140 
141  // The viscosity shape function gradients (in global coords.)
142  // at interior quadrature points.
143  const std::vector<std::vector<libMesh::RealGradient> >& nu_gradphi =
144  context.get_element_fe(this->_turbulence_vars.nu())->get_dphi();
145 
146  // The number of local degrees of freedom in each variable.
147  const unsigned int n_nu_dofs = context.get_dof_indices(this->_turbulence_vars.nu()).size();
148 
149  // The subvectors and submatrices we need to fill:
150  //
151  // K_{\alpha \beta} = R_{\alpha},{\beta} = \partial{ R_{\alpha} } / \partial{ {\beta} } (where R denotes residual)
152  // e.g., for \alpha = v and \beta = u we get: K{vu} = R_{v},{u}
153  // Note that Kpu, Kpv, Kpw and Fp comes as constraint.
154 
155  //libMesh::DenseSubMatrix<libMesh::Number> &Knunu = context.get_elem_jacobian(this->_turbulence_vars.nu(), this->_turbulence_vars.nu()); // R_{nu},{nu}
156 
157  libMesh::DenseSubVector<libMesh::Number> &Fnu = context.get_elem_residual(this->_turbulence_vars.nu()); // R_{nu}
158 
159  // Now we will build the element Jacobian and residual.
160  // Constructing the residual requires the solution and its
161  // gradient from the previous timestep. This must be
162  // calculated at each quadrature point by summing the
163  // solution degree-of-freedom values by the appropriate
164  // weight functions.
165  unsigned int n_qpoints = context.get_element_qrule().n_points();
166 
167  // Auto pointer to distance fcn evaluated at quad points
168  libMesh::UniquePtr< libMesh::DenseVector<libMesh::Real> > distance_qp;
169 
170  // Fill the vector of distances to quadrature points
171  distance_qp = this->distance_function->interpolate(&elem_pointer, context.get_element_qrule().get_points());
172 
173  for (unsigned int qp=0; qp != n_qpoints; qp++)
174  {
175  // Compute the solution & its gradient at the old Newton iterate.
176  libMesh::Number nu;
177  nu = context.interior_value(this->_turbulence_vars.nu(), qp);
178 
179  libMesh::Gradient grad_nu;
180  grad_nu = context.interior_gradient(this->_turbulence_vars.nu(), qp);
181 
182  libMesh::Real jac = JxW[qp];
183 
184  // The physical viscosity
185  libMesh::Real mu_qp = this->_mu(context, qp);
186 
187  // The vorticity value
188  libMesh::Real vorticity_value_qp = this->_spalart_allmaras_helper.vorticity(context, qp);
189 
190  // The flow velocity
191  libMesh::Number u,v;
192  u = context.interior_value(this->_flow_vars.u(), qp);
193  v = context.interior_value(this->_flow_vars.v(), qp);
194 
195  libMesh::NumberVectorValue U(u,v);
196  if (this->_flow_vars.dim() == 3)
197  U(2) = context.interior_value(this->_flow_vars.w(), qp);
198 
199  //The source term
200  libMesh::Real S_tilde = this->_sa_params.source_fn(nu, mu_qp, (*distance_qp)(qp), vorticity_value_qp, _infinite_distance);
201 
202  // The ft2 function needed for the negative S-A model
203  libMesh::Real chi = nu/mu_qp;
204  libMesh::Real f_t2 = this->_sa_params.get_c_t3()*exp(-this->_sa_params.get_c_t4()*chi*chi);
205 
206  libMesh::Real source_term = this->_sa_params.get_cb1()*(1 - f_t2)*S_tilde*nu;
207  // For a negative turbulent viscosity nu < 0.0 we need to use a different production function
208  if(nu < 0.0)
209  {
210  source_term = this->_sa_params.get_cb1()*(1 - this->_sa_params.get_c_t3())*vorticity_value_qp*nu;
211  }
212 
213  // The wall destruction term
214  libMesh::Real fw = this->_sa_params.destruction_fn(nu, (*distance_qp)(qp), S_tilde, _infinite_distance);
215 
216  libMesh::Real nud = 0.0;
218  {
219  nud = 0.0;
220  }
221  else
222  {
223  nud = nu/(*distance_qp)(qp);
224  }
225  libMesh::Real nud2 = nud*nud;
226  libMesh::Real kappa2 = (this->_sa_params.get_kappa())*(this->_sa_params.get_kappa());
227  libMesh::Real cw1 = this->_sa_params.get_cb1()/kappa2 + (1.0 + this->_sa_params.get_cb2())/this->_sa_params.get_sigma();
228  libMesh::Real destruction_term = (cw1*fw - (this->_sa_params.get_cb1()/kappa2)*f_t2)*nud2;
229 
230  // For a negative turbulent viscosity nu < 0.0 we need to use a different production function
231  if(nu < 0.0)
232  {
233  destruction_term = -cw1*nud2;
234  }
235 
236  libMesh::Real fn1 = 1.0;
237  // For a negative turbulent viscosity, fn1 needs to be calculated
238  if(nu < 0.0)
239  {
240  libMesh::Real chi3 = chi*chi*chi;
241  fn1 = (this->_sa_params.get_c_n1() + chi3)/(this->_sa_params.get_c_n1() - chi3);
242  }
243 
244  // First, an i-loop over the viscosity degrees of freedom.
245  for (unsigned int i=0; i != n_nu_dofs; i++)
246  {
247  Fnu(i) += jac *
248  ( -this->_rho*(U*grad_nu)*nu_phi[i][qp] // convection term (assumes incompressibility)
249  +source_term*nu_phi[i][qp] // source term
250  + (1./this->_sa_params.get_sigma())*(-(mu_qp+(fn1*nu))*grad_nu*nu_gradphi[i][qp] + this->_sa_params.get_cb2()*grad_nu*grad_nu*nu_phi[i][qp]) // diffusion term
251  - destruction_term*nu_phi[i][qp]); // destruction term
252 
253  // Compute the jacobian if not using numerical jacobians
254  if (compute_jacobian)
255  {
256  libmesh_not_implemented();
257  } // end - if (compute_jacobian)
258 
259  } // end of the outer dof (i) loop
260  } // end of the quadrature point (qp) loop
261  }
TurbulenceFEVariables & _turbulence_vars
libMesh::UniquePtr< DistanceFunction > distance_function
libMesh::Real source_fn(libMesh::Number nu, libMesh::Real mu, libMesh::Real wall_distance, libMesh::Real vorticity_value, bool infinite_distance) const
VariableIndex nu() const
SpalartAllmarasParameters _sa_params
Object handling the plethora of parameters.
Viscosity _mu
Viscosity object.
SpalartAllmarasHelper _spalart_allmaras_helper
libMesh::Real vorticity(AssemblyContext &context, unsigned int qp) const
VelocityVariable & _flow_vars
libMesh::Real destruction_fn(libMesh::Number nu, libMesh::Real wall_distance, libMesh::Real S_tilde, bool infinite_distance) const
unsigned int dim() const
Number of components.
libMesh::Number _rho
Material parameters, read from input.
template<class Mu >
void GRINS::SpalartAllmaras< Mu >::init_context ( AssemblyContext context)
virtual

Initialize context for added physics variables.

Reimplemented from GRINS::Physics.

Reimplemented in GRINS::SpalartAllmarasStabilizationBase< Viscosity >.

Definition at line 93 of file spalart_allmaras.C.

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

94  {
95  // We should prerequest all the data
96  // we will need to build the linear system
97  // or evaluate a quantity of interest.
98  context.get_element_fe(_turbulence_vars.nu())->get_JxW();
99  context.get_element_fe(_turbulence_vars.nu())->get_phi();
100  context.get_element_fe(_turbulence_vars.nu())->get_dphi();
101  context.get_element_fe(_turbulence_vars.nu())->get_xyz();
102 
103  context.get_element_fe(_turbulence_vars.nu())->get_phi();
104  context.get_element_fe(_turbulence_vars.nu())->get_xyz();
105 
106  context.get_side_fe(_turbulence_vars.nu())->get_JxW();
107  context.get_side_fe(_turbulence_vars.nu())->get_phi();
108  context.get_side_fe(_turbulence_vars.nu())->get_dphi();
109  context.get_side_fe(_turbulence_vars.nu())->get_xyz();
110 
111  return;
112  }
TurbulenceFEVariables & _turbulence_vars
VariableIndex nu() const
template<class Mu >
void GRINS::SpalartAllmaras< Mu >::init_variables ( libMesh::FEMSystem *  )
virtual

Initialize variables for this physics.

Reimplemented from GRINS::Physics.

Reimplemented in GRINS::SpalartAllmarasSPGSMStabilization< Viscosity >.

Definition at line 72 of file spalart_allmaras.C.

References GRINS::Physics::init_variables().

Referenced by GRINS::SpalartAllmarasSPGSMStabilization< Viscosity >::init_variables().

73  {
74  // Init base class.
76 
77  // Initialize Boundary Mesh
78  this->boundary_mesh.reset(new libMesh::SerialMesh(system->get_mesh().comm() , system->get_mesh().mesh_dimension()) );
79 
80  // Use the _wall_ids set to build the boundary mesh object
81  (system->get_mesh()).boundary_info->sync(_wall_ids, *boundary_mesh);
82 
83  //this->distance_function.reset(new DistanceFunction(system->get_equation_systems(), dynamic_cast<libMesh::UnstructuredMesh&>(system->get_mesh()) ));
84  this->distance_function.reset(new DistanceFunction(system->get_equation_systems(), *boundary_mesh));
85 
86  // For now, we are hacking this. Without this initialize function being called
87  // the distance variable will just be zero. For the channel flow, we are just
88  // going to analytically compute the wall distance
89  //this->distance_function->initialize();
90  }
libMesh::UniquePtr< DistanceFunction > distance_function
std::set< libMesh::boundary_id_type > _wall_ids
virtual void init_variables(libMesh::FEMSystem *)
Initialize variables for this physics.
Definition: physics.h:115
libMesh::UniquePtr< libMesh::SerialMesh > boundary_mesh
template<class K >
void GRINS::SpalartAllmaras< K >::mass_residual ( bool  ,
AssemblyContext  
)
virtual

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

Reimplemented from GRINS::Physics.

Reimplemented in GRINS::SpalartAllmarasSPGSMStabilization< Viscosity >.

Definition at line 265 of file spalart_allmaras.C.

266  {
267  // First we get some references to cell-specific data that
268  // will be used to assemble the linear system.
269 
270  // Element Jacobian * quadrature weights for interior integration.
271  const std::vector<libMesh::Real> &JxW =
272  context.get_element_fe(this->_turbulence_vars.nu())->get_JxW();
273 
274  // The viscosity shape functions at interior quadrature points.
275  const std::vector<std::vector<libMesh::Real> >& nu_phi =
276  context.get_element_fe(this->_turbulence_vars.nu())->get_phi();
277 
278  // The number of local degrees of freedom in each variable.
279  const unsigned int n_nu_dofs = context.get_dof_indices(this->_turbulence_vars.nu()).size();
280 
281  // The subvectors and submatrices we need to fill:
282  libMesh::DenseSubVector<libMesh::Real> &F = context.get_elem_residual(this->_turbulence_vars.nu());
283 
284  //libMesh::DenseSubMatrix<libMesh::Real> &M = context.get_elem_jacobian(this->_turbulence_vars.nu(), this->_turbulence_vars.nu());
285 
286  unsigned int n_qpoints = context.get_element_qrule().n_points();
287 
288  for (unsigned int qp = 0; qp != n_qpoints; ++qp)
289  {
290  // For the mass residual, we need to be a little careful.
291  // The time integrator is handling the time-discretization
292  // for us so we need to supply M(u_fixed)*u' for the residual.
293  // u_fixed will be given by the fixed_interior_value function
294  // while u' will be given by the interior_rate function.
295  libMesh::Real nu_dot;
296  context.interior_rate(this->_turbulence_vars.nu(), qp, nu_dot);
297 
298  for (unsigned int i = 0; i != n_nu_dofs; ++i)
299  {
300  F(i) += -JxW[qp]*this->_rho*nu_dot*nu_phi[i][qp];
301 
302  if( compute_jacobian )
303  {
304  libmesh_not_implemented();
305  }// End of check on Jacobian
306 
307  } // End of element dof loop
308 
309  } // End of the quadrature point loop
310  }
TurbulenceFEVariables & _turbulence_vars
VariableIndex nu() const
libMesh::Number _rho
Material parameters, read from input.
template<class Mu >
void GRINS::SpalartAllmaras< Mu >::register_parameter ( const std::string &  param_name,
libMesh::ParameterMultiAccessor< libMesh::Number > &  param_pointer 
) const
virtual

Each subclass will register its copy of an independent.

Reimplemented from GRINS::TurbulenceModelsBase< Viscosity >.

Reimplemented in GRINS::SpalartAllmarasSPGSMStabilization< Viscosity >, and GRINS::SpalartAllmarasStabilizationBase< Viscosity >.

Definition at line 314 of file spalart_allmaras.C.

References GRINS::ParameterUser::register_parameter().

Referenced by GRINS::SpalartAllmarasStabilizationBase< Viscosity >::register_parameter().

317  {
318  ParameterUser::register_parameter(param_name, param_pointer);
319  this->_mu.register_parameter(param_name, param_pointer);
320  this->_sa_params.register_parameter(param_name, param_pointer);
321  }
SpalartAllmarasParameters _sa_params
Object handling the plethora of parameters.
Viscosity _mu
Viscosity object.
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.
template<class Mu >
void GRINS::SpalartAllmaras< Mu >::set_time_evolving_vars ( libMesh::FEMSystem *  system)
virtual

Sets velocity variables to be time-evolving.

Reimplemented from GRINS::Physics.

Definition at line 115 of file spalart_allmaras.C.

116  {
117  // Tell the system to march velocity forward in time, but
118  // leave p as a constraint only
119  system->time_evolving(this->_turbulence_vars.nu(), 1);
120  }
TurbulenceFEVariables & _turbulence_vars
VariableIndex nu() const

Member Data Documentation

template<class Viscosity >
VelocityVariable& GRINS::SpalartAllmaras< Viscosity >::_flow_vars
protected
template<class Viscosity >
bool GRINS::SpalartAllmaras< Viscosity >::_infinite_distance
protected

Definition at line 115 of file spalart_allmaras.h.

template<class Viscosity >
unsigned int GRINS::SpalartAllmaras< Viscosity >::_no_of_walls
protected
template<class Viscosity >
PressureFEVariable& GRINS::SpalartAllmaras< Viscosity >::_press_var
protected
template<class Viscosity >
SpalartAllmarasParameters GRINS::SpalartAllmaras< Viscosity >::_sa_params
protected

Object handling the plethora of parameters.

Definition at line 106 of file spalart_allmaras.h.

template<class Viscosity >
SpalartAllmarasHelper GRINS::SpalartAllmaras< Viscosity >::_spalart_allmaras_helper
protected

Definition at line 103 of file spalart_allmaras.h.

template<class Viscosity >
TurbulenceFEVariables& GRINS::SpalartAllmaras< Viscosity >::_turbulence_vars
protected
template<class Viscosity >
std::set<libMesh::boundary_id_type> GRINS::SpalartAllmaras< Viscosity >::_wall_ids
protected
template<class Viscosity >
libMesh::UniquePtr<libMesh::SerialMesh> GRINS::SpalartAllmaras< Viscosity >::boundary_mesh

Definition at line 85 of file spalart_allmaras.h.

template<class Viscosity >
libMesh::UniquePtr<DistanceFunction> GRINS::SpalartAllmaras< Viscosity >::distance_function

Definition at line 82 of file spalart_allmaras.h.


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

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