All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
phase.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "phase.H"
27 
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 
31 (
32  const word& phaseName,
33  const volVectorField& U,
34  const surfaceScalarField& phi
35 )
36 :
38  (
39  IOobject
40  (
41  IOobject::groupName("alpha", phaseName),
42  U.mesh().time().timeName(),
43  U.mesh(),
44  IOobject::MUST_READ,
45  IOobject::AUTO_WRITE
46  ),
47  U.mesh()
48  ),
49  name_(phaseName),
50  nuModel_(viscosityModel::New(U.mesh(), phaseName)),
51  rho_("rho", dimDensity, nuModel_())
52 {}
53 
54 
55 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
56 
58 {
60  return autoPtr<phase>(nullptr);
61 }
62 
63 
65 {
66  nuModel_->correct();
67 }
68 
69 
70 bool Foam::phase::read(const dictionary& phaseDict)
71 {
72  phaseDict.lookup("rho") >> rho_;
73 
74  return true;
75 }
76 
77 
78 // ************************************************************************* //
autoPtr< CompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const viscosity &viscosity)
U
Definition: pEqn.H:72
virtual bool read()
Read object.
phase(const word &name, const volVectorField &U, const surfaceScalarField &phi)
Construct from components.
void correct()
Correct the phase properties.
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:59
fvMesh & mesh
dictionary()
Construct top-level dictionary null.
Definition: dictionary.C:440
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:58
autoPtr< phase > clone() const
Return clone.
const dimensionSet dimDensity
phi
Definition: correctPhi.H:3
word timeName
Definition: getTimeIndex.H:3
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:353