coefficientPhaseChange.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-2025 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::coefficientPhaseChange
26 
27 Description
28  This simple model generates a phase change between two phases calculated
29  from the following expression:
30 
31  \f[
32  \dot{m}/V = C \alpha \grad \alpha
33  \f]
34 
35  \vartable
36  \dot{m}/V | mass transfer rate per unit volume
37  C | coefficient
38  \alpha | volume fraction of the source phase
39  \endvartable
40 
41 Usage
42  Example usage:
43  \verbatim
44  coefficientPhaseChange
45  {
46  type coefficientPhaseChange;
47 
48  phases (liquid vapour);
49 
50  C [kg/m^2/s] 0.1;
51  }
52  \endverbatim
53 
54 SourceFiles
55  coefficientPhaseChange.C
56 
57 \*---------------------------------------------------------------------------*/
58 
59 #ifndef coefficientPhaseChange_H
60 #define coefficientPhaseChange_H
61 
62 #include "phaseChange.H"
63 
64 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
65 
66 namespace Foam
67 {
68 namespace fv
69 {
70 
71 /*---------------------------------------------------------------------------*\
72  Class coefficientPhaseChange Declaration
73 \*---------------------------------------------------------------------------*/
74 
75 class coefficientPhaseChange
76 :
77  public phaseChange
78 {
79 private:
80 
81  // Private Data
82 
83  //- Phase change coefficient. Multiplies the estimated interfacial
84  // area density return the phase change rate. Units of [kg/m^2/s].
86 
87  //- The source phase fraction field
88  const volScalarField& alpha1_;
89 
90 
91  // Private Member Functions
92 
93  //- Non-virtual read
94  void readCoeffs(const dictionary& dict);
95 
96  //- Multiply the argument by the mass fraction of transferring species
97  // in the source phase
99  (
101  ) const;
102 
103  //- Return the phase change rate with the source phase and mass
104  // fraction factored out
105  virtual tmp<DimensionedField<scalar, volMesh>> mDotByAlpha1Y1() const;
106 
107 
108 public:
109 
110  //- Runtime type information
111  TypeName("coefficientPhaseChange");
112 
113 
114  // Constructors
115 
116  //- Construct from explicit source name and mesh
118  (
119  const word& name,
120  const word& modelType,
121  const fvMesh& mesh,
123  );
124 
125 
126  // Member Functions
127 
128  // Sources
129 
130  //- Return the total phase change rate
132 
133  //- Return the phase change rate of a specie
135  (
136  const label mDoti
137  ) const;
138 
139  //- Override the compressible continuity equation to add
140  // linearisation w.r.t alpha
141  void addSup
142  (
143  const volScalarField& alpha,
144  const volScalarField& rho,
145  fvMatrix<scalar>& eqn
146  ) const;
147 
148  //- Override the compressible mass fraction equation to add
149  // linearisation w.r.t the mass fraction
150  void addSup
151  (
152  const volScalarField& alpha,
153  const volScalarField& rho,
154  const volScalarField& Yi,
155  fvMatrix<scalar>& eqn
156  ) const;
157 
158 
159  //- Read source dictionary
160  virtual bool read(const dictionary& dict);
161 };
162 
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 } // End namespace fv
167 } // End namespace Foam
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #endif
172 
173 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic GeometricField class.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvMatrix.H:118
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:96
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvModelI.H:69
const word & name() const
Return const access to the source name.
Definition: fvModelI.H:57
virtual tmp< DimensionedField< scalar, volMesh > > mDot() const
Return the total phase change rate.
virtual bool read(const dictionary &dict)
Read source dictionary.
coefficientPhaseChange(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from explicit source name and mesh.
void addSup(const volScalarField &alpha, const volScalarField &rho, fvMatrix< scalar > &eqn) const
Override the compressible continuity equation to add.
TypeName("coefficientPhaseChange")
Runtime type information.
tmp< volScalarField::Internal > rho(const label i) const
Return the density.
Definition: massTransfer.C:92
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
labelList fv(nPoints)
dictionary dict