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 energyFromCloud_;
79 
80  //- Switch to ensure the ejection rate is not updated until
81  // the last set of ejected parcels have been included in the cloud
82  bool correctEjection_;
83 
84  //- Pointer to the ejection model
85  autoPtr<ejectionModel> ejection_;
86 
87 
88  // Private Member Functions
89 
90  //- Cloud to film rate transfer function
91  template<class Type>
93  inline CloudToFilmTransferRate
94  (
95  const Field<Type>& prop,
96  const dimensionSet& dimProp
97  ) const;
98 
99  //- Film to cloud transfer function
100  template<class Type>
102  inline filmToCloudTransfer
103  (
104  const VolInternalField<Type>& prop
105  ) const;
106 
107 
108 public:
109 
110  //- Runtime type information
111  TypeName("filmCloudTransfer");
112 
113 
114  // Constructors
115 
116  //- Construct from explicit source name and mesh
118  (
119  const word& sourceName,
120  const word& modelType,
121  const fvMesh& mesh,
122  const dictionary& dict
123  );
124 
125  //- Disallow default bitwise copy construction
127  (
128  const filmCloudTransfer&
129  ) = delete;
130 
131 
132  // Member Functions
133 
134  // Checks
135 
136  //- Return the list of fields for which the option adds source term
137  // to the transport equation
138  virtual wordList addSupFields() const;
139 
140 
141  // Correct
142 
143  //- Solve the film and update the sources
144  virtual void correct();
145 
146 
147  // Sources
148 
149  //- Add source to phase continuity equation
150  virtual void addSup
151  (
152  const volScalarField& rho,
153  const volScalarField& alpha,
154  fvMatrix<scalar>& eqn
155  ) const;
156 
157  //- Add source to phase energy equation
158  virtual void addSup
159  (
160  const volScalarField& alpha,
161  const volScalarField& rho,
162  const volScalarField& he,
163  fvMatrix<scalar>& eqn
164  ) const;
165 
166  //- Add source to mixture momentum equation
167  virtual void addSup
168  (
169  const volScalarField& alpha,
170  const volScalarField& rho,
171  const volVectorField& U,
172  fvMatrix<vector>& eqn
173  ) const;
174 
175 
176  // Transfer from cloud
177 
178  //- Reset the fields accumulated cloud transfer fields
179  void resetFromCloudFields();
180 
181  //- Transfer parcel properties from cloud to the film
182  // accumulated fields
183  void parcelFromCloud
184  (
185  const label facei,
186  const scalar mass,
187  const vector& momentum,
188  const scalar energy
189  );
190 
191 
192  // Transfer to cloud
193 
194  //- Return true if the film is ejecting to the cloud
195  bool ejecting() const;
196 
197  //- Transfer the ejected mass to the cloud
199 
200  //- Transfer the ejected droplet diameter to the cloud
202 
203  //- Transfer the film delta field to the cloud
205 
206  //- Transfer the film velocity field to the cloud
207  tmp<Field<vector>> UToCloud() const;
208 
209  //- Transfer the film density field to the cloud
210  tmp<Field<scalar>> rhoToCloud() const;
211 
212  //- Transfer the film temperature field to the cloud
213  tmp<Field<scalar>> TToCloud() const;
214 
215  //- Transfer the film heat capacity field to the cloud
216  tmp<Field<scalar>> CpToCloud() const;
217 
218 
219  // Mesh changes
220 
221  //- Update topology using the given map
222  virtual void topoChange(const polyTopoChangeMap&);
223 
224  //- Update from another mesh using the given map
225  virtual void mapMesh(const polyMeshMap&);
226 
227  //- Redistribute or update using the given distribution map
228  virtual void distribute(const polyDistributionMap&);
229 
230  //- Update for mesh motion
231  virtual bool movePoints();
232 
233 
234  // Member Operators
235 
236  //- Disallow default bitwise assignment
237  void operator=(const filmCloudTransfer&) = delete;
238 };
239 
240 
241 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
242 
243 } // End namespace fv
244 } // End namespace Foam
245 
246 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
247 
248 #endif
249 
250 // ************************************************************************* //
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:162
Dimension set for the base types.
Definition: dimensionSet.H:125
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
Finite volume model abstract base class.
Definition: fvModel.H:59
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvModelI.H:53
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.
virtual void addSup(const volScalarField &rho, const volScalarField &alpha, fvMatrix< scalar > &eqn) const
Add source to phase continuity equation.
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 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.
void parcelFromCloud(const label facei, const scalar mass, const vector &momentum, const scalar energy)
Transfer parcel properties from cloud to the film.
tmp< Field< scalar > > ejectedMassToCloud() const
Transfer the ejected mass to the cloud.
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
U
Definition: pEqn.H:72
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:61
thermo he()
labelList fv(nPoints)
dictionary dict