MomentumTransferPhaseSystem.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2015-2018 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::MomentumTransferPhaseSystem
28 
29 Description
30  Class which models interfacial momenum transfer between a number of phases.
31  Drag, virtual mass, lift, wall lubrication and turbulent dispersion are all
32  modelled. The explicit contribution from the drag is omitted from the
33  transfer matrices, as this forms part of the solution of the pressure
34  equation.
35 
36 SourceFiles
37  MomentumTransferPhaseSystem.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef MomentumTransferPhaseSystem_H
42 #define MomentumTransferPhaseSystem_H
43 
44 #include "phaseSystem.H"
45 #include "HashPtrTable.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 template<class modelType>
53 class BlendedInterfacialModel;
54 
55 class blendingMethod;
56 class dragModel;
57 class virtualMassModel;
58 class liftModel;
59 class wallLubricationModel;
60 class turbulentDispersionModel;
61 
62 /*---------------------------------------------------------------------------*\
63  Class MomentumTransferPhaseSystem Declaration
64 \*---------------------------------------------------------------------------*/
65 
66 template<class BasePhaseSystem>
68 :
69  public BasePhaseSystem
70 {
71 protected:
72 
73  // Protected typedefs
74 
75  typedef HashPtrTable
76  <
80  > KdTable;
81 
82  typedef HashPtrTable
83  <
87  > KdfTable;
88 
89  typedef HashPtrTable
90  <
94  > VmTable;
95 
96  typedef HashPtrTable
97  <
101  > VmfTable;
102 
103  typedef HashTable
104  <
106  phasePairKey,
108  > dragModelTable;
109 
110  typedef HashTable
111  <
113  phasePairKey,
116 
117  typedef HashTable
118  <
120  phasePairKey,
122  > liftModelTable;
123 
124  typedef HashTable
125  <
127  phasePairKey,
130 
131  typedef HashTable
132  <
134  phasePairKey,
137 
138 
139 private:
140 
141  // Private data
142 
143  //- Drag coefficients
144  KdTable Kds_;
145 
146  //- Face drag coefficients
147  KdfTable Kdfs_;
148 
149  //- Virtual mass coefficients
150  VmTable Vms_;
151 
152  //- Face virtual mass coefficients
153  VmfTable Vmfs_;
154 
155  //- The phase diffusivities divided by the momentum coefficients
157 
158  // Sub Models
159 
160  //- Drag models
161  dragModelTable dragModels_;
162 
163  //- Virtual mass models
164  virtualMassModelTable virtualMassModels_;
165 
166  //- Lift models
167  liftModelTable liftModels_;
168 
169  //- Wall lubrication models
170  wallLubricationModelTable wallLubricationModels_;
171 
172  //- Turbulent dispersion models
173  turbulentDispersionModelTable turbulentDispersionModels_;
174 
175 
176  // Private member functions
177 
178  //- Return the drag coefficient for the phase pair
179  virtual tmp<volScalarField> Kd(const phasePairKey& key) const;
180 
181  //- Return the face drag coefficient for the phase pair
182  virtual tmp<surfaceScalarField> Kdf(const phasePairKey& key) const;
183 
184  //- Return the virtual mass coefficient for the phase pair
185  virtual tmp<volScalarField> Vm(const phasePairKey& key) const;
186 
187  //- Add the mass-transfer-based momentum transfer to the equations
188  void addMassTransferMomentumTransfer
189  (
191  ) const;
192 
193 public:
194 
195  // Constructors
196 
197  //- Construct from fvMesh
199 
200 
201  //- Destructor
203 
204 
205  // Member Functions
206 
207  //- Return the momentum transfer matrices for the cell-based algorithm.
208  // This includes implicit and explicit forces that add into the cell
209  // UEqn in the normal way.
211 
212  //- As momentumTransfer, but for the face-based algorithm
214 
215  //- Return implicit force coefficients on the faces, for the face-based
216  // algorithm.
217  virtual PtrList<surfaceScalarField> AFfs() const;
218 
219  //- Return the explicit force fluxes for the cell-based algorithm, that
220  // do not depend on phase mass/volume fluxes, and can therefore be
221  // evaluated outside the corrector loop. This includes things like
222  // lift, turbulent dispersion, and wall lubrication.
224  (
226  );
227 
228  //- As phiFs, but for the face-based algorithm
230  (
232  );
233 
234  //- Return the explicit drag force fluxes for the cell-based algorithm.
235  // These depend on phase mass/volume fluxes, and must therefore be
236  // evaluated inside the corrector loop.
238  (
240  ) const;
241 
242  //- As phiKdPhis, but for the face-based algorithm
244  (
246  ) const;
247 
248  //- Return the explicit part of the drag force for the cell-based
249  // algorithm. This is the cell-equivalent of phiKdPhis. These depend on
250  // phase velocities, and must therefore be evaluated inside the
251  // corrector loop.
253  (
255  ) const;
256 
257  //- Solve the drag system for the velocities and fluxes
258  virtual void partialElimination
259  (
261  );
262 
263  //- As partialElimination, but for the face-based algorithm. Only solves
264  // for the fluxes.
265  virtual void partialEliminationf
266  (
268  );
269 
270  //- Return the flux corrections for the cell-based algorithm. These
271  // depend on phase mass/volume fluxes, and must therefore be evaluated
272  // inside the corrector loop.
274  (
276  const bool includeVirtualMass = false
277  ) const;
278 
279  //- Return the phase diffusivities divided by the momentum coefficients
280  virtual const HashPtrTable<surfaceScalarField>& DByAfs() const;
281 
282  //- Read base phaseProperties dictionary
283  virtual bool read();
284 };
285 
286 
287 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
288 
289 } // End namespace Foam
290 
291 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
292 
293 #ifdef NoRepository
295 #endif
296 
297 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
298 
299 #endif
300 
301 // ************************************************************************* //
Foam::MomentumTransferPhaseSystem::phiFfs
virtual PtrList< surfaceScalarField > phiFfs(const PtrList< surfaceScalarField > &rAUfs)
As phiFs, but for the face-based algorithm.
Definition: MomentumTransferPhaseSystem.C:639
MomentumTransferPhaseSystem.C
rAUs
PtrList< volScalarField > rAUs
Definition: pEqn.H:4
Foam::MomentumTransferPhaseSystem::~MomentumTransferPhaseSystem
virtual ~MomentumTransferPhaseSystem()
Destructor.
Definition: MomentumTransferPhaseSystem.C:272
Foam::phasePairKey::hasher
Hashing functor for phasePairKey.
Definition: phasePairKey.H:122
Foam::MomentumTransferPhaseSystem::virtualMassModelTable
HashTable< autoPtr< BlendedInterfacialModel< virtualMassModel > >, phasePairKey, phasePairKey::hash > virtualMassModelTable
Definition: MomentumTransferPhaseSystem.H:114
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::MomentumTransferPhaseSystem::VmTable
HashPtrTable< volScalarField, phasePairKey, phasePairKey::hash > VmTable
Definition: MomentumTransferPhaseSystem.H:93
Foam::MomentumTransferPhaseSystem::KdUByAs
virtual PtrList< volVectorField > KdUByAs(const PtrList< volScalarField > &rAUs) const
Return the explicit part of the drag force for the cell-based.
Definition: MomentumTransferPhaseSystem.C:886
Foam::glTF::key
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
Definition: foamGltfBase.H:108
Foam::MomentumTransferPhaseSystem::wallLubricationModelTable
HashTable< autoPtr< BlendedInterfacialModel< wallLubricationModel > >, phasePairKey, phasePairKey::hash > wallLubricationModelTable
Definition: MomentumTransferPhaseSystem.H:128
Foam::MomentumTransferPhaseSystem::dragModelTable
HashTable< autoPtr< BlendedInterfacialModel< dragModel > >, phasePairKey, phasePairKey::hash > dragModelTable
Definition: MomentumTransferPhaseSystem.H:107
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:59
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
Foam::phasePairKey
An ordered or unorder pair of phase names. Typically specified as follows.
Definition: phasePairKey.H:65
Foam::MomentumTransferPhaseSystem::partialElimination
virtual void partialElimination(const PtrList< volScalarField > &rAUs)
Solve the drag system for the velocities and fluxes.
Definition: MomentumTransferPhaseSystem.C:1021
Foam::MomentumTransferPhaseSystem::phiKdPhis
virtual PtrList< surfaceScalarField > phiKdPhis(const PtrList< volScalarField > &rAUs) const
Return the explicit drag force fluxes for the cell-based algorithm.
Definition: MomentumTransferPhaseSystem.C:802
Foam::MomentumTransferPhaseSystem::momentumTransferf
virtual autoPtr< phaseSystem::momentumTransferTable > momentumTransferf()
As momentumTransfer, but for the face-based algorithm.
Definition: MomentumTransferPhaseSystem.C:382
Foam::MomentumTransferPhaseSystem::turbulentDispersionModelTable
HashTable< autoPtr< BlendedInterfacialModel< turbulentDispersionModel > >, phasePairKey, phasePairKey::hash > turbulentDispersionModelTable
Definition: MomentumTransferPhaseSystem.H:135
Foam::MomentumTransferPhaseSystem::MomentumTransferPhaseSystem
MomentumTransferPhaseSystem(const fvMesh &)
Construct from fvMesh.
Definition: MomentumTransferPhaseSystem.C:170
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam::MomentumTransferPhaseSystem::phiKdPhifs
virtual PtrList< surfaceScalarField > phiKdPhifs(const PtrList< surfaceScalarField > &rAUfs) const
As phiKdPhis, but for the face-based algorithm.
Definition: MomentumTransferPhaseSystem.C:844
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::HashTable
A HashTable similar to std::unordered_map.
Definition: HashTable.H:105
Foam::MomentumTransferPhaseSystem::read
virtual bool read()
Read base phaseProperties dictionary.
Definition: MomentumTransferPhaseSystem.C:1258
Foam::MomentumTransferPhaseSystem::phiFs
virtual PtrList< surfaceScalarField > phiFs(const PtrList< volScalarField > &rAUs)
Return the explicit force fluxes for the cell-based algorithm, that.
Definition: MomentumTransferPhaseSystem.C:498
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::MomentumTransferPhaseSystem::KdTable
HashPtrTable< volScalarField, phasePairKey, phasePairKey::hash > KdTable
Definition: MomentumTransferPhaseSystem.H:79
Foam::MomentumTransferPhaseSystem::KdfTable
HashPtrTable< surfaceScalarField, phasePairKey, phasePairKey::hash > KdfTable
Definition: MomentumTransferPhaseSystem.H:86
Foam::HashPtrTable
A HashTable of pointers to objects of type <T>, with deallocation management of the pointers.
Definition: HashPtrTable.H:54
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:54
HashPtrTable.H
rAUfs
PtrList< surfaceScalarField > rAUfs
Definition: pEqn.H:30
Foam::MomentumTransferPhaseSystem::partialEliminationf
virtual void partialEliminationf(const PtrList< surfaceScalarField > &rAUfs)
As partialElimination, but for the face-based algorithm. Only solves.
Definition: MomentumTransferPhaseSystem.C:1152
Foam::MomentumTransferPhaseSystem::liftModelTable
HashTable< autoPtr< BlendedInterfacialModel< liftModel > >, phasePairKey, phasePairKey::hash > liftModelTable
Definition: MomentumTransferPhaseSystem.H:121
Foam::MomentumTransferPhaseSystem::momentumTransfer
virtual autoPtr< phaseSystem::momentumTransferTable > momentumTransfer()
Return the momentum transfer matrices for the cell-based algorithm.
Definition: MomentumTransferPhaseSystem.C:280
Foam::MomentumTransferPhaseSystem::AFfs
virtual PtrList< surfaceScalarField > AFfs() const
Return implicit force coefficients on the faces, for the face-based.
Definition: MomentumTransferPhaseSystem.C:458
Foam::MomentumTransferPhaseSystem::VmfTable
HashPtrTable< surfaceScalarField, phasePairKey, phasePairKey::hash > VmfTable
Definition: MomentumTransferPhaseSystem.H:100
Foam::MomentumTransferPhaseSystem
Class which models interfacial momenum transfer between a number of phases. Drag, virtual mass,...
Definition: MomentumTransferPhaseSystem.H:66
Foam::MomentumTransferPhaseSystem::ddtCorrByAs
virtual PtrList< surfaceScalarField > ddtCorrByAs(const PtrList< volScalarField > &rAUs, const bool includeVirtualMass=false) const
Return the flux corrections for the cell-based algorithm. These.
Definition: MomentumTransferPhaseSystem.C:922
Foam::MomentumTransferPhaseSystem::DByAfs
virtual const HashPtrTable< surfaceScalarField > & DByAfs() const
Return the phase diffusivities divided by the momentum coefficients.
Definition: MomentumTransferPhaseSystem.C:1251