phase.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) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2019 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 \*---------------------------------------------------------------------------*/
28 
29 #include "phase.H"
30 
31 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32 
34 (
35  const word& phaseName,
36  const dictionary& phaseDict,
37  const volVectorField& U,
38  const surfaceScalarField& phi
39 )
40 :
42  (
43  IOobject
44  (
45  IOobject::groupName("alpha", phaseName),
46  U.mesh().time().timeName(),
47  U.mesh(),
48  IOobject::MUST_READ,
49  IOobject::AUTO_WRITE
50  ),
51  U.mesh()
52  ),
53  name_(phaseName),
54  phaseDict_(phaseDict),
55  nuModel_
56  (
57  viscosityModel::New
58  (
59  IOobject::groupName("nu", phaseName),
60  phaseDict_,
61  U,
62  phi
63  )
64  ),
65  rho_("rho", dimDensity, phaseDict_)
66 {}
67 
68 
69 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
70 
72 {
74  return nullptr;
75 }
76 
77 
79 {
80  nuModel_->correct();
81 }
82 
83 
84 bool Foam::phase::read(const dictionary& phaseDict)
85 {
86  phaseDict_ = phaseDict;
87 
88  if (nuModel_->read(phaseDict_))
89  {
90  phaseDict_.readEntry("rho", rho_);
91 
92  return true;
93  }
94 
95  return false;
96 }
97 
98 
99 // ************************************************************************* //
Foam::phase::read
bool read(const dictionary &phaseDict)
Read base transportProperties dictionary.
Foam::dimDensity
const dimensionSet dimDensity
Foam::phase::correct
void correct()
Correct the phase properties.
NotImplemented
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:517
Foam::phase::clone
autoPtr< phase > clone() const
Return clone.
phase.H
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
timeName
word timeName
Definition: getTimeIndex.H:3
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::phase::phase
phase(const word &name, const dictionary &phaseDict, const volVectorField &U, const surfaceScalarField &phi)
Construct from components.
Foam::New
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
Definition: DimensionedFieldReuseFunctions.H:105
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:62
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::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:54