incompressibleInterPhaseTransportModel.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) 2020 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
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
29
30// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31
32template<class Mixture>
35(
36 const volScalarField& rho,
37 const volVectorField& U,
40 const Mixture& mixture
41)
42:
43 rhoType_(rhoType::UNIFORM),
44 phi_(phi),
45 rhoPhi_(rhoPhi)
46{
47 {
48 IOdictionary turbulenceProperties
49 (
51 (
53 U.time().constant(),
54 U.db(),
57 )
58 );
59
60 if (turbulenceProperties.found("density"))
61 {
62 const word densityMethod
63 (
64 turbulenceProperties.getWord("density")
65 );
66 if (densityMethod == "variable")
67 {
68 rhoType_ = rhoType::VARIABLE;
69 }
70 else if (densityMethod == "uniform")
71 {
72 rhoType_ = rhoType::UNIFORM;
73 }
74 else
75 {
77 << "The rho type provided is not correct " << nl
78 << " Available types are : " << nl
79 << " variable or uniform. " << nl
80 << nl << exit(FatalError);
81 }
82 }
83 }
84
85 if (rhoType_ == rhoType::VARIABLE)
86 {
87 rhoIncTurbulence_ =
88 (
90 (
91 rho,
92 U,
93 rhoPhi,
94 phi,
96 )
97 );
98 }
99 else
100 {
102 (
103 U,
104 phi,
105 mixture
106 );
107
108 incTurbulence_->validate();
109 }
110}
111
112
113// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
114
115template<class Mixture>
118(
119 const volScalarField& rho,
121) const
122{
123 if (rhoType_ == rhoType::VARIABLE)
124 {
125 return rhoIncTurbulence_->divDevRhoReff(U);
126 }
127 else
128 {
129 return incTurbulence_->divDevRhoReff(rho, U);
130 }
131}
132
133template<class Mixture>
135{
136 if (rhoType_ == rhoType::VARIABLE)
137 {
138 rhoIncTurbulence_->correct();
139 }
140 else
141 {
142 incTurbulence_->correct();
143 }
144}
145
146
147// ************************************************************************* //
rhoPhi
Definition: rhoEqn.H:10
surfaceScalarField & phi
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:57
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
word getWord(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Same as get< word >(const word&, keyType::option)
Definition: dictionary.H:1549
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for an entry (const access) with the given keyword.
Definition: dictionaryI.H:87
tmp< volVectorField > divDevRhoReff()
Return the effective viscous stress (laminar + turbulent).
Definition: momentumError.C:52
Transport model selection class for the incompressibleInterFoam family of solvers.
void correct()
Correct the phase or mixture transport models.
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
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
error FatalError
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
constexpr char nl
The newline '\n' character (0x0a)
Definition: Ostream.H:53