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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::laminarModel
29
30Description
31 Templated abstract base class for laminar transport models
32
33SourceFiles
34 laminarModel.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef laminarModel_H
39#define laminarModel_H
40
41#include "TurbulenceModel.H"
42
43// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44
45namespace Foam
46{
47
48/*---------------------------------------------------------------------------*\
49 Class laminarModel Declaration
50\*---------------------------------------------------------------------------*/
51
52template<class BasicTurbulenceModel>
53class laminarModel
54:
55 public BasicTurbulenceModel
56{
57
58protected:
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
84public:
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
98 (
99 autoPtr,
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// ************************************************************************* //
surfaceScalarField & phi
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:78
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Templated abstract base class for laminar transport models.
Definition: laminarModel.H:55
virtual tmp< volScalarField > epsilon() const
Return the turbulence kinetic energy dissipation rate,.
Definition: laminarModel.C:271
BasicTurbulenceModel::alphaField alphaField
Definition: laminarModel.H:85
dictionary coeffDict_
Model coefficients dictionary.
Definition: laminarModel.H:68
virtual tmp< volSymmTensorField > R() const
Return the Reynolds stress tensor, i.e. 0 for laminar flow.
Definition: laminarModel.C:313
virtual void printCoeffs(const word &type)
Print model coefficients.
Definition: laminarModel.C:35
BasicTurbulenceModel::rhoField rhoField
Definition: laminarModel.H:86
virtual void correct()
Correct the laminar transport.
Definition: laminarModel.C:333
virtual tmp< volScalarField > k() const
Return the turbulence kinetic energy, i.e. 0 for laminar flow.
Definition: laminarModel.C:250
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))
virtual const dictionary & coeffDict() const
Const access to the coefficients dictionary.
Definition: laminarModel.H:158
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
virtual ~laminarModel()=default
Destructor.
dictionary laminarDict_
laminar coefficients dictionary
Definition: laminarModel.H:62
TypeName("laminar")
Runtime type information.
virtual tmp< volScalarField > nuEff() const
Return the effective viscosity, i.e. the laminar viscosity.
Definition: laminarModel.C:225
void operator=(const laminarModel &)=delete
No copy assignment.
laminarModel(const laminarModel &)=delete
No copy construct.
BasicTurbulenceModel::transportModel transportModel
Definition: laminarModel.H:87
virtual tmp< volScalarField > nut() const
Return the turbulence viscosity, i.e. 0 for laminar flow.
Definition: laminarModel.C:190
virtual tmp< volScalarField > omega() const
Return the specific dissipation rate, i.e. 0 for laminar flow.
Definition: laminarModel.C:292
Switch printCoeffs_
Flag to print the model coeffs at run-time.
Definition: laminarModel.H:65
virtual bool read()
Read model coefficients if they have changed.
Definition: laminarModel.C:173
A class for managing temporary objects.
Definition: tmp.H:65
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for handling words, derived from Foam::string.
Definition: word.H:68
U
Definition: pEqn.H:72
Namespace for OpenFOAM.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:598
volScalarField & alpha
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73