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-------------------------------------------------------------------------------
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
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
84bool 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// ************************************************************************* //
surfaceScalarField & phi
virtual bool read()
Re-read model coefficients if they have changed.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phase.H:57
void correct()
Correct the phase properties.
autoPtr< phase > clone() const
Return clone.
U
Definition: pEqn.H:72
dynamicFvMesh & mesh
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:517
word timeName
Definition: getTimeIndex.H:3
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:82
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
const dimensionSet dimDensity