constantFluxCarrierTransfer.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) 2025-2026 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::Lagrangian::constantFluxCarrierTransfer
26 
27 Description
28  Model to represent mass transfer into the carrier phase with a constant
29  surface volume or mass flux. This model provides a crude approximation of
30  phase change which neglects any thermal effects. It can be used by clouds
31  and in solvers that do not feature any thermodynamic modelling.
32 
33 Usage
34  Example specification:
35  \verbatim
36  <LagrangianModelName>
37  {
38  type constantFluxCarrierTransfer;
39  volumeFlux 1 [ml/cm^2/s];
40  }
41  \endverbatim
42 
43 SourceFiles
44  constantFluxCarrierTransfer.C
45 
46 \*---------------------------------------------------------------------------*/
47 
48 #ifndef constantFluxCarrierTransfer_H
49 #define constantFluxCarrierTransfer_H
50 
51 #include "cloudLagrangianModel.H"
52 #include "LagrangianSource.H"
53 #include "sharedRegIOobject.H"
54 
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 
57 namespace Foam
58 {
59 namespace Lagrangian
60 {
61 
62 /*---------------------------------------------------------------------------*\
63  Class constantFluxCarrierTransfer Declaration
64 \*---------------------------------------------------------------------------*/
65 
67 :
68  public LagrangianSource,
69  private cloudLagrangianModel
70 {
71  // Private Data
72 
73  //- Volume or mass flux
74  dimensionedScalar flux_;
75 
76  //- Sum of the implicit coefficients of the mass transfer models
78 
79 
80  // Private Member Functions
81 
82  //- Non-virtual read
83  void readCoeffs(const dictionary& modelDict);
84 
85  //- Return the implicit coefficient for the transfer
87 
88  //- Add a source term to the volume or mass equation
89  void addSupType
90  (
91  const LagrangianSubScalarField& deltaT,
92  const LagrangianSubScalarSubField& vOrM,
94  ) const;
95 
96  //- Add a source term to an equation
97  template<class Type>
98  void addSupType
99  (
100  const LagrangianSubScalarField& deltaT,
101  const LagrangianSubSubField<Type>& field,
103  ) const;
104 
105  //- Add a source term to a volume or mass-weighted equation
106  template<class Type>
107  void addSupType
108  (
109  const LagrangianSubScalarField& deltaT,
110  const LagrangianSubScalarSubField& vOrM,
111  const LagrangianSubSubField<Type>& field,
113  ) const;
114 
115 
116 public:
117 
118  //- Runtime type information
119  TypeName("constantFluxCarrierTransfer");
120 
121 
122  // Constructors
123 
124  //- Construct from components
126  (
127  const word& name,
128  const LagrangianMesh& mesh,
129  const dictionary& modelDict,
130  const dictionary& stateDict
131  );
132 
133 
134  // Member Functions
135 
136  //- Return the name of the volume or mass field
137  virtual wordList addSupFields() const;
138 
139  //- Return true if this is a Lagrangian field or a field of the
140  // Eulerian carrier phase
141  virtual bool addsSupToField
142  (
143  const word& fieldName,
144  const word& eqnFieldName
145  ) const;
146 
147  //- Update the transfer rate and remove any consumed particles
148  virtual void calculate
149  (
150  const LagrangianSubScalarField& deltaT,
151  const bool final
152  );
153 
154  //- Return the source value
156  (
157  const word& fieldName,
158  const LagrangianSubMesh& subMesh
159  ) const;
160 
161  //- Hook before source evaluation
162  virtual void preAddSup
163  (
164  const LagrangianSubScalarField& deltaT,
165  const bool final
166  );
167 
168  //- Add a source term to an equation
170 
171  //- Add a source term to a volume or mass-weighted equation
173 
174  //- Hook after source evaluation
175  virtual void postAddSup
176  (
177  const LagrangianSubScalarField& deltaT,
178  const bool final
179  );
180 
181  //- Read dictionary
182  virtual bool read(const dictionary& modelDict);
183 };
184 
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 } // End namespace Lagrangian
189 } // End namespace Foam
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 #endif
194 
195 // ************************************************************************* //
#define DEFINE_LAGRANGIAN_MODEL_ADD_V_OR_M_FIELD_SUP(Type, nullArg)
#define DEFINE_LAGRANGIAN_MODEL_ADD_FIELD_SUP(Type, nullArg)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
This class stores the coefficients of a Lagrangian equation, and facilitates solving that equation an...
Definition: LagrangianEqn.H:56
Class containing Lagrangian geometry and topology.
const LagrangianMesh & mesh() const
The mesh.
static word fieldName(const AlphaRhoFieldType &alphaRhoField, const AlphaRhoFieldTypes &... alphaRhoFields)
Return the name of the field associated with a source term.
const word & name() const
The source name.
Base class for Lagrangian sources. Minimal wrapper over LagrangianModel that provides an interface to...
Mesh that relates to a sub-section of a Lagrangian mesh. This is used to construct fields that relate...
Model to represent mass transfer into the carrier phase with a constant surface volume or mass flux....
virtual wordList addSupFields() const
Return the name of the volume or mass field.
virtual bool addsSupToField(const word &fieldName, const word &eqnFieldName) const
Return true if this is a Lagrangian field or a field of the.
virtual tmp< LagrangianSubScalarField > source(const word &fieldName, const LagrangianSubMesh &subMesh) const
Return the source value.
TypeName("constantFluxCarrierTransfer")
Runtime type information.
virtual bool read(const dictionary &modelDict)
Read dictionary.
virtual void preAddSup(const LagrangianSubScalarField &deltaT, const bool final)
Hook before source evaluation.
virtual void postAddSup(const LagrangianSubScalarField &deltaT, const bool final)
Add a source term to an equation.
virtual void calculate(const LagrangianSubScalarField &deltaT, const bool final)
Update the transfer rate and remove any consumed particles.
constantFluxCarrierTransfer(const word &name, const LagrangianMesh &mesh, const dictionary &modelDict, const dictionary &stateDict)
Construct from components.
Mix-in for Lagrangian models that refer to a cloud.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Container for a pointer to a shared object, who's memory is managed by an object registry....
static dictionary stateDict(const word &name, const objectRegistry &db)
Construct and return the state dictionary for reading.
Definition: stateModel.C:137
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:63
Namespace for OpenFOAM.
FOR_ALL_FIELD_TYPES(makeDimensionedPointFieldFunctions)