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

Encapsulate Spalart-Allmaras model parameters. More...

#include <spalart_allmaras_parameters.h>

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) const
 
libMesh::Real destruction_fn (libMesh::Number nu, libMesh::Real wall_distance, libMesh::Real S_tilde) 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_cw1 () 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
 

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. More...
 
libMesh::Real _sigma
 
libMesh::Real _cb2
 
libMesh::Real _cw1
 
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 ()
 

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

38  : _kappa(input("Physics/"+spalart_allmaras+"/Parameters/kappa",0.41)),
39  _cv1(input("Physics/"+spalart_allmaras+"/Parameters/cv1",7.1)),
40  _cv2(input("Physics/"+spalart_allmaras+"/Parameters/cv2",0.7)),
41  _cv3(input("Physics/"+spalart_allmaras+"/Parameters/cv3",0.9)),
42  _cb1(input("Physics/"+spalart_allmaras+"/Parameters/cb1",0.1355)),
43  _sigma(input("Physics/"+spalart_allmaras+"/Parameters/sigma",2./3.)),
44  _cb2(input("Physics/"+spalart_allmaras+"/Parameters/cb2",0.622)),
45  _cw1( _cb1/(_kappa*_kappa) + (1.0+_cb2)/_sigma ),
46  _r_lin(input("Physics/"+spalart_allmaras+"/Parameters/r_lin",10.0)),
47  _c_w2(input("Physics/"+spalart_allmaras+"/Parameters/c_w2",0.3)),
48  _c_w3(input("Physics/"+spalart_allmaras+"/Parameters/c_w3",2.0)),
49  _c_t3(input("Physics/"+spalart_allmaras+"/Parameters/c_t3",1.2)),
50  _c_t4(input("Physics/"+spalart_allmaras+"/Parameters/c_t4",0.5)),
51  _c_n1(input("Physics/"+spalart_allmaras+"/Parameters/c_n1",16.0))
52  {}
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 _cb1
Spalart Allmaras model constants.
const PhysicsName spalart_allmaras
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 43 of file spalart_allmaras_parameters.h.

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

Member Function Documentation

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

Definition at line 87 of file spalart_allmaras_parameters.C.

References _c_w2, _c_w3, _kappa, and _r_lin.

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

89  {
90  // Step 1
91  libMesh::Real r = 0.0;
92 
93  r = std::min(nu/(S_tilde*pow(this->_kappa,2.0)*pow(wall_distance,2.0)), this->_r_lin);
94 
95  // Step 2
96  libMesh::Real g = r + this->_c_w2*(pow(r,6.0) - r);
97 
98  // Step 3
99  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);
100 
101  return fw;
102  }
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 69 of file spalart_allmaras_parameters.h.

References _cb1.

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

70  { return _cb1;}
libMesh::Real _cb1
Spalart Allmaras model constants.
libMesh::Real GRINS::SpalartAllmarasParameters::get_cb2 ( ) const
inline
libMesh::Real GRINS::SpalartAllmarasParameters::get_cv1 ( ) const
inline

Definition at line 60 of file spalart_allmaras_parameters.h.

References _cv1.

Referenced by fv1().

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

Definition at line 63 of file spalart_allmaras_parameters.h.

References _cv2.

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

Definition at line 66 of file spalart_allmaras_parameters.h.

References _cv3.

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

Definition at line 57 of file spalart_allmaras_parameters.h.

References _kappa.

58  { 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 
) const

Definition at line 55 of file spalart_allmaras_parameters.C.

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

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

57  {
58  // Step 1
59  libMesh::Real chi = nu/mu;
60 
61  // Step 2
62  libMesh::Real fv1 = this->fv1(chi);
63 
64  // Step 3
65  libMesh::Real fv2 = 1 - (chi/(1 + chi*fv1));
66 
67  // Step 4
68  libMesh::Real S_bar = nu/(pow(_kappa, 2.0) * pow(wall_distance, 2.0))*(fv2) ;
69 
70  // Step 5, the absolute value of the vorticity
71  libMesh::Real S = vorticity_value;
72 
73  // Step 6
74  libMesh::Real S_tilde = 0.0;
75  if(S_bar >= -this->_cv2*S)
76  {
77  S_tilde = S + S_bar;
78  }
79  else
80  {
81  S_tilde = S + (S*(pow(this->_cv2,2.0)*S + this->_cv3*S_bar))/((this->_cv3 - (2*this->_cv2))*S - S_bar);
82  }
83 
84  return S_tilde;
85  }
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().

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

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

Definition at line 112 of file spalart_allmaras_parameters.h.

Referenced by get_c_t4().

libMesh::Real GRINS::SpalartAllmarasParameters::_c_w2
protected

Definition at line 108 of file spalart_allmaras_parameters.h.

Referenced by destruction_fn(), and get_c_w2().

libMesh::Real GRINS::SpalartAllmarasParameters::_c_w3
protected

Definition at line 108 of file spalart_allmaras_parameters.h.

Referenced by destruction_fn(), and get_c_w3().

libMesh::Real GRINS::SpalartAllmarasParameters::_cb1
protected

Spalart Allmaras model constants.

Definition at line 105 of file spalart_allmaras_parameters.h.

Referenced by get_cb1().

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

Definition at line 105 of file spalart_allmaras_parameters.h.

Referenced by get_cb2().

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

Definition at line 102 of file spalart_allmaras_parameters.h.

Referenced by get_cv1().

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

Definition at line 102 of file spalart_allmaras_parameters.h.

Referenced by get_cv2(), and source_fn().

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

Definition at line 102 of file spalart_allmaras_parameters.h.

Referenced by get_cv3(), and source_fn().

libMesh::Real GRINS::SpalartAllmarasParameters::_cw1
protected

Definition at line 105 of file spalart_allmaras_parameters.h.

Referenced by get_cw1().

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(), and source_fn().

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(), and get_r_lin().

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

Definition at line 105 of file spalart_allmaras_parameters.h.

Referenced by get_sigma().


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