Stokes.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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2013-2017 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "Stokes.H"
29 #include "volFields.H"
30 #include "surfaceFields.H"
31 #include "fvcGrad.H"
32 #include "fvcDiv.H"
33 #include "fvmLaplacian.H"
34 
35 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
36 
37 namespace Foam
38 {
39 namespace laminarModels
40 {
41 
42 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
43 
44 template<class BasicTurbulenceModel>
46 (
47  const alphaField& alpha,
48  const rhoField& rho,
49  const volVectorField& U,
50  const surfaceScalarField& alphaRhoPhi,
51  const surfaceScalarField& phi,
52  const transportModel& transport,
53  const word& propertiesName
54 )
55 :
57  (
58  typeName,
59  alpha,
60  rho,
61  U,
62  alphaRhoPhi,
63  phi,
64  transport,
65  propertiesName
66  )
67 {}
68 
69 
70 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
71 
72 template<class BasicTurbulenceModel>
73 const dictionary&
75 {
76  return dictionary::null;
77 }
78 
79 
80 template<class BasicTurbulenceModel>
82 {
83  return true;
84 }
85 
86 
87 template<class BasicTurbulenceModel>
90 {
92  (
93  IOobject
94  (
95  IOobject::groupName("nut", this->alphaRhoPhi_.group()),
96  this->runTime_.timeName(),
97  this->mesh_,
100  false
101  ),
102  this->mesh_,
104  );
105 }
106 
107 
108 template<class BasicTurbulenceModel>
111 (
112  const label patchi
113 ) const
114 {
115  return tmp<scalarField>
116  (
117  new scalarField(this->mesh_.boundary()[patchi].size(), Zero)
118  );
119 }
120 
121 
122 template<class BasicTurbulenceModel>
125 {
126  return tmp<volScalarField>
127  (
128  new volScalarField
129  (
130  IOobject::groupName("nuEff", this->alphaRhoPhi_.group()), this->nu()
131  )
132  );
133 }
134 
135 
136 template<class BasicTurbulenceModel>
139 (
140  const label patchi
141 ) const
142 {
143  return this->nu(patchi);
144 }
145 
146 
147 template<class BasicTurbulenceModel>
150 {
152  (
153  IOobject
154  (
155  IOobject::groupName("k", this->alphaRhoPhi_.group()),
156  this->runTime_.timeName(),
157  this->mesh_,
160  false
161  ),
162  this->mesh_,
163  dimensionedScalar(sqr(this->U_.dimensions()), Zero)
164  );
165 }
166 
167 
168 template<class BasicTurbulenceModel>
171 {
173  (
174  IOobject
175  (
176  IOobject::groupName("epsilon", this->alphaRhoPhi_.group()),
177  this->runTime_.timeName(),
178  this->mesh_,
181  false
182  ),
183  this->mesh_,
184  dimensionedScalar(sqr(this->U_.dimensions())/dimTime, Zero)
185  );
186 }
187 
188 
189 template<class BasicTurbulenceModel>
192 {
194  (
195  IOobject
196  (
197  IOobject::groupName("R", this->alphaRhoPhi_.group()),
198  this->runTime_.timeName(),
199  this->mesh_,
202  false
203  ),
204  this->mesh_,
205  dimensionedSymmTensor(sqr(this->U_.dimensions()), Zero)
206  );
207 }
208 
209 
210 template<class BasicTurbulenceModel>
212 {
214 }
215 
216 
217 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218 
219 } // End namespace laminarModels
220 } // End namespace Foam
221 
222 // ************************************************************************* //
Foam::IOobject::NO_WRITE
Definition: IOobject.H:130
volFields.H
Foam::scalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Definition: primitiveFieldsFwd.H:52
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:104
Foam::laminarModel::alphaField
BasicTurbulenceModel::alphaField alphaField
Definition: laminarModel.H:84
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::dimensionedSymmTensor
dimensioned< symmTensor > dimensionedSymmTensor
Dimensioned tensor obtained from generic dimensioned type.
Definition: dimensionedSymmTensor.H:50
Foam::tmp< volScalarField >
Foam::Zero
static constexpr const zero Zero
Global zero.
Definition: zero.H:128
Foam::laminarModels::Stokes::nut
virtual tmp< volScalarField > nut() const
Return the turbulence viscosity, i.e. 0 for Stokes flow.
Definition: Stokes.C:89
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:212
Foam::laminarModels::Stokes::correct
virtual void correct()
Correct the Stokes viscosity.
Definition: Stokes.C:211
fvcDiv.H
Calculate the divergence of the given field.
surfaceFields.H
Foam::surfaceFields.
rho
rho
Definition: readInitialConditions.H:96
Foam::laminarModels::Stokes::coeffDict
virtual const dictionary & coeffDict() const
Const access to the coefficients dictionary.
Definition: Stokes.C:74
Foam::laminarModels::Stokes::R
virtual tmp< volSymmTensorField > R() const
Return the Reynolds stress tensor, i.e. 0 for Stokes flow.
Definition: Stokes.C:191
Foam::dictionary::null
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
Definition: dictionary.H:385
nu
volScalarField & nu
Definition: readMechanicalProperties.H:176
Foam::dimTime
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:54
Foam::linearViscousStress
Linear viscous stress turbulence model base class.
Definition: linearViscousStress.H:53
Foam::laminarModels::Stokes::Stokes
Stokes(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: Stokes.C:46
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:62
fvmLaplacian.H
Calculate the matrix for the laplacian of the field.
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:43
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::dimViscosity
const dimensionSet dimViscosity
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::laminarModels::Stokes::nuEff
virtual tmp< volScalarField > nuEff() const
Return the effective viscosity, i.e. the Stokes viscosity.
Definition: Stokes.C:124
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::laminarModel::transportModel
BasicTurbulenceModel::transportModel transportModel
Definition: laminarModel.H:86
Stokes.H
Foam::laminarModels::Stokes::k
virtual tmp< volScalarField > k() const
Return the turbulence kinetic energy, i.e. 0 for Stokes flow.
Definition: Stokes.C:149
U
U
Definition: pEqn.H:72
Foam::laminarModel::correct
virtual void correct()
Correct the laminar transport.
Definition: laminarModel.C:308
Foam::sqr
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Definition: dimensionedSymmTensor.C:51
Foam::IOobject::groupName
static word groupName(StringType name, const word &group)
Create dot-delimited name.group.
fvcGrad.H
Calculate the gradient of the given field.
Foam::tmp::New
static tmp< T > New(Args &&... args)
Construct tmp of T with forwarding arguments.
Foam::laminarModels::Stokes::read
virtual bool read()
Read turbulenceProperties dictionary.
Definition: Stokes.C:81
Foam::GeometricField< vector, fvPatchField, volMesh >
Foam::IOobject::NO_READ
Definition: IOobject.H:123
Foam::laminarModel::rhoField
BasicTurbulenceModel::rhoField rhoField
Definition: laminarModel.H:85
Foam::laminarModels::Stokes::epsilon
virtual tmp< volScalarField > epsilon() const
Definition: Stokes.C:170