multicomponentPhaseChange.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::multicomponentPhaseChange
26 
27 Description
28  Base class for phase change models in which multiple components may change
29  phase. This can only be applied between multicomponent phases.
30 
31 SourceFiles
32  multicomponentPhaseChange.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef multicomponentPhaseChange_H
37 #define multicomponentPhaseChange_H
38 
39 #include "phaseChange.H"
40 #include "hashedWordList.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 namespace fv
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class multicomponentPhaseChange Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 :
55  public phaseChange
56 {
57 private:
58 
59  // Private Data
60 
61  //- The names of the changing species
62  const hashedWordList species_;
63 
64  //- Whether or not to linearise the energy source
65  bool energySemiImplicit_;
66 
67 
68  // Private Member Functions
69 
70  //- Non-virtual read
71  void readCoeffs();
72 
73 
74 public:
75 
76  //- Runtime type information
77  TypeName("multicomponentPhaseChange");
78 
79 
80  // Constructors
81 
82  //- Construct from explicit source name and mesh
84  (
85  const word& name,
86  const word& modelType,
87  const fvMesh& mesh,
88  const dictionary& dict,
89  const Pair<bool>& fluidThermosRequired
90  );
91 
92 
93  // Member Functions
94 
95  // Access
96 
97  //- Return the names of the changing species
98  inline const hashedWordList& species() const;
99 
100 
101  // Sources
102 
103  //- Return the mass transfer rates of each specie
105  (
106  const label mDoti
107  ) const = 0;
108 
109  //- Return the total mass transfer rate
111 
112  //- Override the energy equation to add the phase change heat, or
113  // the species equations to add the relevant mass sources
114  void addSup
115  (
116  const volScalarField& alpha,
117  const volScalarField& rho,
118  const volScalarField& heOrYi,
119  fvMatrix<scalar>& eqn
120  ) const;
121 
122 
123  //- Read source dictionary
124  virtual bool read(const dictionary& dict);
125 };
126 
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 } // End namespace fv
131 } // End namespace Foam
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 #endif
140 
141 // ************************************************************************* //
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
tmp< volScalarField::Internal > rho(const label i) const
Return the density.
Definition: massTransfer.C:85
Base class for phase change models in which multiple components may change phase. This can only be ap...
multicomponentPhaseChange(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict, const Pair< bool > &fluidThermosRequired)
Construct from explicit source name and mesh.
TypeName("multicomponentPhaseChange")
Runtime type information.
virtual tmp< DimensionedField< scalar, volMesh > > mDot() const
Return the total mass transfer rate.
virtual bool read(const dictionary &dict)
Read source dictionary.
void addSup(const volScalarField &alpha, const volScalarField &rho, const volScalarField &heOrYi, fvMatrix< scalar > &eqn) const
Override the energy equation to add the phase change heat, or.
const hashedWordList & species() const
Return the names of the changing species.
Base class for phase change models.
Definition: phaseChange.H:59
A wordList with hashed indices for faster lookup by name.
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
labelList fv(nPoints)
dictionary dict