GRINS-0.6.0
spalart_allmaras_parameters.C
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // GRINS - General Reacting Incompressible Navier-Stokes
5 //
6 // Copyright (C) 2014-2015 Paul T. Bauman, Roy H. Stogner
7 // Copyright (C) 2010-2013 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 
26 // This class
28 
29 // GRINS
31 
32 // libMesh
33 #include "libmesh/getpot.h"
34 
35 namespace GRINS
36 {
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  {}
53 
54 
55  libMesh::Real SpalartAllmarasParameters::source_fn(libMesh::Number nu, libMesh::Real mu,
56  libMesh::Real wall_distance, libMesh::Real vorticity_value) const
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  }
86 
87  libMesh::Real SpalartAllmarasParameters::destruction_fn(libMesh::Number nu, libMesh::Real wall_distance,
88  libMesh::Real S_tilde) const
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  }
103 
104 } // end namespace GRINS
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 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
const PhysicsName spalart_allmaras
GRINS namespace.
libMesh::Real fv1(libMesh::Real chi) const
Helper function.

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