twoPhaseChangeModel.H
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 Class
25  Foam::twoPhaseChangeModel
26 
27 Description
28 
29 SourceFiles
30  twoPhaseChangeModel.C
31  phaseChangeModelNew.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef twoPhaseChangeModel_H
36 #define twoPhaseChangeModel_H
37 
39 #include "fvMatricesFwd.H"
40 #include "Pair.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class twoPhaseChangeModel Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class twoPhaseChangeModel
52 :
53  public IOdictionary
54 {
55  // Private Member Functions
56 
57  //- Construct the base IO object
58  IOobject createIOobject
59  (
60  const compressibleTwoPhaseMixture& mixture
61  ) const;
62 
63 
64 protected:
65 
66  // Protected data
67 
68  //- Reference to the two-phase mixture
70 
71  //- Model coefficient dictionary
73 
74 
75 public:
76 
77  //- Runtime type information
78  TypeName("phaseChangeModel");
79 
80  //- Default phaseChangeProperties dictionary name
81  static const word phaseChangePropertiesName;
82 
83 
84  // Declare run-time constructor selection table
85 
87  (
88  autoPtr,
90  dictionary,
91  (
93  ),
94  (mixture)
95  );
96 
97 
98  // Constructors
99 
100  //- Construct from dictionary
102  (
103  const word& type,
104  const compressibleTwoPhaseMixture& mixture
105  );
106 
107  //- Disallow default bitwise copy construction
109 
110 
111  // Selectors
112 
113  //- Return a reference to the selected phaseChange model
115  (
116  const compressibleTwoPhaseMixture& mixture
117  );
118 
119 
120  //- Destructor
121  virtual ~twoPhaseChangeModel()
122  {}
123 
124 
125  // Member Functions
126 
127  //- Return the internal field of the density of phase 1
128  const volScalarField::Internal& rho1() const
129  {
130  return mixture_.rho1();
131  }
132 
133  //- Return the internal field of the density of phase 2
134  const volScalarField::Internal& rho2() const
135  {
136  return mixture_.rho2();
137  }
138 
139  //- Return the phase-change explicit and implicit sources
140  // for the phase-fraction equation
142  (
144  ) const = 0;
145 
146  //- Return the phase-change source matrix
147  // for the p_rgh pressure equation
149  (
150  const volScalarField& rho,
151  const volScalarField& gh,
153  ) const = 0;
154 
155  //- Return the phase-change source matrix for the momentum equation
156  virtual tmp<fvVectorMatrix> SU
157  (
158  const volScalarField& rho,
159  const surfaceScalarField& rhoPhi,
161  ) const = 0;
162 
163  //- Correct the phaseChange model
164  virtual void correct() = 0;
165 
166  //- Read the phaseProperties dictionary and update
167  virtual bool read() = 0;
168 
169 
170  // Member Operators
171 
172  //- Disallow default bitwise assignment
173  void operator=(const twoPhaseChangeModel&) = delete;
174 };
175 
176 
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 
179 } // End namespace Foam
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 #endif
184 
185 // ************************************************************************* //
static const word phaseChangePropertiesName
Default phaseChangeProperties dictionary name.
virtual Pair< tmp< volScalarField::Internal > > Salpha(volScalarField &alpha) const =0
Return the phase-change explicit and implicit sources.
volScalarField & p_rgh
TypeName("phaseChangeModel")
Runtime type information.
U
Definition: pEqn.H:72
virtual tmp< fvVectorMatrix > SU(const volScalarField &rho, const surfaceScalarField &rhoPhi, volVectorField &U) const =0
Return the phase-change source matrix for the momentum equation.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
dictionary twoPhaseChangeModelCoeffs_
Model coefficient dictionary.
IOobject(const word &name, const fileName &instance, const objectRegistry &registry, readOption r=NO_READ, writeOption w=NO_WRITE, bool registerObject=true)
Construct from name, instance, registry, io options.
Definition: IOobject.C:167
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
static autoPtr< twoPhaseChangeModel > New(const immiscibleIncompressibleTwoPhaseMixture &mixture)
Return a reference to the selected phaseChange model.
const volScalarField::Internal & rho1() const
Return the internal field of the density of phase 1.
An ordered pair of two objects of type <T> with first() and second() elements.
Definition: contiguous.H:49
virtual ~twoPhaseChangeModel()
Destructor.
A class for handling words, derived from string.
Definition: word.H:59
virtual void correct()=0
Correct the phaseChange model.
const volScalarField & rho2() const
Return the density of phase 2.
virtual bool read()=0
Read the phaseProperties dictionary and update.
declareRunTimeSelectionTable(autoPtr, twoPhaseChangeModel, dictionary,(const immiscibleIncompressibleTwoPhaseMixture &mixture),(mixture))
void operator=(const twoPhaseChangeModel &)=delete
Disallow default bitwise assignment.
virtual tmp< fvScalarMatrix > Sp_rgh(const volScalarField &rho, const volScalarField &gh, volScalarField &p_rgh) const =0
Return the phase-change source matrix.
Forward declarations of fvMatrix specialisations.
twoPhaseChangeModel(const word &type, const immiscibleIncompressibleTwoPhaseMixture &mixture)
Construct from dictionary.
const volScalarField & rho1() const
Return the density of phase 1.
rhoPhi
Definition: rhoEqn.H:10
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const volScalarField & gh
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Thermophysical properties class for a mixture of two rhoThermo including interfaceProperties for VoF ...
A class for managing temporary objects.
Definition: PtrList.H:53
const volScalarField::Internal & rho2() const
Return the internal field of the density of phase 2.
const immiscibleIncompressibleTwoPhaseMixture & mixture_
Reference to the two-phase mixture.
Namespace for OpenFOAM.