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

Adds SUPG stabilization to the SpalartAllmaras 'physics'. More...

#include <spalart_allmaras_spgsm_stab.h>

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

Public Member Functions

 SpalartAllmarasSPGSMStabilization (const GRINS::PhysicsName &physics_name, const GetPot &input)
 
virtual ~SpalartAllmarasSPGSMStabilization ()
 
virtual void init_variables (libMesh::FEMSystem *system)
 Initialize variables for this physics. 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 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 init_context (AssemblyContext &context)
 Initialize context for added physics variables. More...
 
virtual void set_time_evolving_vars (libMesh::FEMSystem *system)
 Sets velocity variables to be time-evolving. More...
 
virtual void read_input_options (const GetPot &input)
 Read options from GetPot input file. By default, nothing is read. More...
 
virtual bool enabled_on_elem (const libMesh::Elem *elem)
 Find if current physics is active on supplied element. More...
 
void set_is_steady (bool is_steady)
 Sets whether this physics is to be solved with a steady solver or not. More...
 
bool is_steady () const
 Returns whether or not this physics is being solved with a steady solver. More...
 
virtual void auxiliary_init (MultiphysicsSystem &system)
 Any auxillary initialization a Physics class may need. More...
 
virtual void register_postprocessing_vars (const GetPot &input, PostProcessedQuantities< libMesh::Real > &postprocessing)
 Register name of postprocessed quantity with PostProcessedQuantities. More...
 
virtual void side_time_derivative (bool compute_jacobian, AssemblyContext &context, CachedValues &cache)
 Time dependent part(s) of physics for boundaries of elements on the domain boundary. More...
 
virtual void nonlocal_time_derivative (bool compute_jacobian, AssemblyContext &context, CachedValues &cache)
 Time dependent part(s) of physics for scalar variables. More...
 
virtual void 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 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)
 
virtual void compute_postprocessed_quantity (unsigned int quantity_index, const AssemblyContext &context, const libMesh::Point &point, libMesh::Real &value)
 
BCHandlingBaseget_bc_handler ()
 
ICHandlingBaseget_ic_handler ()
 
virtual void set_parameter (libMesh::Number &param_variable, const GetPot &input, const std::string &param_name, libMesh::Number param_default)
 Each subclass can simultaneously read a parameter value from. More...
 
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...
 

Public Attributes

libMesh::AutoPtr< DistanceFunctiondistance_function
 
libMesh::AutoPtr< libMesh::SerialMesh > boundary_mesh
 

Protected Attributes

SpalartAllmarasStabilizationHelper _stab_helper
 
PrimitiveFlowFEVariables _flow_vars
 
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
 
unsigned int _dim
 Physical dimension of problem. More...
 
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

 SpalartAllmarasSPGSMStabilization ()
 

Detailed Description

template<class Viscosity>
class GRINS::SpalartAllmarasSPGSMStabilization< Viscosity >

Adds SUPG stabilization to the SpalartAllmaras 'physics'.

Definition at line 35 of file spalart_allmaras_spgsm_stab.h.

Constructor & Destructor Documentation

template<class Mu >
GRINS::SpalartAllmarasSPGSMStabilization< Mu >::SpalartAllmarasSPGSMStabilization ( const GRINS::PhysicsName physics_name,
const GetPot &  input 
)

Definition at line 42 of file spalart_allmaras_spgsm_stab.C.

References GRINS::Physics::read_input_options().

44  : SpalartAllmarasStabilizationBase<Mu>(physics_name,input)
45  {
46  this->read_input_options(input);
47 
48  return;
49  }
virtual void read_input_options(const GetPot &input)
Read options from GetPot input file. By default, nothing is read.
Definition: physics.C:70

Definition at line 52 of file spalart_allmaras_spgsm_stab.C.

53  {
54  return;
55  }
template<class Viscosity >
GRINS::SpalartAllmarasSPGSMStabilization< Viscosity >::SpalartAllmarasSPGSMStabilization ( )
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  }
void GRINS::Physics::compute_postprocessed_quantity ( unsigned int  quantity_index,
const AssemblyContext context,
const libMesh::Point &  point,
libMesh::Real &  value 
)
virtualinherited
void GRINS::Physics::compute_side_constraint_cache ( const AssemblyContext context,
CachedValues cache 
)
virtualinherited

Definition at line 191 of file physics.C.

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

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

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

Definition at line 173 of file physics.C.

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

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

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

Reimplemented from GRINS::SpalartAllmaras< Viscosity >.

Definition at line 67 of file spalart_allmaras_spgsm_stab.C.

70  {
71 #ifdef GRINS_USE_GRVY_TIMERS
72  this->_timer->BeginTimer("SpalartAllmarasSPGSMStabilization::element_time_derivative");
73 #endif
74 
75  // Get a pointer to the current element, we need this for computing the distance to wall for the
76  // quadrature points
77  libMesh::Elem &elem_pointer = context.get_elem();
78 
79  // The number of local degrees of freedom in each variable.
80  const unsigned int n_nu_dofs = context.get_dof_indices(this->_turbulence_vars.nu_var()).size();
81 
82  // Element Jacobian * quadrature weights for interior integration.
83  const std::vector<libMesh::Real> &JxW =
84  context.get_element_fe(this->_turbulence_vars.nu_var())->get_JxW();
85 
86  // The viscosity shape function gradients (in global coords.)
87  // at interior quadrature points.
88  const std::vector<std::vector<libMesh::RealGradient> >& nu_gradphi =
89  context.get_element_fe(this->_turbulence_vars.nu_var())->get_dphi();
90 
91  // Quadrature point locations
92  //const std::vector<libMesh::Point>& nu_qpoint =
93  //context.get_element_fe(this->_turbulence_vars.nu_var())->get_xyz();
94 
95  //libMesh::DenseSubMatrix<libMesh::Number> &Knunu = context.get_elem_jacobian(this->_turbulence_vars.nu_var(), this->_turbulence_vars.nu_var()); // R_{nu},{nu}
96 
97  libMesh::DenseSubVector<libMesh::Number> &Fnu = context.get_elem_residual(this->_turbulence_vars.nu_var()); // R_{nu}
98 
99  libMesh::FEBase* fe = context.get_element_fe(this->_turbulence_vars.nu_var());
100 
101  unsigned int n_qpoints = context.get_element_qrule().n_points();
102 
103  // Auto pointer to distance fcn evaluated at quad points
104  libMesh::AutoPtr< libMesh::DenseVector<libMesh::Real> > distance_qp;
105 
106  // Fill the vector of distances to quadrature points
107  distance_qp = this->distance_function->interpolate(&elem_pointer, context.get_element_qrule().get_points());
108 
109  for (unsigned int qp=0; qp != n_qpoints; qp++)
110  {
111  libMesh::Gradient grad_nu;
112  grad_nu = context.interior_gradient(this->_turbulence_vars.nu_var(), qp);
113 
114  libMesh::Real jac = JxW[qp];
115 
116  // The physical viscosity
117  libMesh::Real _mu_qp = this->_mu(context, qp);
118 
119  // To be fixed
120  // For the channel flow we will just set the distance function analytically
121  //(*distance_qp)(qp) = std::min(fabs(y),fabs(1 - y));
122 
123  // The flow velocity
124  libMesh::Number u,v;
125  u = context.interior_value(this->_flow_vars.u_var(), qp);
126  v = context.interior_value(this->_flow_vars.v_var(), qp);
127 
128  libMesh::NumberVectorValue U(u,v);
129  if (this->_dim == 3)
130  U(2) = context.interior_value(this->_flow_vars.w_var(), qp);
131 
132  // Stabilization terms
133 
134  libMesh::RealGradient g = this->_stab_helper.compute_g( fe, context, qp );
135  libMesh::RealTensor G = this->_stab_helper.compute_G( fe, context, qp );
136 
137  libMesh::Real tau_spalart = this->_stab_helper.compute_tau_spalart( context, qp, g, G, this->_rho, U, _mu_qp, this->_is_steady );
138 
139  libMesh::Number RM_spalart = this->_stab_helper.compute_res_spalart_steady( context, qp, this->_rho, _mu_qp, (*distance_qp)(qp) );
140 
141  for (unsigned int i=0; i != n_nu_dofs; i++)
142  {
143  Fnu(i) += jac*( -tau_spalart*RM_spalart*this->_rho*(U*nu_gradphi[i][qp]) );
144  }
145 
146  if( compute_jacobian )
147  {
148  libmesh_not_implemented();
149  }
150 
151  }
152 
153 #ifdef GRINS_USE_GRVY_TIMERS
154  this->_timer->EndTimer("SpalartAllmarasSPGSMStabilization::element_time_derivative");
155 #endif
156 
157  return;
158  }
libMesh::RealTensor compute_G(libMesh::FEBase *fe, AssemblyContext &c, unsigned int qp) const
Definition: stab_helper.C:64
VariableIndex nu_var() const
unsigned int _dim
Physical dimension of problem.
libMesh::AutoPtr< DistanceFunction > distance_function
libMesh::Real compute_res_spalart_steady(AssemblyContext &context, unsigned int qp, const libMesh::Real rho, const libMesh::Real mu, const libMesh::Real distance_qp) const
libMesh::RealGradient compute_g(libMesh::FEBase *fe, AssemblyContext &c, unsigned int qp) const
Definition: stab_helper.C:47
Viscosity _mu
Viscosity object.
static bool _is_steady
Caches whether or not the solver that's being used is steady or not.
Definition: physics.h:266
TurbulenceFEVariables _turbulence_vars
libMesh::Real compute_tau_spalart(AssemblyContext &c, unsigned int qp, libMesh::RealGradient &g, libMesh::RealTensor &G, libMesh::Real rho, libMesh::Gradient U, libMesh::Real mu, bool is_steady) const
SpalartAllmarasStabilizationHelper _stab_helper
libMesh::Number _rho
Material parameters, read from input.
PrimitiveFlowFEVariables _flow_vars
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::SpalartAllmarasStabilizationBase< Mu >::init_context ( AssemblyContext context)
virtualinherited

Initialize context for added physics variables.

Reimplemented from GRINS::SpalartAllmaras< Viscosity >.

Definition at line 55 of file spalart_allmaras_stab_base.C.

References GRINS::SpalartAllmaras< Viscosity >::init_context().

56  {
57  // First call base class
59 
60  // We also need second derivatives, so initialize those.
61  context.get_element_fe(this->_turbulence_vars.nu_var())->get_d2phi();
62 
63  return;
64  }
virtual void init_context(AssemblyContext &context)
Initialize context for added physics variables.
VariableIndex nu_var() const
TurbulenceFEVariables _turbulence_vars
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::SpalartAllmarasSPGSMStabilization< Mu >::init_variables ( libMesh::FEMSystem *  system)
virtual

Initialize variables for this physics.

Reimplemented from GRINS::SpalartAllmarasStabilizationBase< Viscosity >.

Definition at line 58 of file spalart_allmaras_spgsm_stab.C.

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

59  {
60  // Init base class variables for stab_helper and distance function initialization
62 
63  return;
64  }
virtual void init_variables(libMesh::FEMSystem *system)
Initialize variables for this physics.
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::SpalartAllmarasSPGSMStabilization< 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::SpalartAllmaras< Viscosity >.

Definition at line 161 of file spalart_allmaras_spgsm_stab.C.

164  {
165 #ifdef GRINS_USE_GRVY_TIMERS
166  this->_timer->BeginTimer("SpalartAllmarasSPGSMStabilization::mass_residual");
167 #endif
168 
169  // Get a pointer to the current element, we need this for computing the distance to wall for the
170  // quadrature points
171  libMesh::Elem &elem_pointer = context.get_elem();
172 
173  // The number of local degrees of freedom in each variable.
174  const unsigned int n_nu_dofs = context.get_dof_indices(this->_turbulence_vars.nu_var()).size();
175 
176  // Element Jacobian * quadrature weights for interior integration.
177  const std::vector<libMesh::Real> &JxW =
178  context.get_element_fe(this->_turbulence_vars.nu_var())->get_JxW();
179 
180  // The pressure shape functions at interior quadrature points.
181  const std::vector<std::vector<libMesh::RealGradient> >& nu_gradphi =
182  context.get_element_fe(this->_turbulence_vars.nu_var())->get_dphi();
183 
184  libMesh::DenseSubVector<libMesh::Number> &Fnu = context.get_elem_residual(this->_turbulence_vars.nu_var()); // R_{nu}
185 
186  libMesh::FEBase* fe = context.get_element_fe(this->_turbulence_vars.nu_var());
187 
188  unsigned int n_qpoints = context.get_element_qrule().n_points();
189 
190  // Auto pointer to distance fcn evaluated at quad points
191  libMesh::AutoPtr< libMesh::DenseVector<libMesh::Real> > distance_qp;
192 
193  // Fill the vector of distances to quadrature points
194  distance_qp = this->distance_function->interpolate(&elem_pointer, context.get_element_qrule().get_points());
195 
196  for (unsigned int qp=0; qp != n_qpoints; qp++)
197  {
198  libMesh::RealGradient g = this->_stab_helper.compute_g( fe, context, qp );
199  libMesh::RealTensor G = this->_stab_helper.compute_G( fe, context, qp );
200 
201  libMesh::RealGradient U( context.fixed_interior_value( this->_flow_vars.u_var(), qp ),
202  context.fixed_interior_value( this->_flow_vars.v_var(), qp ) );
203  // Compute the viscosity at this qp
204  libMesh::Real _mu_qp = this->_mu(context, qp);
205 
206  if( this->_dim == 3 )
207  {
208  U(2) = context.fixed_interior_value( this->_flow_vars.w_var(), qp );
209  }
210 
211  libMesh::Real tau_spalart = this->_stab_helper.compute_tau_spalart( context, qp, g, G, this->_rho, U, _mu_qp, this->_is_steady );
212 
213  libMesh::Real RM_spalart = this->_stab_helper.compute_res_spalart_transient( context, qp, this->_rho );
214 
215  for (unsigned int i=0; i != n_nu_dofs; i++)
216  {
217  Fnu(i) += -JxW[qp]*tau_spalart*RM_spalart*this->_rho*(U*nu_gradphi[i][qp]);
218  }
219 
220  if( compute_jacobian )
221  {
222  libmesh_not_implemented();
223  }
224 
225  }
226 
227 #ifdef GRINS_USE_GRVY_TIMERS
228  this->_timer->EndTimer("SpalartAllmarasSPGSMStabilization::mass_residual");
229 #endif
230 
231  return;
232  }
libMesh::RealTensor compute_G(libMesh::FEBase *fe, AssemblyContext &c, unsigned int qp) const
Definition: stab_helper.C:64
VariableIndex nu_var() const
unsigned int _dim
Physical dimension of problem.
libMesh::AutoPtr< DistanceFunction > distance_function
libMesh::RealGradient compute_g(libMesh::FEBase *fe, AssemblyContext &c, unsigned int qp) const
Definition: stab_helper.C:47
Viscosity _mu
Viscosity object.
libMesh::Real compute_res_spalart_transient(AssemblyContext &context, unsigned int qp, const libMesh::Real rho) const
static bool _is_steady
Caches whether or not the solver that's being used is steady or not.
Definition: physics.h:266
TurbulenceFEVariables _turbulence_vars
libMesh::Real compute_tau_spalart(AssemblyContext &c, unsigned int qp, libMesh::RealGradient &g, libMesh::RealTensor &G, libMesh::Real rho, libMesh::Gradient U, libMesh::Real mu, bool is_steady) const
SpalartAllmarasStabilizationHelper _stab_helper
libMesh::Number _rho
Material parameters, read from input.
PrimitiveFlowFEVariables _flow_vars
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  }
void GRINS::Physics::read_input_options ( const GetPot &  input)
virtualinherited

Read options from GetPot input file. By default, nothing is read.

Reimplemented in GRINS::ScalarODE, GRINS::AveragedTurbineBase< Viscosity >, GRINS::AxisymmetricBoussinesqBuoyancy, GRINS::LowMachNavierStokesBase< Viscosity, SpecificHeat, ThermalConductivity >, GRINS::AxisymmetricHeatTransfer< Conductivity >, GRINS::AveragedFanBase< Viscosity >, GRINS::ParsedVelocitySourceBase< Viscosity >, GRINS::VelocityDragBase< Viscosity >, GRINS::VelocityPenaltyBase< Viscosity >, GRINS::IncompressibleNavierStokes< Viscosity >, GRINS::LowMachNavierStokes< Viscosity, SpecificHeat, ThermalConductivity >, GRINS::HeatTransfer< Conductivity >, GRINS::ReactingLowMachNavierStokesBase< Mixture, Evaluator >, and GRINS::ReactingLowMachNavierStokes< Mixture, Evaluator >.

Definition at line 70 of file physics.C.

References GRINS::Physics::_enabled_subdomains, and GRINS::Physics::_physics_name.

Referenced by GRINS::HeatTransferBase< Conductivity >::HeatTransferBase(), GRINS::HeatTransferStabilizationBase< Conductivity >::HeatTransferStabilizationBase(), GRINS::IncompressibleNavierStokesAdjointStabilization< Viscosity >::IncompressibleNavierStokesAdjointStabilization(), GRINS::IncompressibleNavierStokesSPGSMStabilization< Viscosity >::IncompressibleNavierStokesSPGSMStabilization(), GRINS::Physics::Physics(), and GRINS::SpalartAllmarasSPGSMStabilization< Viscosity >::SpalartAllmarasSPGSMStabilization().

71  {
72  int num_ids = input.vector_variable_size( "Physics/"+this->_physics_name+"/enabled_subdomains" );
73 
74  for( int i = 0; i < num_ids; i++ )
75  {
76  libMesh::subdomain_id_type dumvar = input( "Physics/"+this->_physics_name+"/enabled_subdomains", -1, i );
77  _enabled_subdomains.insert( dumvar );
78  }
79 
80  return;
81  }
const PhysicsName _physics_name
Name of the physics object. Used for reading physics specific inputs.
Definition: physics.h:254
std::set< libMesh::subdomain_id_type > _enabled_subdomains
Subdomains on which the current Physics class is enabled.
Definition: physics.h:261
void GRINS::ParameterUser::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 in GRINS::AxisymmetricHeatTransfer< Conductivity >, GRINS::LowMachNavierStokesBase< Viscosity, SpecificHeat, ThermalConductivity >, GRINS::IncompressibleNavierStokesBase< Viscosity >, GRINS::BoussinesqBuoyancySPGSMStabilization< Viscosity >, GRINS::HeatConduction< Conductivity >, GRINS::HeatTransferBase< Conductivity >, and GRINS::BoussinesqBuoyancyAdjointStabilization< Viscosity >.

Definition at line 50 of file parameter_user.C.

Referenced by GRINS::BoussinesqBuoyancyAdjointStabilization< Viscosity >::register_parameter(), GRINS::HeatTransferBase< Conductivity >::register_parameter(), GRINS::HeatConduction< Conductivity >::register_parameter(), GRINS::BoussinesqBuoyancySPGSMStabilization< Viscosity >::register_parameter(), GRINS::IncompressibleNavierStokesBase< Viscosity >::register_parameter(), GRINS::LowMachNavierStokesBase< Viscosity, SpecificHeat, ThermalConductivity >::register_parameter(), and GRINS::AxisymmetricHeatTransfer< Conductivity >::register_parameter().

53  {
54  std::map<std::string, libMesh::Number*>::const_iterator it =
55  _my_parameters.find(param_name);
56 
57  if (it != _my_parameters.end())
58  {
59  std::cout << _my_name << " uses parameter " << param_name
60  << std::endl;
61  param_pointer.push_back(it->second);
62  }
63  }
std::map< std::string, libMesh::Number * > _my_parameters
void GRINS::Physics::register_postprocessing_vars ( const GetPot &  input,
PostProcessedQuantities< libMesh::Real > &  postprocessing 
)
virtualinherited

Register name of postprocessed quantity with PostProcessedQuantities.

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

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

Definition at line 161 of file physics.C.

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

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

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

Definition at line 97 of file physics.C.

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

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

Each subclass can simultaneously read a parameter value from.

Definition at line 35 of file parameter_user.C.

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

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

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

Sets velocity variables to be time-evolving.

Reimplemented from GRINS::Physics.

Definition at line 134 of file spalart_allmaras.C.

135  {
136  // Tell the system to march velocity forward in time, but
137  // leave p as a constraint only
138  system->time_evolving(this->_turbulence_vars.nu_var());
139 
140  return;
141  }
VariableIndex nu_var() const
TurbulenceFEVariables _turbulence_vars
void GRINS::Physics::side_constraint ( bool  compute_jacobian,
AssemblyContext context,
CachedValues cache 
)
virtualinherited

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

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

Definition at line 243 of file physics.C.

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

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

Member Data Documentation

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

Physical dimension of problem.

Todo:
Do we really need to cache this?

Definition at line 62 of file turbulence_models_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::SpalartAllmaras< Viscosity >::_flow_vars
protectedinherited

Definition at line 90 of file spalart_allmaras.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::TurbulenceModelsBase< Viscosity >::_mu
protectedinherited

Viscosity object.

Definition at line 69 of file turbulence_models_base.h.

template<class Viscosity >
unsigned int GRINS::SpalartAllmaras< Viscosity >::_no_of_walls
protectedinherited
const PhysicsName GRINS::Physics::_physics_name
protectedinherited

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

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

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

Definition at line 254 of file physics.h.

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

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

Material parameters, read from input.

Todo:
Create objects to allow for function specification

Definition at line 66 of file turbulence_models_base.h.

template<class Viscosity >
SpalartAllmarasParameters GRINS::SpalartAllmaras< Viscosity >::_sa_params
protectedinherited

Object handling the plethora of parameters.

Definition at line 99 of file spalart_allmaras.h.

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

Definition at line 96 of file spalart_allmaras.h.

template<class Viscosity >
SpalartAllmarasStabilizationHelper GRINS::SpalartAllmarasStabilizationBase< Viscosity >::_stab_helper
protectedinherited

Definition at line 52 of file spalart_allmaras_stab_base.h.

template<class Viscosity >
TurbulenceFEVariables GRINS::SpalartAllmaras< Viscosity >::_turbulence_vars
protectedinherited

Definition at line 93 of file spalart_allmaras.h.

template<class Viscosity >
std::set<libMesh::boundary_id_type> GRINS::SpalartAllmaras< Viscosity >::_wall_ids
protectedinherited
template<class Viscosity >
libMesh::AutoPtr<libMesh::SerialMesh> GRINS::SpalartAllmaras< Viscosity >::boundary_mesh
inherited

Definition at line 85 of file spalart_allmaras.h.

template<class Viscosity >
libMesh::AutoPtr<DistanceFunction> GRINS::SpalartAllmaras< Viscosity >::distance_function
inherited

Definition at line 82 of file spalart_allmaras.h.


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

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