GRINS-0.8.0
List of all members | Public Member Functions | Protected Attributes | Private Member Functions
GRINS::SpalartAllmarasParameters Class Reference

Encapsulate Spalart-Allmaras model parameters. More...

#include <spalart_allmaras_parameters.h>

Inheritance diagram for GRINS::SpalartAllmarasParameters:
Inheritance graph
[legend]
Collaboration diagram for GRINS::SpalartAllmarasParameters:
Collaboration graph
[legend]

Public Member Functions

 SpalartAllmarasParameters (const GetPot &input)
 
 ~SpalartAllmarasParameters ()
 
libMesh::Real source_fn (libMesh::Number nu, libMesh::Real mu, libMesh::Real wall_distance, libMesh::Real vorticity_value, bool infinite_distance) const
 
libMesh::Real destruction_fn (libMesh::Number nu, libMesh::Real wall_distance, libMesh::Real S_tilde, bool infinite_distance) const
 
libMesh::Real fv1 (libMesh::Real chi) const
 Helper function. More...
 
libMesh::Real get_kappa () const
 
libMesh::Real get_cv1 () const
 
libMesh::Real get_cv2 () const
 
libMesh::Real get_cv3 () const
 
libMesh::Real get_cb1 () const
 
libMesh::Real get_cb2 () const
 
libMesh::Real get_sigma () const
 
libMesh::Real get_c_w2 () const
 
libMesh::Real get_c_w3 () const
 
libMesh::Real get_r_lin () const
 
libMesh::Real get_c_t3 () const
 
libMesh::Real get_c_t4 () const
 
libMesh::Real get_c_n1 () const
 
- 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...
 
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...
 

Protected Attributes

libMesh::Real _kappa
 Constants specific to the calculation of the source function. More...
 
libMesh::Real _cv1
 
libMesh::Real _cv2
 
libMesh::Real _cv3
 
libMesh::Real _cb1
 Spalart Allmaras model constants, the constant _cw1 are calculated, not cached. More...
 
libMesh::Real _sigma
 
libMesh::Real _cb2
 
libMesh::Real _r_lin
 Constants specific to the calculation of the destruction function. More...
 
libMesh::Real _c_w2
 
libMesh::Real _c_w3
 
libMesh::Real _c_t3
 Constants specific to the calculation of the trip function (but used in. More...
 
libMesh::Real _c_t4
 
libMesh::Real _c_n1
 Constants specific to the calculation of the negative S-A model. More...
 

Private Member Functions

 SpalartAllmarasParameters ()
 

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

Encapsulate Spalart-Allmaras model parameters.

This is mostly a container class, but there are a few helper functions here that are used in different places in SpalartAllmaras classes.

Definition at line 40 of file spalart_allmaras_parameters.h.

Constructor & Destructor Documentation

GRINS::SpalartAllmarasParameters::SpalartAllmarasParameters ( const GetPot &  input)

Definition at line 37 of file spalart_allmaras_parameters.C.

References _c_n1, _c_t3, _c_t4, _c_w2, _c_w3, _cb1, _cb2, _cv1, _cv2, _cv3, _kappa, _r_lin, _sigma, GRINS::ParameterUser::set_parameter(), and GRINS::PhysicsNaming::spalart_allmaras().

38  : ParameterUser("SpalartAllmarasParameters"),
39  _kappa(input("Physics/"+PhysicsNaming::spalart_allmaras()+"/Parameters/kappa",0.41)),
40  _cv1(input("Physics/"+PhysicsNaming::spalart_allmaras()+"/Parameters/cv1",7.1)),
41  _cv2(input("Physics/"+PhysicsNaming::spalart_allmaras()+"/Parameters/cv2",0.7)),
42  _cv3(input("Physics/"+PhysicsNaming::spalart_allmaras()+"/Parameters/cv3",0.9)),
43  _cb1(input("Physics/"+PhysicsNaming::spalart_allmaras()+"/Parameters/cb1",0.1355)),
44  _sigma(input("Physics/"+PhysicsNaming::spalart_allmaras()+"/Parameters/sigma",2./3.)),
45  _cb2(input("Physics/"+PhysicsNaming::spalart_allmaras()+"/Parameters/cb2",0.622)),
46  //_cw1( _cb1/(_kappa*_kappa) + (1.0+_cb2)/_sigma ),
47  _r_lin(input("Physics/"+PhysicsNaming::spalart_allmaras()+"/Parameters/r_lin",10.0)),
48  _c_w2(input("Physics/"+PhysicsNaming::spalart_allmaras()+"/Parameters/c_w2",0.3)),
49  _c_w3(input("Physics/"+PhysicsNaming::spalart_allmaras()+"/Parameters/c_w3",2.0)),
50  _c_t3(input("Physics/"+PhysicsNaming::spalart_allmaras()+"/Parameters/c_t3",1.2)),
51  _c_t4(input("Physics/"+PhysicsNaming::spalart_allmaras()+"/Parameters/c_t4",0.5)),
52  _c_n1(input("Physics/"+PhysicsNaming::spalart_allmaras()+"/Parameters/c_n1",16.0))
53  {
54  this->set_parameter(this->_kappa ,input, "Physics/"+PhysicsNaming::spalart_allmaras()+"/Parameters/kappa" , this->_kappa );
55  this->set_parameter(this->_cv1 ,input, "Physics/"+PhysicsNaming::spalart_allmaras()+"/Parameters/cv1", this->_cv1 );
56  this->set_parameter(this->_cv2 ,input, "Physics/"+PhysicsNaming::spalart_allmaras()+"/Parameters/cv2", this->_cv2 );
57  this->set_parameter(this->_cv3 ,input, "Physics/"+PhysicsNaming::spalart_allmaras()+"/Parameters/cv3", this->_cv3 );
58  this->set_parameter(this->_cb1 ,input, "Physics/"+PhysicsNaming::spalart_allmaras()+"/Parameters/cb1", this->_cb1 );
59  this->set_parameter(this->_sigma ,input, "Physics/"+PhysicsNaming::spalart_allmaras()+"/Parameters/sigma", this->_sigma );
60  this->set_parameter(this->_cb2 ,input, "Physics/"+PhysicsNaming::spalart_allmaras()+"/Parameters/cb2" , this->_cb2 );
61  this->set_parameter(this->_r_lin ,input, "Physics/"+PhysicsNaming::spalart_allmaras()+"/Parameters/r_lin", this->_r_lin );
62  this->set_parameter(this->_c_w2 ,input, "Physics/"+PhysicsNaming::spalart_allmaras()+"/Parameters/c_w2", this->_c_w2 );
63  this->set_parameter(this->_c_w3 ,input, "Physics/"+PhysicsNaming::spalart_allmaras()+"/Parameters/c_w3", this->_c_w3 );
64  this->set_parameter(this->_c_t3 ,input, "Physics/"+PhysicsNaming::spalart_allmaras()+"/Parameters/c_t3", this->_c_t3 );
65  this->set_parameter(this->_c_t4 ,input, "Physics/"+PhysicsNaming::spalart_allmaras()+"/Parameters/c_t4", this->_c_t4 );
66  this->set_parameter(this->_c_n1 ,input, "Physics/"+PhysicsNaming::spalart_allmaras()+"/Parameters/c_n1", this->_c_n1 );
67  }
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.
libMesh::Real _r_lin
Constants specific to the calculation of the destruction function.
libMesh::Real _kappa
Constants specific to the calculation of the source function.
static PhysicsName spalart_allmaras()
libMesh::Real _cb1
Spalart Allmaras model constants, the constant _cw1 are calculated, not cached.
ParameterUser(const std::string &user_name)
libMesh::Real _c_n1
Constants specific to the calculation of the negative S-A model.
libMesh::Real _c_t3
Constants specific to the calculation of the trip function (but used in.
GRINS::SpalartAllmarasParameters::~SpalartAllmarasParameters ( )
inline

Definition at line 46 of file spalart_allmaras_parameters.h.

46 {};
GRINS::SpalartAllmarasParameters::SpalartAllmarasParameters ( )
private

Member Function Documentation

libMesh::Real GRINS::SpalartAllmarasParameters::destruction_fn ( libMesh::Number  nu,
libMesh::Real  wall_distance,
libMesh::Real  S_tilde,
bool  infinite_distance 
) const

Definition at line 109 of file spalart_allmaras_parameters.C.

References _c_w2, _c_w3, _kappa, and _r_lin.

Referenced by GRINS::SpalartAllmarasStabilizationHelper::compute_res_spalart_steady().

111  {
112  // Step 1
113  libMesh::Real r = 0.0;
114  if(infinite_distance)
115  {
116  r = 0.0;
117  }
118  else
119  {
120  r = std::min(nu/(S_tilde*pow(this->_kappa,2.0)*pow(wall_distance,2.0)), this->_r_lin);
121  }
122 
123  // Step 2
124  libMesh::Real g = r + this->_c_w2*(pow(r,6.0) - r);
125 
126  // Step 3
127  libMesh::Real fw = g*pow(((1 + pow(this->_c_w3,6.0))/(pow(g,6.0) + pow(this->_c_w3,6.0))), 1.0/6.0);
128 
129  return fw;
130  }
libMesh::Real _r_lin
Constants specific to the calculation of the destruction function.
libMesh::Real _kappa
Constants specific to the calculation of the source function.
libMesh::Real GRINS::SpalartAllmarasParameters::fv1 ( libMesh::Real  chi) const
inline

Helper function.

This expression appears in a couple of places so we provide a function for it

Definition at line 124 of file spalart_allmaras_parameters.h.

References get_cv1().

Referenced by source_fn().

125  {
126  libMesh::Real chi3 = chi*chi*chi;
127  libMesh::Real cv1 = this->get_cv1();
128  libMesh::Real cv13 = cv1*cv1*cv1;
129 
130  return chi3/(chi3 + cv13);
131  }
libMesh::Real GRINS::SpalartAllmarasParameters::get_c_n1 ( ) const
inline

Definition at line 96 of file spalart_allmaras_parameters.h.

References _c_n1.

97  { return _c_n1;}
libMesh::Real _c_n1
Constants specific to the calculation of the negative S-A model.
libMesh::Real GRINS::SpalartAllmarasParameters::get_c_t3 ( ) const
inline

Definition at line 90 of file spalart_allmaras_parameters.h.

References _c_t3.

91  { return _c_t3;}
libMesh::Real _c_t3
Constants specific to the calculation of the trip function (but used in.
libMesh::Real GRINS::SpalartAllmarasParameters::get_c_t4 ( ) const
inline

Definition at line 93 of file spalart_allmaras_parameters.h.

References _c_t4.

libMesh::Real GRINS::SpalartAllmarasParameters::get_c_w2 ( ) const
inline

Definition at line 81 of file spalart_allmaras_parameters.h.

References _c_w2.

libMesh::Real GRINS::SpalartAllmarasParameters::get_c_w3 ( ) const
inline

Definition at line 84 of file spalart_allmaras_parameters.h.

References _c_w3.

libMesh::Real GRINS::SpalartAllmarasParameters::get_cb1 ( ) const
inline

Definition at line 72 of file spalart_allmaras_parameters.h.

References _cb1.

Referenced by GRINS::SpalartAllmarasStabilizationHelper::compute_res_spalart_steady().

73  { return _cb1;}
libMesh::Real _cb1
Spalart Allmaras model constants, the constant _cw1 are calculated, not cached.
libMesh::Real GRINS::SpalartAllmarasParameters::get_cb2 ( ) const
inline
libMesh::Real GRINS::SpalartAllmarasParameters::get_cv1 ( ) const
inline

Definition at line 63 of file spalart_allmaras_parameters.h.

References _cv1.

Referenced by fv1().

libMesh::Real GRINS::SpalartAllmarasParameters::get_cv2 ( ) const
inline

Definition at line 66 of file spalart_allmaras_parameters.h.

References _cv2.

libMesh::Real GRINS::SpalartAllmarasParameters::get_cv3 ( ) const
inline

Definition at line 69 of file spalart_allmaras_parameters.h.

References _cv3.

libMesh::Real GRINS::SpalartAllmarasParameters::get_kappa ( ) const
inline

Definition at line 60 of file spalart_allmaras_parameters.h.

References _kappa.

Referenced by GRINS::SpalartAllmarasStabilizationHelper::compute_res_spalart_steady().

61  { return _kappa;}
libMesh::Real _kappa
Constants specific to the calculation of the source function.
libMesh::Real GRINS::SpalartAllmarasParameters::get_r_lin ( ) const
inline

Definition at line 87 of file spalart_allmaras_parameters.h.

References _r_lin.

88  { return _r_lin;}
libMesh::Real _r_lin
Constants specific to the calculation of the destruction function.
libMesh::Real GRINS::SpalartAllmarasParameters::get_sigma ( ) const
inline
libMesh::Real GRINS::SpalartAllmarasParameters::source_fn ( libMesh::Number  nu,
libMesh::Real  mu,
libMesh::Real  wall_distance,
libMesh::Real  vorticity_value,
bool  infinite_distance 
) const

Definition at line 69 of file spalart_allmaras_parameters.C.

References _cv2, _cv3, _kappa, and fv1().

Referenced by GRINS::SpalartAllmarasStabilizationHelper::compute_res_spalart_steady().

71  {
72  // Step 1
73  libMesh::Real chi = nu/mu;
74 
75  // Step 2
76  libMesh::Real fv1 = this->fv1(chi);
77 
78  // Step 3
79  libMesh::Real fv2 = 1 - (chi/(1 + chi*fv1));
80 
81  libMesh::Real S_bar = 0.0;
82  // Step 4
83  if(infinite_distance)
84  {
85  S_bar = 0.0;
86  }
87  else
88  {
89  S_bar = nu/(pow(_kappa, 2.0) * pow(wall_distance, 2.0))*(fv2) ;
90  }
91 
92  // Step 5, the absolute value of the vorticity
93  libMesh::Real S = vorticity_value;
94 
95  // Step 6
96  libMesh::Real S_tilde = 0.0;
97  if(S_bar >= -this->_cv2*S)
98  {
99  S_tilde = S + S_bar;
100  }
101  else
102  {
103  S_tilde = S + (S*(pow(this->_cv2,2.0)*S + this->_cv3*S_bar))/((this->_cv3 - (2*this->_cv2))*S - S_bar);
104  }
105 
106  return S_tilde;
107  }
libMesh::Real _kappa
Constants specific to the calculation of the source function.
libMesh::Real fv1(libMesh::Real chi) const
Helper function.

Member Data Documentation

libMesh::Real GRINS::SpalartAllmarasParameters::_c_n1
protected

Constants specific to the calculation of the negative S-A model.

Definition at line 115 of file spalart_allmaras_parameters.h.

Referenced by get_c_n1(), and SpalartAllmarasParameters().

libMesh::Real GRINS::SpalartAllmarasParameters::_c_t3
protected

Constants specific to the calculation of the trip function (but used in.

Definition at line 112 of file spalart_allmaras_parameters.h.

Referenced by get_c_t3(), and SpalartAllmarasParameters().

libMesh::Real GRINS::SpalartAllmarasParameters::_c_t4
protected

Definition at line 112 of file spalart_allmaras_parameters.h.

Referenced by get_c_t4(), and SpalartAllmarasParameters().

libMesh::Real GRINS::SpalartAllmarasParameters::_c_w2
protected
libMesh::Real GRINS::SpalartAllmarasParameters::_c_w3
protected
libMesh::Real GRINS::SpalartAllmarasParameters::_cb1
protected

Spalart Allmaras model constants, the constant _cw1 are calculated, not cached.

Definition at line 105 of file spalart_allmaras_parameters.h.

Referenced by get_cb1(), and SpalartAllmarasParameters().

libMesh::Real GRINS::SpalartAllmarasParameters::_cb2
protected

Definition at line 105 of file spalart_allmaras_parameters.h.

Referenced by get_cb2(), and SpalartAllmarasParameters().

libMesh::Real GRINS::SpalartAllmarasParameters::_cv1
protected

Definition at line 102 of file spalart_allmaras_parameters.h.

Referenced by get_cv1(), and SpalartAllmarasParameters().

libMesh::Real GRINS::SpalartAllmarasParameters::_cv2
protected

Definition at line 102 of file spalart_allmaras_parameters.h.

Referenced by get_cv2(), source_fn(), and SpalartAllmarasParameters().

libMesh::Real GRINS::SpalartAllmarasParameters::_cv3
protected

Definition at line 102 of file spalart_allmaras_parameters.h.

Referenced by get_cv3(), source_fn(), and SpalartAllmarasParameters().

libMesh::Real GRINS::SpalartAllmarasParameters::_kappa
protected

Constants specific to the calculation of the source function.

Definition at line 102 of file spalart_allmaras_parameters.h.

Referenced by destruction_fn(), get_kappa(), source_fn(), and SpalartAllmarasParameters().

libMesh::Real GRINS::SpalartAllmarasParameters::_r_lin
protected

Constants specific to the calculation of the destruction function.

Definition at line 108 of file spalart_allmaras_parameters.h.

Referenced by destruction_fn(), get_r_lin(), and SpalartAllmarasParameters().

libMesh::Real GRINS::SpalartAllmarasParameters::_sigma
protected

Definition at line 105 of file spalart_allmaras_parameters.h.

Referenced by get_sigma(), and SpalartAllmarasParameters().


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