momentumTransferSystem.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) 2015-2025 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::momentumTransferSystem
26 
27 Description
28  Class which provides interfacial momentum transfer between a number of
29  phases. Drag, virtual mass, lift, wall lubrication and turbulent dispersion
30  are all modelled. Access is provided to a various forces and coefficients
31  needed by the solver.
32 
33 SourceFiles
34  momentumTransferSystem.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef momentumTransferSystem_H
39 #define momentumTransferSystem_H
40 
41 #include "phaseSystem.H"
42 #include "HashPtrTable.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 // Forward declaration of classes
50 class blendedDragModel;
51 class blendedVirtualMassModel;
52 class blendedLiftModel;
53 class blendedWallLubricationModel;
54 class blendedTurbulentDispersionModel;
55 
56 /*---------------------------------------------------------------------------*\
57  Class momentumTransferSystem Declaration
58 \*---------------------------------------------------------------------------*/
59 
61 :
62  public IOdictionary
63 {
64  // Private Type Definitions
65 
66  typedef HashPtrTable
67  <
71  > KdTable;
72 
73  typedef HashPtrTable
74  <
79 
80  typedef HashPtrTable
81  <
86 
87  typedef HashPtrTable
88  <
93 
94  typedef HashPtrTable
95  <
100 
101  typedef HashPtrTable
102  <
107 
108 
109  // Private Data
110 
111  //- Reference to the phase system
112  const phaseSystem& fluid_;
113 
114  //- Cached drag coefficients for dragCorrs
115  mutable KdTable Kds_;
116 
117  //- Drag models
118  const dragModelTable dragModels_;
119 
120  //- Virtual mass models
121  const virtualMassModelTable virtualMassModels_;
122 
123  //- Lift models
124  const liftModelTable liftModels_;
125 
126  //- Wall lubrication models
127  const wallLubricationModelTable wallLubricationModels_;
128 
129  //- Turbulent dispersion models
130  const turbulentDispersionModelTable turbulentDispersionModels_;
131 
132 
133  // Private Member Functions
134 
135  //- Create IO object for an optional constant/momentumTransfer file
136  IOobject io(const phaseSystem&) const;
137 
138  //- Return the models dictionary
139  template<class ModelType>
140  const dictionary& modelsDict() const;
141 
142  //- Add a field to the given result. If the result is not valid then
143  // copy the field in as if the result was initially zero.
144  void addTmpField
145  (
146  tmp<surfaceScalarField>& result,
147  const tmp<surfaceScalarField>& field
148  ) const;
149 
150  //- Invert the ADVs matrix inplace
151  void invADVs(List<UPtrList<scalarField>>& ADVs) const;
152 
153  //- Invert the ADVs matrix inplace
154  template<class GeoMesh>
155  void invADVs
156  (
158  ) const;
159 
160 
161 public:
162 
163  //- Runtime type information
164  TypeName("momentumTransferSystem");
165 
166 
167  //- Default name of the phase properties dictionary
168  static const word propertiesName;
169 
170 
171  // Constructors
172 
173  //- Construct from a phase system
175 
176 
177  //- Destructor
178  virtual ~momentumTransferSystem();
179 
180 
181  // Member Functions
182 
183  //- Return the explicit force fluxes for the cell-based algorithm, that
184  // do not depend on phase mass/volume fluxes, and can therefore be
185  // evaluated outside the corrector loop. This includes things like
186  // lift, turbulent dispersion, and wall lubrication.
188 
189  //- As Fs, but for the face-based algorithm
191 
192  //- Return the inverse of the central + drag + virtual mass
193  // coefficient matrix
194  void invADVs
195  (
196  const PtrList<volScalarField>& As,
200  ) const;
201 
202  //- Return the inverse of the central + drag + virtual mass
203  // coefficient matrix
205  (
206  const PtrList<surfaceScalarField>& Afs,
208  ) const;
209 
210  //- Return the phase diffusivity
211  // divided by the momentum central coefficient
213  (
214  const PtrList<volScalarField>& rAs
215  ) const;
216 
217  //- Return the flux corrections for the cell-based algorithm. These
218  // depend on phase mass/volume fluxes, and must therefore be evaluated
219  // inside the corrector loop.
221 
222  //- Set the cell and faces drag correction fields
223  void dragCorrs
224  (
226  PtrList<surfaceScalarField>& dragCorrf
227  ) const;
228 
229  //- Read base phaseProperties dictionary
230  virtual bool read();
231 };
232 
233 
234 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235 
236 } // End namespace Foam
237 
238 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
239 
240 #endif
241 
242 // ************************************************************************* //
Generic GeometricField class.
A HashTable specialisation for hashing pointers.
Definition: HashPtrTable.H:67
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:57
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:99
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:91
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: PtrList.H:75
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: UPtrList.H:66
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Class which provides interfacial momentum transfer between a number of phases. Drag,...
static const word propertiesName
Default name of the phase properties dictionary.
void dragCorrs(PtrList< volVectorField > &dragCorrs, PtrList< surfaceScalarField > &dragCorrf) const
Set the cell and faces drag correction fields.
PtrList< surfaceScalarField > ddtCorrs() const
Return the flux corrections for the cell-based algorithm. These.
momentumTransferSystem(const phaseSystem &)
Construct from a phase system.
TypeName("momentumTransferSystem")
Runtime type information.
PtrList< surfaceScalarField > Ffs() const
As Fs, but for the face-based algorithm.
PtrList< surfaceScalarField > Fs() const
Return the explicit force fluxes for the cell-based algorithm, that.
virtual ~momentumTransferSystem()
Destructor.
PtrList< PtrList< surfaceScalarField > > invADVfs(const PtrList< surfaceScalarField > &Afs, PtrList< surfaceScalarField > &HVmfs) const
Return the inverse of the central + drag + virtual mass.
virtual tmp< surfaceScalarField > alphaDByAf(const PtrList< volScalarField > &rAs) const
Return the phase diffusivity.
virtual bool read()
Read base phaseProperties dictionary.
Word-pair based class used for keying interface models in hash tables.
Class to represent a system of phases.
Definition: phaseSystem.H:74
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
VolField< scalar > volScalarField
Definition: volFieldsFwd.H:62