coefficientMassTransfer.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::coefficientMassTransfer
26 
27 Description
28  This simple model generates a mass transfer 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  coefficientMassTransfer
45  {
46  type coefficientMassTransfer;
47 
48  phases (liquid vapour);
49 
50  C [kg/m^2/s] 0.1;
51  }
52  \endverbatim
53 
54 SourceFiles
55  coefficientMassTransfer.C
56 
57 \*---------------------------------------------------------------------------*/
58 
59 #ifndef coefficientMassTransfer_H
60 #define coefficientMassTransfer_H
61 
62 #include "massTransfer.H"
63 #include "Function1.H"
64 
65 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
66 
67 namespace Foam
68 {
69 namespace fv
70 {
71 
72 /*---------------------------------------------------------------------------*\
73  Class coefficientMassTransfer Declaration
74 \*---------------------------------------------------------------------------*/
75 
76 class coefficientMassTransfer
77 :
78  public massTransfer
79 {
80 private:
81 
82  // Private Data
83 
84  //- Mass flow rate coefficient. Multiplies the estimated interfacial
85  // area density return the mass transfer rate. Units of [kg/m^2/s].
87 
88 
89  // Private Member Functions
90 
91  //- Non-virtual read
92  void readCoeffs();
93 
94 
95 public:
96 
97  //- Runtime type information
98  TypeName("coefficientMassTransfer");
99 
100 
101  // Constructors
102 
103  //- Construct from explicit source name and mesh
105  (
106  const word& name,
107  const word& modelType,
108  const fvMesh& mesh,
110  );
111 
112 
113  // Member Functions
114 
115  // Sources
116 
117  //- Return the mass transfer rate
119 
120  //- Override the incompressible continuity equation to add
121  // linearisation w.r.t alpha
122  void addSup
123  (
124  const volScalarField& alpha,
125  fvMatrix<scalar>& eqn
126  ) const;
127 
128  //- Override the compressible continuity equation to add
129  // linearisation w.r.t alpha
130  void addSup
131  (
132  const volScalarField& alpha,
133  const volScalarField& rho,
134  fvMatrix<scalar>& eqn
135  ) const;
136 
137 
138  //- Read source dictionary
139  virtual bool read(const dictionary& dict);
140 };
141 
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 } // End namespace fv
146 } // End namespace Foam
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 #endif
151 
152 // ************************************************************************* //
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 mass transfer rate.
virtual bool read(const dictionary &dict)
Read source dictionary.
coefficientMassTransfer(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from explicit source name and mesh.
void addSup(const volScalarField &alpha, fvMatrix< scalar > &eqn) const
Override the incompressible continuity equation to add.
TypeName("coefficientMassTransfer")
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