filmCloudTransfer.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) 2023 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::filmCloudTransfer
26 
27 Description
28  Film<->cloud transfer model
29 
30 Usage
31  Example usage:
32  \verbatim
33  filmCloudTransfer
34  {
35  type filmCloudTransfer;
36  }
37  \endverbatim
38 
39 SourceFiles
40  filmCloudTransfer.C
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef filmCloudTransfer_H
45 #define filmCloudTransfer_H
46 
47 #include "fvModel.H"
48 #include "isothermalFilm.H"
49 #include "ejectionModel.H"
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 namespace fv
56 {
57 
58 /*---------------------------------------------------------------------------*\
59  Class filmCloudTransfer Declaration
60 \*---------------------------------------------------------------------------*/
61 
63 :
64  public fvModel
65 {
66  // Private Data
67 
68  //- The film model
69  const solvers::isothermalFilm& film_;
70 
71  // Transfers from cloud
72 
73  //- Switch to indicate the cloud fields have been transferred
74  bool cloudFieldsTransferred_;
75 
76  scalarField massFromCloud_;
77  vectorField momentumFromCloud_;
78  scalarField pressureFromCloud_;
79  scalarField energyFromCloud_;
80 
81  //- Switch to ensure the ejection rate is not updated until
82  // the last set of ejected parcels have been included in the cloud
83  bool correctEjection_;
84 
85  //- Pointer to the ejection model
86  autoPtr<ejectionModel> ejection_;
87 
88 
89  // Private Member Functions
90 
91  //- Cloud to film rate transfer function
92  template<class Type>
94  inline CloudToFilmTransferRate
95  (
96  const Field<Type>& prop,
97  const dimensionSet& dimProp
98  ) const;
99 
100  //- Film to cloud transfer function
101  template<class Type>
103  inline filmToCloudTransfer
104  (
105  const VolInternalField<Type>& prop
106  ) const;
107 
108 
109 public:
110 
111  //- Runtime type information
112  TypeName("filmCloudTransfer");
113 
114 
115  // Constructors
116 
117  //- Construct from explicit source name and mesh
119  (
120  const word& sourceName,
121  const word& modelType,
122  const fvMesh& mesh,
123  const dictionary& dict
124  );
125 
126  //- Disallow default bitwise copy construction
128  (
129  const filmCloudTransfer&
130  ) = delete;
131 
132 
133  // Member Functions
134 
135  // Checks
136 
137  //- Return the list of fields for which the option adds source term
138  // to the transport equation
139  virtual wordList addSupFields() const;
140 
141 
142  // Correct
143 
144  //- Solve the film and update the sources
145  virtual void correct();
146 
147 
148  // Add explicit and implicit contributions to compressible equation
149 
150  //- Add explicit droplet impingement contribution to pressure field
151  virtual void addSup
152  (
153  fvMatrix<scalar>& eqn,
154  const word& fieldName
155  ) const;
156 
157  //- Add explicit contribution to phase continuity
158  virtual void addSup
159  (
160  const volScalarField& alpha,
161  fvMatrix<scalar>& eqn,
162  const word& fieldName
163  ) const;
164 
165  //- Add explicit contribution to phase energy equation
166  virtual void addSup
167  (
168  const volScalarField& alpha,
169  const volScalarField& rho,
170  fvMatrix<scalar>& eqn,
171  const word& fieldName
172  ) const;
173 
174  //- Add implicit contribution to mixture momentum equation
175  virtual void addSup
176  (
177  const volScalarField& alpha,
178  const volScalarField& rho,
179  fvMatrix<vector>& eqn,
180  const word& fieldName
181  ) const;
182 
183 
184  // Transfer from cloud
185 
186  //- Reset the fields accumulated cloud transfer fields
187  void resetFromCloudFields();
188 
189  //- Transfer parcel properties from cloud to the film
190  // accumulated fields
191  void parcelFromCloud
192  (
193  const label facei,
194  const scalar mass,
195  const vector& momentum,
196  const scalar pressure,
197  const scalar energy
198  );
199 
200 
201  // Transfer to cloud
202 
203  //- Return true if the film is ejecting to the cloud
204  bool ejecting() const;
205 
206  //- Transfer the ejected mass to the cloud
208 
209  //- Transfer the ejected droplet diameter to the cloud
211 
212  //- Transfer the film delta field to the cloud
214 
215  //- Transfer the film velocity field to the cloud
216  tmp<Field<vector>> UToCloud() const;
217 
218  //- Transfer the film density field to the cloud
219  tmp<Field<scalar>> rhoToCloud() const;
220 
221  //- Transfer the film temperature field to the cloud
222  tmp<Field<scalar>> TToCloud() const;
223 
224  //- Transfer the film heat capacity field to the cloud
225  tmp<Field<scalar>> CpToCloud() const;
226 
227 
228  // Mesh changes
229 
230  //- Update topology using the given map
231  virtual void topoChange(const polyTopoChangeMap&);
232 
233  //- Update from another mesh using the given map
234  virtual void mapMesh(const polyMeshMap&);
235 
236  //- Redistribute or update using the given distribution map
237  virtual void distribute(const polyDistributionMap&);
238 
239  //- Update for mesh motion
240  virtual bool movePoints();
241 
242 
243  // Member Operators
244 
245  //- Disallow default bitwise assignment
246  void operator=(const filmCloudTransfer&) = delete;
247 };
248 
249 
250 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
251 
252 } // End namespace fv
253 } // End namespace Foam
254 
255 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
256 
257 #endif
258 
259 // ************************************************************************* //
Generic GeometricField class.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Dimension set for the base types.
Definition: dimensionSet.H:122
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:101
Finite volume model abstract base class.
Definition: fvModel.H:59
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvModelI.H:34
Film<->cloud transfer model.
void operator=(const filmCloudTransfer &)=delete
Disallow default bitwise assignment.
virtual bool movePoints()
Update for mesh motion.
virtual wordList addSupFields() const
Return the list of fields for which the option adds source term.
tmp< Field< scalar > > deltaToCloud() const
Transfer the film delta field to the cloud.
void resetFromCloudFields()
Reset the fields accumulated cloud transfer fields.
tmp< Field< scalar > > TToCloud() const
Transfer the film temperature field to the cloud.
virtual void correct()
Solve the film and update the sources.
tmp< Field< scalar > > CpToCloud() const
Transfer the film heat capacity field to the cloud.
TypeName("filmCloudTransfer")
Runtime type information.
tmp< Field< scalar > > ejectedDiameterToCloud() const
Transfer the ejected droplet diameter to the cloud.
virtual void addSup(fvMatrix< scalar > &eqn, const word &fieldName) const
Add explicit droplet impingement contribution to pressure field.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
tmp< Field< vector > > UToCloud() const
Transfer the film velocity field to the cloud.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
filmCloudTransfer(const word &sourceName, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from explicit source name and mesh.
tmp< Field< scalar > > ejectedMassToCloud() const
Transfer the ejected mass to the cloud.
void parcelFromCloud(const label facei, const scalar mass, const vector &momentum, const scalar pressure, const scalar energy)
Transfer parcel properties from cloud to the film.
bool ejecting() const
Return true if the film is ejecting to the cloud.
tmp< Field< scalar > > rhoToCloud() const
Transfer the film density field to the cloud.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:51
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Solver module for flow of compressible isothermal liquid films.
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
typename VolField< Type >::Internal VolInternalField
Definition: volFieldsFwd.H:58
labelList fv(nPoints)
dictionary dict