laminarModel.H
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) 2016 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::laminarModel
29 
30 Description
31  Templated abstract base class for laminar transport models
32 
33 SourceFiles
34  laminarModel.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef laminarModel_H
39 #define laminarModel_H
40 
41 #include "TurbulenceModel.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class laminarModel Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 template<class BasicTurbulenceModel>
53 class laminarModel
54 :
55  public BasicTurbulenceModel
56 {
57 
58 protected:
59 
60  // Protected data
61 
62  //- laminar coefficients dictionary
64 
65  //- Flag to print the model coeffs at run-time
67 
68  //- Model coefficients dictionary
70 
71 
72  // Protected Member Functions
73 
74  //- Print model coefficients
75  virtual void printCoeffs(const word& type);
76 
77  //- No copy construct
78  laminarModel(const laminarModel&) = delete;
79 
80  //- No copy assignment
81  void operator=(const laminarModel&) = delete;
82 
83 
84 public:
85 
86  typedef typename BasicTurbulenceModel::alphaField alphaField;
87  typedef typename BasicTurbulenceModel::rhoField rhoField;
88  typedef typename BasicTurbulenceModel::transportModel transportModel;
89 
90 
91  //- Runtime type information
92  TypeName("laminar");
93 
94 
95  // Declare run-time constructor selection table
96 
98  (
99  autoPtr,
100  laminarModel,
101  dictionary,
102  (
103  const alphaField& alpha,
104  const rhoField& rho,
105  const volVectorField& U,
106  const surfaceScalarField& alphaRhoPhi,
107  const surfaceScalarField& phi,
108  const transportModel& transport,
109  const word& propertiesName
110  ),
111  (alpha, rho, U, alphaRhoPhi, phi, transport, propertiesName)
112  );
113 
114 
115  // Constructors
116 
117  //- Construct from components
119  (
120  const word& type,
121  const alphaField& alpha,
122  const rhoField& rho,
123  const volVectorField& U,
124  const surfaceScalarField& alphaRhoPhi,
125  const surfaceScalarField& phi,
126  const transportModel& transport,
127  const word& propertiesName
128  );
129 
130 
131  // Selectors
132 
133  //- Return a reference to the selected laminar model
135  (
136  const alphaField& alpha,
137  const rhoField& rho,
138  const volVectorField& U,
139  const surfaceScalarField& alphaRhoPhi,
140  const surfaceScalarField& phi,
141  const transportModel& transport,
142  const word& propertiesName = turbulenceModel::propertiesName
143  );
144 
145 
146  //- Destructor
147  virtual ~laminarModel() = default;
148 
149 
150  // Member Functions
151 
152  //- Read model coefficients if they have changed
153  virtual bool read();
154 
155 
156  // Access
157 
158  //- Const access to the coefficients dictionary
159  virtual const dictionary& coeffDict() const
160  {
161  return coeffDict_;
162  }
163 
164  //- Return the turbulence viscosity, i.e. 0 for laminar flow
165  virtual tmp<volScalarField> nut() const;
166 
167  //- Return the turbulence viscosity on patch
168  virtual tmp<scalarField> nut(const label patchi) const;
169 
170  //- Return the effective viscosity, i.e. the laminar viscosity
171  virtual tmp<volScalarField> nuEff() const;
172 
173  //- Return the effective viscosity on patch
174  virtual tmp<scalarField> nuEff(const label patchi) const;
175 
176  //- Return the turbulence kinetic energy, i.e. 0 for laminar flow
177  virtual tmp<volScalarField> k() const;
178 
179  //- Return the turbulence kinetic energy dissipation rate,
180  // i.e. 0 for laminar flow
181  virtual tmp<volScalarField> epsilon() const;
182 
183  //- Return the specific dissipation rate, i.e. 0 for laminar flow
184  virtual tmp<volScalarField> omega() const;
185 
186  //- Return the Reynolds stress tensor, i.e. 0 for laminar flow
187  virtual tmp<volSymmTensorField> R() const;
188 
189  //- Correct the laminar transport
190  virtual void correct();
191 };
192 
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 } // End namespace Foam
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 #ifdef NoRepository
201  #include "laminarModel.C"
202 #endif
203 
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205 
206 #endif
207 
208 // ************************************************************************* //
Foam::Switch
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:77
Foam::laminarModel::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, laminarModel, dictionary,(const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const transportModel &transport, const word &propertiesName),(alpha, rho, U, alphaRhoPhi, phi, transport, propertiesName))
Foam::laminarModel::laminarDict_
dictionary laminarDict_
laminar coefficients dictionary
Definition: laminarModel.H:62
Foam::laminarModel::alphaField
BasicTurbulenceModel::alphaField alphaField
Definition: laminarModel.H:85
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::laminarModel::laminarModel
laminarModel(const laminarModel &)=delete
No copy construct.
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:212
Foam::laminarModel::coeffDict
virtual const dictionary & coeffDict() const
Const access to the coefficients dictionary.
Definition: laminarModel.H:158
Foam::turbulenceModel::propertiesName
static const word propertiesName
Default name of the turbulence properties dictionary.
Definition: turbulenceModel.H:100
Foam::laminarModel::~laminarModel
virtual ~laminarModel()=default
Destructor.
rho
rho
Definition: readInitialConditions.H:88
Foam::laminarModel
Templated abstract base class for laminar transport models.
Definition: laminarModel.H:52
laminarModel.C
Foam::laminarModel::read
virtual bool read()
Read model coefficients if they have changed.
Definition: laminarModel.C:173
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::laminarModel::printCoeffs
virtual void printCoeffs(const word &type)
Print model coefficients.
Definition: laminarModel.C:35
Foam::laminarModel::printCoeffs_
Switch printCoeffs_
Flag to print the model coeffs at run-time.
Definition: laminarModel.H:65
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::laminarModel::coeffDict_
dictionary coeffDict_
Model coefficients dictionary.
Definition: laminarModel.H:68
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::laminarModel::transportModel
BasicTurbulenceModel::transportModel transportModel
Definition: laminarModel.H:87
Foam::laminarModel::R
virtual tmp< volSymmTensorField > R() const
Return the Reynolds stress tensor, i.e. 0 for laminar flow.
Definition: laminarModel.C:313
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
U
U
Definition: pEqn.H:72
Foam::laminarModel::correct
virtual void correct()
Correct the laminar transport.
Definition: laminarModel.C:333
Foam::laminarModel::k
virtual tmp< volScalarField > k() const
Return the turbulence kinetic energy, i.e. 0 for laminar flow.
Definition: laminarModel.C:250
Foam::laminarModel::New
static autoPtr< laminarModel > 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 laminar model.
Definition: laminarModel.C:86
Foam::type
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:590
TurbulenceModel.H
Foam::laminarModel::nuEff
virtual tmp< volScalarField > nuEff() const
Return the effective viscosity, i.e. the laminar viscosity.
Definition: laminarModel.C:225
Foam::laminarModel::operator=
void operator=(const laminarModel &)=delete
No copy assignment.
Foam::laminarModel::epsilon
virtual tmp< volScalarField > epsilon() const
Return the turbulence kinetic energy dissipation rate,.
Definition: laminarModel.C:271
Foam::laminarModel::TypeName
TypeName("laminar")
Runtime type information.
Foam::GeometricField< vector, fvPatchField, volMesh >
Foam::laminarModel::rhoField
BasicTurbulenceModel::rhoField rhoField
Definition: laminarModel.H:86
Foam::laminarModel::nut
virtual tmp< volScalarField > nut() const
Return the turbulence viscosity, i.e. 0 for laminar flow.
Definition: laminarModel.C:190
Foam::laminarModel::omega
virtual tmp< volScalarField > omega() const
Return the specific dissipation rate, i.e. 0 for laminar flow.
Definition: laminarModel.C:292