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

#include <spalart_allmaras_viscosity.h>

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

Public Member Functions

 SpalartAllmarasViscosity (const GetPot &input, const std::string &material)
 Constructor with specified material. More...
 
 SpalartAllmarasViscosity (const GetPot &input)
 Deprecated constructor. More...
 
 ~SpalartAllmarasViscosity ()
 
libMesh::Real operator() (AssemblyContext &context, unsigned int qp) const
 
libMesh::Real operator() (const libMesh::Point &p, const libMesh::Real time=0)
 
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::ParameterUser
 ParameterUser (const std::string &user_name)
 
virtual ~ParameterUser ()
 
virtual void set_parameter (libMesh::Number &param_variable, const GetPot &input, const std::string &param_name, libMesh::Number param_default)
 Each subclass can simultaneously read a parameter value from. More...
 
virtual void set_parameter (libMesh::ParsedFunction< libMesh::Number, libMesh::Gradient > &func, const GetPot &input, const std::string &func_param_name, const std::string &param_default)
 Each subclass can simultaneously read a parsed function from. More...
 
virtual void set_parameter (libMesh::ParsedFEMFunction< libMesh::Number > &func, const GetPot &input, const std::string &func_param_name, const std::string &param_default)
 Each subclass can simultaneously read a parsed function from. More...
 
virtual void move_parameter (const libMesh::Number &old_parameter, libMesh::Number &new_parameter)
 When cloning an object, we need to update parameter pointers. More...
 
virtual void move_parameter (const libMesh::ParsedFunction< libMesh::Number, libMesh::Gradient > &old_func, libMesh::ParsedFunction< libMesh::Number, libMesh::Gradient > &new_func)
 When cloning an object, we need to update parameter pointers. More...
 
virtual void move_parameter (const libMesh::ParsedFEMFunction< libMesh::Number > &old_func, libMesh::ParsedFEMFunction< libMesh::Number > &new_func)
 When cloning an object, we need to update parameter pointers. More...
 

Protected Attributes

Viscosity _mu
 Viscosity object (so we have access to the physical viscosity) More...
 
TurbulenceFEVariables_turbulence_vars
 
SpalartAllmarasParameters _sa_params
 

Private Member Functions

 SpalartAllmarasViscosity ()
 

Additional Inherited Members

- 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...
 

Detailed Description

template<class Viscosity>
class GRINS::SpalartAllmarasViscosity< Viscosity >

Definition at line 51 of file spalart_allmaras_viscosity.h.

Constructor & Destructor Documentation

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

Constructor with specified material.

Definition at line 59 of file spalart_allmaras_viscosity.C.

59  :
60  ParameterUser("SpalartAllmarasViscosity"),
61  _mu(input,material),
62  _turbulence_vars(GRINSPrivate::VariableWarehouse::get_variable_subclass<TurbulenceFEVariables>(VariablesParsing::turb_variable_name(input,PhysicsNaming::spalart_allmaras(),VariablesParsing::PHYSICS))),
63  _sa_params(input)
64  {}
static PhysicsName spalart_allmaras()
ParameterUser(const std::string &user_name)
static std::string turb_variable_name(const GetPot &input, const std::string &subsection_name, const SECTION_TYPE section_type)
Viscosity _mu
Viscosity object (so we have access to the physical viscosity)
template<class Mu >
GRINS::SpalartAllmarasViscosity< Mu >::SpalartAllmarasViscosity ( const GetPot &  input)

Deprecated constructor.

Definition at line 36 of file spalart_allmaras_viscosity.C.

References grins_warning.

37  : ParameterUser("SpalartAllmarasViscosity"),
38  _mu(input),
39  _turbulence_vars(GRINSPrivate::VariableWarehouse::get_variable_subclass<TurbulenceFEVariables>(VariablesParsing::turb_variable_name(input,PhysicsNaming::spalart_allmaras(),VariablesParsing::PHYSICS))),
40  _sa_params(input)
41  {
42  // Warning about this constructor being deprecated
43  {
44  std::string warning = "WARNING: Use of this constructor is DEPRECATED.\n";
45  warning += " Please update to use constructor with input material name.\n";
46  grins_warning(warning);
47  }
48 
49  if( !input.have_variable("Materials/Viscosity/mu") )
50  {
51  std::cerr<<"No viscosity has been specified."<<std::endl;
52 
53  libmesh_error();
54  }
55  return;
56  }
static PhysicsName spalart_allmaras()
#define grins_warning(message)
Definition: common.h:34
ParameterUser(const std::string &user_name)
static std::string turb_variable_name(const GetPot &input, const std::string &subsection_name, const SECTION_TYPE section_type)
Viscosity _mu
Viscosity object (so we have access to the physical viscosity)
template<class Viscosity >
GRINS::SpalartAllmarasViscosity< Viscosity >::~SpalartAllmarasViscosity ( )
inline

Definition at line 60 of file spalart_allmaras_viscosity.h.

60 {};
template<class Viscosity >
GRINS::SpalartAllmarasViscosity< Viscosity >::SpalartAllmarasViscosity ( )
private

Member Function Documentation

template<class Mu >
libMesh::Real GRINS::SpalartAllmarasViscosity< Mu >::operator() ( AssemblyContext context,
unsigned int  qp 
) const

Definition at line 78 of file spalart_allmaras_viscosity.C.

79  {
80  // The physical viscosity
81  libMesh::Real mu_physical = this->_mu(context, qp);
82 
83  // The unscaled turbulent viscosity (the nu the SA physics solves for)
84  libMesh::Real nu = context.interior_value(this->_turbulence_vars.nu(),qp);
85 
86  // Assert that mu_value is greater than 0
87  if(nu < 0.0)
88  {
89  libmesh_warning("Negative turbulent viscosity encountered !");
90 
91  // We are using a negative S-A model, so will set eddy viscosity to zero
92  // if the turbulent viscosity nu < 0.0
93  nu = 0.0;
94  }
95 
96  // Step 1
97  libMesh::Real chi = nu/mu_physical;
98 
99  // Step 2
100  libMesh::Real fv1 = _sa_params.fv1(chi);
101 
102  // Step 3
103  libMesh::Real mu_turbulent = nu*fv1;
104 
105  // Compute the value of the total viscosity and return it
106  libMesh::Number mu_value = mu_turbulent + mu_physical; // Turbulent viscosity + physical viscosity
107 
108  return mu_value;
109  }
VariableIndex nu() const
Viscosity _mu
Viscosity object (so we have access to the physical viscosity)
libMesh::Real fv1(libMesh::Real chi) const
Helper function.
template<class Viscosity >
libMesh::Real GRINS::SpalartAllmarasViscosity< Viscosity >::operator() ( const libMesh::Point &  p,
const libMesh::Real  time = 0 
)
inline

Definition at line 64 of file spalart_allmaras_viscosity.h.

References GRINS::SpalartAllmarasViscosity< Viscosity >::_mu.

65  { return _mu(p,time); }
Viscosity _mu
Viscosity object (so we have access to the physical viscosity)
template<class Mu >
void GRINS::SpalartAllmarasViscosity< 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::ParameterUser.

Definition at line 68 of file spalart_allmaras_viscosity.C.

References GRINS::ParameterUser::register_parameter().

71  {
72  ParameterUser::register_parameter(param_name, param_pointer);
73  this->_mu.register_parameter(param_name, param_pointer);
74  this->_sa_params.register_parameter(param_name, param_pointer);
75  }
Viscosity _mu
Viscosity object (so we have access to the physical viscosity)
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.

Member Data Documentation

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

Viscosity object (so we have access to the physical viscosity)

Definition at line 77 of file spalart_allmaras_viscosity.h.

Referenced by GRINS::SpalartAllmarasViscosity< Viscosity >::operator()().

template<class Viscosity >
SpalartAllmarasParameters GRINS::SpalartAllmarasViscosity< Viscosity >::_sa_params
protected

Definition at line 82 of file spalart_allmaras_viscosity.h.

template<class Viscosity >
TurbulenceFEVariables& GRINS::SpalartAllmarasViscosity< Viscosity >::_turbulence_vars
protected

Definition at line 80 of file spalart_allmaras_viscosity.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