phaseChange.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-2024 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::fv::phaseChange
26 
27 Description
28  Base class for phase change models
29 
30 SourceFiles
31  phaseChange.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef phaseChange_H
36 #define phaseChange_H
37 
38 #include "massTransfer.H"
39 #include "ThermoRefPair.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 class basicThermo;
47 class fluidThermo;
48 class multicomponentThermo;
49 
50 namespace fv
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class phaseChange Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 class phaseChange
58 :
59  public massTransfer
60 {
61 private:
62 
63  // Private Data
64 
65  //- The thermo references
66  const ThermoRefPair<basicThermo> thermos_;
67 
68  //- The fluid thermo references
69  const ThermoRefPair<fluidThermo> fluidThermos_;
70 
71  //- The specie thermo references
72  const ThermoRefPair<multicomponentThermo> specieThermos_;
73 
74  //- Names of the energy fields
75  const Pair<word> heNames_;
76 
77 
78 protected:
79 
80  // Protected Member Functions
81 
82  //- Access the pressure field
83  const volScalarField& p() const;
84 
85  //- Add a boundary field to the given internal field
87  (
89  );
90 
91  //- Remove the boundary field from the given geometric field
93  (
94  const tmp<volScalarField>& tvf
95  );
96 
97 
98 public:
99 
100  //- Runtime type information
101  TypeName("phaseChange");
102 
103 
104  // Constructors
105 
106  //- Construct from explicit source name and mesh
108  (
109  const word& name,
110  const word& modelType,
111  const fvMesh& mesh,
112  const dictionary& dict,
113  const Pair<bool>& fluidThermosRequired,
114  const Pair<bool>& specieThermosRequired
115  );
116 
117 
118  // Member Functions
119 
120  // Access
121 
122  //- Return the thermo references
123  inline const ThermoRefPair<basicThermo>& thermos() const;
124 
125  //- Return the fluid thermo references
126  inline const ThermoRefPair<fluidThermo>& fluidThermos() const;
127 
128  //- Return the specie thermo references
130  specieThermos() const;
131 
132  //- Return the names of the energy fields
133  inline const Pair<word>& heNames() const;
134 
135 
136  // Evaluation
137 
138  //- Return the temperature at which the phases are considered to be
139  // changing. By default this is considered to be the temperature
140  // of the "source" phase (i.e., the phase for which mDot is
141  // negative), but this can be overridden to account for heat
142  // transfer modelling or similar.
144 
145  //- Return the fraction of the latent heat that is transferred into
146  // the second phase. By default this is weighted by the phase
147  // thermal conductivities, but this can be overridden to account
148  // for heat transfer modelling or similar.
150 };
151 
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 } // End namespace fv
156 } // End namespace Foam
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 #include "phaseChangeI.H"
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 #endif
165 
166 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic GeometricField class.
Class containing a pair of thermo references. Handles down-casting to more specific thermo types by c...
Definition: ThermoRefPair.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:99
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvModelI.H:53
const word & name() const
Return const access to the source name.
Definition: fvModelI.H:47
Base class for mass transfers between phases.
Definition: massTransfer.H:55
Base class for phase change models.
Definition: phaseChange.H:59
phaseChange(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict, const Pair< bool > &fluidThermosRequired, const Pair< bool > &specieThermosRequired)
Construct from explicit source name and mesh.
Definition: phaseChange.C:97
virtual tmp< DimensionedField< scalar, volMesh > > Lfraction() const
Return the fraction of the latent heat that is transferred into.
Definition: phaseChange.C:148
static tmp< DimensionedField< scalar, volMesh > > vfToVif(const tmp< volScalarField > &tvf)
Remove the boundary field from the given geometric field.
Definition: phaseChange.C:82
TypeName("phaseChange")
Runtime type information.
const ThermoRefPair< multicomponentThermo > & specieThermos() const
Return the specie thermo references.
Definition: phaseChangeI.H:45
const volScalarField & p() const
Access the pressure field.
Definition: phaseChange.C:44
virtual tmp< DimensionedField< scalar, volMesh > > Tchange() const
Return the temperature at which the phases are considered to be.
Definition: phaseChange.C:139
const ThermoRefPair< basicThermo > & thermos() const
Return the thermo references.
Definition: phaseChangeI.H:31
const Pair< word > & heNames() const
Return the names of the energy fields.
Definition: phaseChangeI.H:51
static tmp< volScalarField > vifToVf(const tmp< DimensionedField< scalar, volMesh >> &tvif)
Add a boundary field to the given internal field.
Definition: phaseChange.C:59
const ThermoRefPair< fluidThermo > & fluidThermos() const
Return the fluid thermo references.
Definition: phaseChangeI.H:38
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
labelList fv(nPoints)
dictionary dict