phaseModel.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 | Copyright (C) 2013 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 "phaseModel.H"
27 
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 
31 (
32  const word& phaseName,
33  const volScalarField& p,
34  const volScalarField& T
35 )
36 :
38  (
39  IOobject
40  (
41  IOobject::groupName("alpha", phaseName),
42  p.mesh().time().timeName(),
43  p.mesh(),
44  IOobject::MUST_READ,
45  IOobject::AUTO_WRITE
46  ),
47  p.mesh()
48  ),
49  name_(phaseName),
50  p_(p),
51  T_(T),
52  thermo_(NULL),
53  dgdt_
54  (
55  IOobject
56  (
57  IOobject::groupName("dgdt", phaseName),
58  p.mesh().time().timeName(),
59  p.mesh(),
60  IOobject::READ_IF_PRESENT,
61  IOobject::AUTO_WRITE
62  ),
63  p.mesh(),
65  )
66 {
67  {
68  volScalarField Tp(IOobject::groupName("T", phaseName), T);
69  Tp.write();
70  }
71 
72  thermo_ = rhoThermo::New(p.mesh(), phaseName);
73  thermo_->validate(phaseName, "e");
74 
75  correct();
76 }
77 
78 
79 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
80 
82 {
83  notImplemented("phaseModel::clone() const");
84  return autoPtr<phaseModel>(NULL);
85 }
86 
87 
89 {
90  thermo_->he() = thermo_->he(p_, T_);
91  thermo_->correct();
92 }
93 
94 
95 // ************************************************************************* //
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:51
dynamicFvMesh & mesh
virtual void correct()
Update properties.
autoPtr< phaseModel > clone() const
Return clone.
void correct()
Correct the laminar viscosity.
static word groupName(Name name, const word &group)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
volScalarField & p_
Pressure [Pa].
Definition: basicThermo.H:68
static autoPtr< rhoThermo > New(const fvMesh &, const word &phaseName=word::null)
Selector.
Definition: rhoThermo.C:141
volScalarField T_
Temperature [K].
Definition: basicThermo.H:71
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:47
phaseModel(const word &phaseName, const volScalarField &p, const volScalarField &T)
Construct from components.
#define notImplemented(functionName)
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:356
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
word timeName
Definition: getTimeIndex.H:3