twoPhaseChangeModel.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) 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 "twoPhaseChangeModel.H"
27 
28 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
29 
30 namespace Foam
31 {
32  defineTypeNameAndDebug(twoPhaseChangeModel, 0);
33  defineRunTimeSelectionTable(twoPhaseChangeModel, dictionary);
34 }
35 
37 (
38  "phaseChangeProperties"
39 );
40 
41 
42 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
43 
44 Foam::IOobject Foam::twoPhaseChangeModel::createIOobject
45 (
46  const immiscibleIncompressibleTwoPhaseMixture& mixture
47 ) const
48 {
49  IOobject io
50  (
51  phaseChangePropertiesName,
52  mixture.U().mesh().time().constant(),
53  mixture.U().mesh(),
56  );
57 
58  if (io.typeHeaderOk<IOdictionary>(true))
59  {
61  return io;
62  }
63  else
64  {
65  io.readOpt() = IOobject::NO_READ;
66  return io;
67  }
68 }
69 
70 
71 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
72 
74 (
75  const word& type,
77 )
78 :
79  IOdictionary(createIOobject(mixture)),
80  mixture_(mixture),
81  twoPhaseChangeModelCoeffs_(optionalSubDict(type + "Coeffs"))
82 {}
83 
84 
85 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
86 
88 {}
89 
90 
92 {
93  if (regIOobject::read())
94  {
95  twoPhaseChangeModelCoeffs_ = optionalSubDict(type() + "Coeffs");
96 
97  return true;
98  }
99  else
100  {
101  return false;
102  }
103 }
104 
105 
106 // ************************************************************************* //
static const word phaseChangePropertiesName
Default phaseChangeProperties dictionary name.
virtual bool read()
Read object.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:53
A class for handling words, derived from string.
Definition: word.H:59
virtual void correct()=0
Correct the phaseChange model.
virtual bool read()=0
Read the transportProperties dictionary and update.
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
defineTypeNameAndDebug(combustionModel, 0)
An immiscible incompressible two-phase mixture transport model.
twoPhaseChangeModel(const word &type, const immiscibleIncompressibleTwoPhaseMixture &mixture)
Construct from dictionary.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
readOption readOpt() const
Definition: IOobject.H:353
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:92
Namespace for OpenFOAM.