laminar.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "laminar.H"
27 #include "volFields.H"
28 #include "surfaceFields.H"
29 #include "fvcGrad.H"
30 #include "fvcDiv.H"
31 #include "fvmLaplacian.H"
32 
33 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
34 
35 template<class BasicTurbulenceModel>
37 (
38  const alphaField& alpha,
39  const rhoField& rho,
40  const volVectorField& U,
41  const surfaceScalarField& alphaRhoPhi,
42  const surfaceScalarField& phi,
43  const transportModel& transport,
44  const word& propertiesName
45 )
46 :
48  (
49  typeName,
50  alpha,
51  rho,
52  U,
53  alphaRhoPhi,
54  phi,
55  transport,
56  propertiesName
57  )
58 {}
59 
60 
61 // * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
62 
63 template<class BasicTurbulenceModel>
66 (
67  const alphaField& alpha,
68  const rhoField& rho,
69  const volVectorField& U,
70  const surfaceScalarField& alphaRhoPhi,
71  const surfaceScalarField& phi,
72  const transportModel& transport,
73  const word& propertiesName
74 )
75 {
76  return autoPtr<laminar>
77  (
78  new laminar
79  (
80  alpha,
81  rho,
82  U,
83  alphaRhoPhi,
84  phi,
85  transport,
86  propertiesName
87  )
88  );
89 }
90 
91 
92 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
93 
94 template<class BasicTurbulenceModel>
95 const Foam::dictionary&
97 {
98  return dictionary::null;
99 }
100 
101 
102 template<class BasicTurbulenceModel>
104 {
105  return true;
106 }
107 
108 
109 template<class BasicTurbulenceModel>
112 {
113  return tmp<volScalarField>
114  (
115  new volScalarField
116  (
117  IOobject
118  (
119  IOobject::groupName("nut", this->U_.group()),
120  this->runTime_.timeName(),
121  this->mesh_,
122  IOobject::NO_READ,
123  IOobject::NO_WRITE,
124  false
125  ),
126  this->mesh_,
127  dimensionedScalar("nut", dimViscosity, 0.0)
128  )
129  );
130 }
131 
132 
133 template<class BasicTurbulenceModel>
136 (
137  const label patchi
138 ) const
139 {
140  return tmp<scalarField>
141  (
142  new scalarField(this->mesh_.boundary()[patchi].size(), 0.0)
143  );
144 }
145 
146 
147 template<class BasicTurbulenceModel>
150 {
151  return tmp<volScalarField>
152  (
153  new volScalarField
154  (
155  IOobject::groupName("nuEff", this->U_.group()), this->nu()
156  )
157  );
158 }
159 
160 
161 template<class BasicTurbulenceModel>
164 (
165  const label patchi
166 ) const
167 {
168  return this->nu(patchi);
169 }
170 
171 
172 template<class BasicTurbulenceModel>
175 {
176  return tmp<volScalarField>
177  (
178  new volScalarField
179  (
180  IOobject
181  (
182  IOobject::groupName("k", this->U_.group()),
183  this->runTime_.timeName(),
184  this->mesh_,
185  IOobject::NO_READ,
186  IOobject::NO_WRITE,
187  false
188  ),
189  this->mesh_,
190  dimensionedScalar("k", sqr(this->U_.dimensions()), 0.0)
191  )
192  );
193 }
194 
195 
196 template<class BasicTurbulenceModel>
199 {
200  return tmp<volScalarField>
201  (
202  new volScalarField
203  (
204  IOobject
205  (
206  IOobject::groupName("epsilon", this->U_.group()),
207  this->runTime_.timeName(),
208  this->mesh_,
209  IOobject::NO_READ,
210  IOobject::NO_WRITE,
211  false
212  ),
213  this->mesh_,
215  (
216  "epsilon", sqr(this->U_.dimensions())/dimTime, 0.0
217  )
218  )
219  );
220 }
221 
222 
223 template<class BasicTurbulenceModel>
226 {
228  (
230  (
231  IOobject
232  (
233  IOobject::groupName("R", this->U_.group()),
234  this->runTime_.timeName(),
235  this->mesh_,
236  IOobject::NO_READ,
237  IOobject::NO_WRITE,
238  false
239  ),
240  this->mesh_,
242  (
243  "R", sqr(this->U_.dimensions()), symmTensor::zero
244  )
245  )
246  );
247 }
248 
249 
250 template<class BasicTurbulenceModel>
252 {
254 }
255 
256 
257 // ************************************************************************* //
volFields.H
Foam::IOobject
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:91
Foam::laminar::epsilon
virtual tmp< volScalarField > epsilon() const
Return the turbulence kinetic energy dissipation rate,.
Definition: laminar.C:198
Foam::laminar::New
static autoPtr< laminar > New(const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const transportModel &transport, const word &propertiesName=turbulenceModel::propertiesName)
Return a reference to the selected turbulence model.
Definition: laminar.C:66
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::laminar::nuEff
virtual tmp< volScalarField > nuEff() const
Return the effective viscosity, i.e. the laminar viscosity.
Definition: laminar.C:149
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:216
laminar.H
fvcDiv.H
Calculate the divergence of the given field.
Foam::laminar::rhoField
BasicTurbulenceModel::rhoField rhoField
Definition: laminar.H:57
surfaceFields.H
Foam::surfaceFields.
Foam::laminar::correct
virtual void correct()
Correct the laminar viscosity.
Definition: laminar.C:251
U
U
Definition: pEqn.H:46
Foam::laminar::R
virtual tmp< volSymmTensorField > R() const
Return the Reynolds stress tensor, i.e. 0 for laminar flow.
Definition: laminar.C:225
Foam::laminar::read
virtual bool read()
Read turbulenceProperties dictionary.
Definition: laminar.C:103
nu
volScalarField & nu
Definition: readMechanicalProperties.H:179
Foam::laminar::alphaField
BasicTurbulenceModel::alphaField alphaField
Definition: laminar.H:56
Foam::dimTime
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:51
Foam::linearViscousStress
Linear viscous stress turbulence model base class.
Definition: linearViscousStress.H:50
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
fvmLaplacian.H
Calculate the matrix for the laplacian of the field.
correct
fvOptions correct(rho)
Foam::laminar::k
virtual tmp< volScalarField > k() const
Return the turbulence kinetic energy, i.e. 0 for laminar flow.
Definition: laminar.C:174
Foam::dimViscosity
const dimensionSet dimViscosity
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::dimensioned
Generic dimensioned Type class.
Definition: dimensionedScalarFwd.H:41
Foam::laminar::transportModel
BasicTurbulenceModel::transportModel transportModel
Definition: laminar.H:58
Foam::laminar::nut
virtual tmp< volScalarField > nut() const
Return the turbulence viscosity, i.e. 0 for laminar flow.
Definition: laminar.C:111
Foam::laminar::laminar
laminar(const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const transportModel &transport, const word &propertiesName=turbulenceModel::propertiesName)
Construct from components.
Definition: laminar.C:37
rho
rho
Definition: pEqn.H:3
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::sqr
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Definition: dimensionedSymmTensor.C:49
scalarField
volScalarField scalarField(fieldObject, mesh)
fvcGrad.H
Calculate the gradient of the given field.
patchi
label patchi
Definition: getPatchFieldScalar.H:1
Foam::laminar
Turbulence model for laminar flow.
Definition: laminar.H:49
Foam::laminar::coeffDict
virtual const dictionary & coeffDict() const
Const access to the coefficients dictionary.
Definition: laminar.C:96
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52