SpalartAllmarasFv3FieldInversion.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2 
3  DAFoam : Discrete Adjoint with OpenFOAM
4  Version : v3
5 
6 \*---------------------------------------------------------------------------*/
7 
9 #include "fvOptions.H"
10 #include "bound.H"
11 #include "wallDist.H"
12 
13 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
14 
15 namespace Foam
16 {
17 namespace RASModels
18 {
19 
20 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
21 
22 template<class BasicTurbulenceModel>
24 {
25 }
26 
27 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
28 
29 template<class BasicTurbulenceModel>
31  const alphaField& alpha,
32  const rhoField& rho,
33  const volVectorField& U,
34  const surfaceScalarField& alphaRhoPhi,
35  const surfaceScalarField& phi,
36  const transportModel& transport,
37  const word& propertiesName,
38  const word& type)
39  : eddyViscosity<RASModel<BasicTurbulenceModel>>(
40  type,
41  alpha,
42  rho,
43  U,
44  alphaRhoPhi,
45  phi,
46  transport,
47  propertiesName),
48  nuTilda_(
49  IOobject(
50  "nuTilda",
51  this->runTime_.timeName(),
52  this->mesh_,
53  IOobject::MUST_READ,
54  IOobject::AUTO_WRITE),
55  this->mesh_),
56  betaFieldInversion_(
57  IOobject(
58  "betaFieldInversion",
59  this->runTime_.timeName(),
60  this->mesh_,
61  IOobject::MUST_READ,
62  IOobject::AUTO_WRITE),
63  this->mesh_),
64  UData_(
65  IOobject(
66  "UData",
67  this->runTime_.timeName(),
68  this->mesh_,
69  IOobject::READ_IF_PRESENT,
70  IOobject::AUTO_WRITE),
71  this->mesh_,
72  dimensionedVector("UData", dimensionSet(0, 1, -1, 0, 0, 0, 0), vector(0, 0, 0)),
73  "zeroGradient"),
74  surfaceFriction_(
75  IOobject(
76  "surfaceFriction",
77  this->runTime_.timeName(),
78  this->mesh_,
79  IOobject::READ_IF_PRESENT,
80  IOobject::AUTO_WRITE),
81  this->mesh_,
82  dimensionedScalar("surfaceFriction", dimensionSet(0, 0, 0, 0, 0, 0, 0), 0.0),
83  zeroGradientFvPatchField<scalar>::typeName),
84  surfaceFrictionData_(
85  IOobject(
86  "surfaceFrictionData",
87  this->runTime_.timeName(),
88  this->mesh_,
89  IOobject::READ_IF_PRESENT,
90  IOobject::AUTO_WRITE),
91  this->mesh_,
92  dimensionedScalar("surfaceFrictionData", dimensionSet(0, 0, 0, 0, 0, 0, 0), 0.0),
93  zeroGradientFvPatchField<scalar>::typeName),
94  pData_(
95  IOobject(
96  "pData",
97  this->runTime_.timeName(),
98  this->mesh_,
99  IOobject::READ_IF_PRESENT,
100  IOobject::AUTO_WRITE),
101  this->mesh_,
102  dimensionedScalar("pData", dimensionSet(0, 0, 0, 0, 0, 0, 0), 0.0),
103  zeroGradientFvPatchField<scalar>::typeName),
104  USingleComponentData_(
105  IOobject(
106  "USingleComponentData",
107  this->runTime_.timeName(),
108  this->mesh_,
109  IOobject::READ_IF_PRESENT,
110  IOobject::AUTO_WRITE),
111  this->mesh_,
112  dimensionedScalar("USingleComponentData", dimensionSet(0, 0, 0, 0, 0, 0, 0), 0.0),
113  zeroGradientFvPatchField<scalar>::typeName),
114  y_(wallDist::New(this->mesh_).y())
115 {
116 }
117 
118 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
119 
120 template<class BasicTurbulenceModel>
122 {
123  return true;
124 }
125 
126 template<class BasicTurbulenceModel>
128 {
129  return this->nut_;
130 }
131 
132 template<class BasicTurbulenceModel>
134 {
135 
136  return this->nut_;
137 }
138 
139 template<class BasicTurbulenceModel>
141 {
142 }
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 } // End namespace RASModels
147 } // End namespace Foam
148 
149 // ************************************************************************* //
U
U
Definition: pEqnPimpleDyM.H:60
Foam::RASModels::SpalartAllmarasFv3FieldInversion
Definition: SpalartAllmarasFv3FieldInversion.H:32
Foam::RASModels::SpalartAllmarasFv3FieldInversion::k
virtual tmp< volScalarField > k() const
Definition: SpalartAllmarasFv3FieldInversion.C:127
SpalartAllmarasFv3FieldInversion.H
Foam::RASModels::SpalartAllmarasFv3FieldInversion::read
virtual bool read()
Definition: SpalartAllmarasFv3FieldInversion.C:121
Foam::RASModels::SpalartAllmarasFv3FieldInversion::correct
virtual void correct()
Definition: SpalartAllmarasFv3FieldInversion.C:140
Foam::RASModels::SpalartAllmarasFv3FieldInversion::alphaField
BasicTurbulenceModel::alphaField alphaField
Definition: SpalartAllmarasFv3FieldInversion.H:69
Foam::RASModels::SpalartAllmarasFv3FieldInversion::rhoField
BasicTurbulenceModel::rhoField rhoField
Definition: SpalartAllmarasFv3FieldInversion.H:70
phi
surfaceScalarField & phi
Definition: createRefsPimple.H:8
Foam::RASModels::SpalartAllmarasFv3FieldInversion::correctNut
virtual void correctNut()
Definition: SpalartAllmarasFv3FieldInversion.C:23
Foam
Definition: multiFreqScalarFvPatchField.C:144
Foam::RASModels::SpalartAllmarasFv3FieldInversion::epsilon
virtual tmp< volScalarField > epsilon() const
Definition: SpalartAllmarasFv3FieldInversion.C:133
Foam::RASModels::SpalartAllmarasFv3FieldInversion::transportModel
BasicTurbulenceModel::transportModel transportModel
Definition: SpalartAllmarasFv3FieldInversion.H:71
rho
volScalarField & rho
Definition: createRefsRhoSimpleC.H:8