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-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::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 
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 singleComponentPhaseChange
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 
88  // Private Member Functions
89 
90  //- Non-virtual read
91  void readCoeffs();
92 
93 
94 public:
95 
96  //- Runtime type information
97  TypeName("coefficientPhaseChange");
98 
99 
100  // Constructors
101 
102  //- Construct from explicit source name and mesh
104  (
105  const word& name,
106  const word& modelType,
107  const fvMesh& mesh,
109  );
110 
111 
112  // Member Functions
113 
114  // Sources
115 
116  //- Return the phase change rate
118 
119  //- Override the compressible continuity equation to add
120  // linearisation w.r.t alpha
121  void addSup
122  (
123  const volScalarField& alpha,
124  const volScalarField& rho,
125  fvMatrix<scalar>& eqn
126  ) const;
127 
128  //- Override the compressible mass fraction equation to add
129  // linearisation w.r.t the mass fraction
130  void addSup
131  (
132  const volScalarField& alpha,
133  const volScalarField& rho,
134  const volScalarField& Yi,
135  fvMatrix<scalar>& eqn
136  ) const;
137 
138 
139  //- Read source dictionary
140  virtual bool read(const dictionary& dict);
141 };
142 
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 } // End namespace fv
147 } // End namespace Foam
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 #endif
152 
153 // ************************************************************************* //
Generic GeometricField class.
A list of keyword definitions, which are a keyword followed by any number of values (e....
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: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
virtual tmp< DimensionedField< scalar, volMesh > > mDot() const
Return the 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:85
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.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
labelList fv(nPoints)
dictionary dict