MomentumTransferPhaseSystem.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-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::MomentumTransferPhaseSystem
26 
27 Description
28  Class which models interfacial momentum transfer between a number of phases.
29  Drag, virtual mass, lift, wall lubrication and turbulent dispersion are all
30  modelled. The explicit contribution from the drag is omitted from the
31  transfer matrices, as this forms part of the solution of the pressure
32  equation.
33 
34 SourceFiles
35  MomentumTransferPhaseSystem.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef MomentumTransferPhaseSystem_H
40 #define MomentumTransferPhaseSystem_H
41 
42 #include "phaseSystem.H"
43 #include "HashPtrTable.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 class blendingMethod;
51 class blendedDragModel;
52 class blendedVirtualMassModel;
53 class blendedLiftModel;
54 class blendedWallLubricationModel;
55 class blendedTurbulentDispersionModel;
56 
57 /*---------------------------------------------------------------------------*\
58  Class MomentumTransferPhaseSystem Declaration
59 \*---------------------------------------------------------------------------*/
60 
61 template<class BasePhaseSystem>
63 :
64  public BasePhaseSystem
65 {
66  // Private typedefs
67 
68  typedef HashPtrTable
69  <
73  > KdTable;
74 
75  typedef HashTable
76  <
81 
82  typedef HashTable
83  <
88 
89  typedef HashTable
90  <
95 
96  typedef HashTable
97  <
102 
103  typedef HashTable
104  <
109 
110 
111  // Private Data
112 
113  //- Cached drag coefficients for dragCorrs
114  mutable KdTable Kds_;
115 
116 
117  // Sub Models
118 
119  //- Drag models
120  dragModelTable dragModels_;
121 
122  //- Virtual mass models
123  virtualMassModelTable virtualMassModels_;
124 
125  //- Lift models
126  liftModelTable liftModels_;
127 
128  //- Wall lubrication models
129  wallLubricationModelTable wallLubricationModels_;
130 
131  //- Turbulent dispersion models
132  turbulentDispersionModelTable turbulentDispersionModels_;
133 
134 
135 protected:
136 
137  // Protected Member Functions
138 
139  //- Add momentum transfer terms which result from bulk mass transfers
140  void addDmdtUfs
141  (
142  const phaseSystem::dmdtfTable& dmdtfs,
144  );
145 
146  void addTmpField
147  (
148  tmp<surfaceScalarField>& result,
149  const tmp<surfaceScalarField>& field
150  ) const;
151 
152  //- Invert the ADVs matrix inplace
153  void invADVs(List<UPtrList<scalarField>>& ADVs) const;
154 
155  //- Invert the ADVs matrix inplace
156  template<template<class> class PatchField, class GeoMesh>
157  void invADVs
158  (
160  ) const;
161 
162 
163 public:
164 
165  // Constructors
166 
167  //- Construct from fvMesh
169 
170 
171  //- Destructor
173 
174 
175  // Member Functions
176 
177  //- Return the momentum transfer matrices for the cell-based algorithm.
178  // This includes implicit and explicit forces that add into the cell
179  // UEqn in the normal way.
181 
182  //- As momentumTransfer, but for the face-based algorithm
184 
185  //- Return the explicit force fluxes for the cell-based algorithm, that
186  // do not depend on phase mass/volume fluxes, and can therefore be
187  // evaluated outside the corrector loop. This includes things like
188  // lift, turbulent dispersion, and wall lubrication.
189  virtual PtrList<surfaceScalarField> Fs() const;
190 
191  //- As Fs, but for the face-based algorithm
192  virtual PtrList<surfaceScalarField> Ffs() const;
193 
194  //- Return the inverse of the central + drag + virtual mass
195  // coefficient matrix
196  virtual void invADVs
197  (
198  const PtrList<volScalarField>& As,
202  ) const;
203 
204  //- Return the inverse of the central + drag + virtual mass
205  // coefficient matrix
207  (
208  const PtrList<surfaceScalarField>& Afs,
210  ) const;
211 
212  //- Returns true if the phase pressure is treated implicitly
213  // in the phase fraction equation
214  virtual bool implicitPhasePressure(const phaseModel& phase) const;
215 
216  //- Returns true if the phase pressure is treated implicitly
217  // in the phase fraction equation for any phase
218  virtual bool implicitPhasePressure() const;
219 
220  //- Return the phase diffusivity
221  // divided by the momentum central coefficient
223  (
224  const PtrList<volScalarField>& rAs
225  ) const;
226 
227  //- Return the flux corrections for the cell-based algorithm. These
228  // depend on phase mass/volume fluxes, and must therefore be evaluated
229  // inside the corrector loop.
230  virtual PtrList<surfaceScalarField> ddtCorrs() const;
231 
232  //- Set the cell and faces drag correction fields
233  virtual void dragCorrs
234  (
236  PtrList<surfaceScalarField>& dragCorrf
237  ) const;
238 
239  //- Read base phaseProperties dictionary
240  virtual bool read();
241 };
242 
243 
244 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
245 
246 } // End namespace Foam
247 
248 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
249 
250 #ifdef NoRepository
252 #endif
253 
254 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
255 
256 #endif
257 
258 // ************************************************************************* //
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
Definition: GeoMesh.H:47
Generic GeometricField class.
A HashTable specialisation for hashing pointers.
Definition: HashPtrTable.H:67
An STL-conforming hash table.
Definition: HashTable.H:127
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
Class which models interfacial momentum transfer between a number of phases. Drag,...
void invADVs(List< UPtrList< scalarField >> &ADVs) const
Invert the ADVs matrix inplace.
virtual void dragCorrs(PtrList< volVectorField > &dragCorrs, PtrList< surfaceScalarField > &dragCorrf) const
Set the cell and faces drag correction fields.
virtual PtrList< surfaceScalarField > ddtCorrs() const
Return the flux corrections for the cell-based algorithm. These.
virtual autoPtr< phaseSystem::momentumTransferTable > momentumTransfer()
Return the momentum transfer matrices for the cell-based algorithm.
void addDmdtUfs(const phaseSystem::dmdtfTable &dmdtfs, phaseSystem::momentumTransferTable &eqns)
Add momentum transfer terms which result from bulk mass transfers.
virtual PtrList< surfaceScalarField > Ffs() const
As Fs, but for the face-based algorithm.
virtual bool implicitPhasePressure() const
Returns true if the phase pressure is treated implicitly.
virtual PtrList< surfaceScalarField > Fs() const
Return the explicit force fluxes for the cell-based algorithm, that.
MomentumTransferPhaseSystem(const fvMesh &)
Construct from fvMesh.
virtual autoPtr< phaseSystem::momentumTransferTable > momentumTransferf()
As momentumTransfer, but for the face-based algorithm.
virtual 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.
void addTmpField(tmp< surfaceScalarField > &result, const tmp< surfaceScalarField > &field) const
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
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:99
Word-pair based class used for keying interface models in hash tables.
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.
VolField< scalar > volScalarField
Definition: volFieldsFwd.H:64