Loading...
Searching...
No Matches
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
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
84public:
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");
95 // Declare run-time constructor selection table
96
98 (
99 autoPtr,
102 (
103 const alphaField& alpha,
104 const rhoField& rho,
105 const volVectorField& U,
107 const surfaceScalarField& phi,
109 const word& propertiesName
110 ),
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,
125 const surfaceScalarField& phi,
127 const word& propertiesName
128 );
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,
140 const surfaceScalarField& phi,
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_;
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;
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();
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// ************************************************************************* //
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition Switch.H:81
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
virtual tmp< volScalarField > epsilon() const
Return the turbulence kinetic energy dissipation rate,.
fluidThermoCompressibleTurbulenceModel::alphaField alphaField
virtual tmp< volSymmTensorField > R() const
Return the Reynolds stress tensor, i.e. 0 for laminar flow.
virtual void printCoeffs(const word &type)
Print model coefficients.
virtual tmp< scalarField > nut(const label patchi) const
Return the turbulence viscosity on patch.
fluidThermoCompressibleTurbulenceModel::rhoField rhoField
virtual void correct()
Correct the laminar transport.
virtual tmp< volScalarField > k() const
Return the turbulence kinetic energy, i.e. 0 for laminar flow.
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.
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.
virtual ~laminarModel()=default
Destructor.
virtual tmp< scalarField > nuEff(const label patchi) const
Return the effective viscosity on patch.
TypeName("laminar")
Runtime type information.
virtual tmp< volScalarField > nuEff() const
Return the effective viscosity, i.e. the laminar viscosity.
void operator=(const laminarModel &)=delete
No copy assignment.
laminarModel(const laminarModel &)=delete
No copy construct.
fluidThermoCompressibleTurbulenceModel::transportModel transportModel
virtual tmp< volScalarField > nut() const
Return the turbulence viscosity, i.e. 0 for laminar flow.
laminarModel(const word &type, const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const transportModel &transport, const word &propertiesName)
Construct from components.
virtual tmp< volScalarField > omega() const
Return the specific dissipation rate, i.e. 0 for laminar flow.
virtual bool read()
Read model coefficients if they have changed.
A class for managing temporary objects.
Definition tmp.H:75
static const word propertiesName
Default name of the turbulence properties dictionary.
const surfaceScalarField & alphaRhoPhi() const
Access function to phase flux field.
A class for handling words, derived from Foam::string.
Definition word.H:66
U
Definition pEqn.H:72
Namespace for OpenFOAM.
GeometricField< vector, fvPatchField, volMesh > volVectorField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
#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:68