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-2018 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 momenum 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 template<class modelType>
51 class BlendedInterfacialModel;
52 
53 class blendingMethod;
54 class dragModel;
55 class virtualMassModel;
56 class liftModel;
57 class wallLubricationModel;
58 class turbulentDispersionModel;
59 
60 /*---------------------------------------------------------------------------*\
61  Class MomentumTransferPhaseSystem Declaration
62 \*---------------------------------------------------------------------------*/
63 
64 template<class BasePhaseSystem>
66 :
67  public BasePhaseSystem
68 {
69 protected:
70 
71  // Protected typedefs
72 
73  typedef HashPtrTable
74  <
78  > KdTable;
79 
80  typedef HashPtrTable
81  <
83  phasePairKey,
85  > KdfTable;
86 
87  typedef HashPtrTable
88  <
90  phasePairKey,
92  > VmTable;
93 
94  typedef HashPtrTable
95  <
97  phasePairKey,
99  > VmfTable;
100 
101  typedef HashTable
102  <
104  phasePairKey,
106  > dragModelTable;
107 
108  typedef HashTable
109  <
111  phasePairKey,
114 
115  typedef HashTable
116  <
118  phasePairKey,
120  > liftModelTable;
121 
122  typedef HashTable
123  <
125  phasePairKey,
128 
129  typedef HashTable
130  <
132  phasePairKey,
135 
136 
137 private:
138 
139  // Private data
140 
141  //- Drag coefficients
142  KdTable Kds_;
143 
144  //- Face drag coefficients
145  KdfTable Kdfs_;
146 
147  //- Virtual mass coefficients
148  VmTable Vms_;
149 
150  //- Face virtual mass coefficients
151  VmfTable Vmfs_;
152 
153  //- The phase diffusivities divided by the momentum coefficients
155 
156  // Sub Models
157 
158  //- Drag models
159  dragModelTable dragModels_;
160 
161  //- Virtual mass models
162  virtualMassModelTable virtualMassModels_;
163 
164  //- Lift models
165  liftModelTable liftModels_;
166 
167  //- Wall lubrication models
168  wallLubricationModelTable wallLubricationModels_;
169 
170  //- Turbulent dispersion models
171  turbulentDispersionModelTable turbulentDispersionModels_;
172 
173 
174  // Private member functions
175 
176  //- Return the drag coefficient for the phase pair
177  virtual tmp<volScalarField> Kd(const phasePairKey& key) const;
178 
179  //- Return the face drag coefficient for the phase pair
180  virtual tmp<surfaceScalarField> Kdf(const phasePairKey& key) const;
181 
182  //- Return the virtual mass coefficient for the phase pair
183  virtual tmp<volScalarField> Vm(const phasePairKey& key) const;
184 
185  //- Add the mass-transfer-based momentum transfer to the equations
186  void addMassTransferMomentumTransfer
187  (
189  ) const;
190 
191 public:
192 
193  // Constructors
194 
195  //- Construct from fvMesh
197 
198 
199  //- Destructor
201 
202 
203  // Member Functions
204 
205  //- Return the momentum transfer matrices for the cell-based algorithm.
206  // This includes implicit and explicit forces that add into the cell
207  // UEqn in the normal way.
209 
210  //- As momentumTransfer, but for the face-based algorithm
212 
213  //- Return implicit force coefficients on the faces, for the face-based
214  // algorithm.
215  virtual Xfer<PtrList<surfaceScalarField>> AFfs() const;
216 
217  //- Return the explicit force fluxes for the cell-based algorithm, that
218  // do not depend on phase mass/volume fluxes, and can therefore be
219  // evaluated outside the corrector loop. This includes things like
220  // lift, turbulent dispersion, and wall lubrication.
222  (
224  );
225 
226  //- As phiFs, but for the face-based algorithm
228  (
230  );
231 
232  //- Return the explicit drag force fluxes for the cell-based algorithm.
233  // These depend on phase mass/volume fluxes, and must therefore be
234  // evaluated inside the corrector loop.
236  (
238  ) const;
239 
240  //- As phiKdPhis, but for the face-based algorithm
242  (
244  ) const;
245 
246  //- Return the explicit part of the drag force for the cell-based
247  // algorithm. This is the cell-equivalent of phiKdPhis. These depend on
248  // phase velocities, and must therefore be evaluated inside the
249  // corrector loop.
251  (
253  ) const;
254 
255  //- Solve the drag system for the velocities and fluxes
256  virtual void partialElimination
257  (
259  );
260 
261  //- As partialElimination, but for the face-based algorithm. Only solves
262  // for the fluxes.
263  virtual void partialEliminationf
264  (
266  );
267 
268  //- Return the flux corrections for the cell-based algorithm. These
269  // depend on phase mass/volume fluxes, and must therefore be evaluated
270  // inside the corrector loop.
272  (
274  const bool includeVirtualMass = false
275  ) const;
276 
277  //- Return the phase diffusivities divided by the momentum coefficients
278  virtual const HashPtrTable<surfaceScalarField>& DByAfs() const;
279 
280  //- Read base phaseProperties dictionary
281  virtual bool read();
282 };
283 
284 
285 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
286 
287 } // End namespace Foam
288 
289 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
290 
291 #ifdef NoRepository
293 #endif
294 
295 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
296 
297 #endif
298 
299 // ************************************************************************* //
Class which models interfacial momenum transfer between a number of phases. Drag, virtual mass...
A simple container for copying or transferring objects of type <T>.
Definition: Xfer.H:85
PtrList< volScalarField > rAUs
Definition: pEqn.H:4
HashTable< autoPtr< BlendedInterfacialModel< dragModel > >, phasePairKey, phasePairKey::hash > dragModelTable
virtual autoPtr< phaseSystem::momentumTransferTable > momentumTransferf()
As momentumTransfer, but for the face-based algorithm.
virtual void partialEliminationf(const PtrList< surfaceScalarField > &rAUfs)
As partialElimination, but for the face-based algorithm. Only solves.
virtual bool read()
Read base phaseProperties dictionary.
MomentumTransferPhaseSystem(const fvMesh &)
Construct from fvMesh.
HashPtrTable< surfaceScalarField, phasePairKey, phasePairKey::hash > KdfTable
A HashTable specialization for hashing pointers.
Definition: HashPtrTable.H:50
HashTable< autoPtr< BlendedInterfacialModel< liftModel > >, phasePairKey, phasePairKey::hash > liftModelTable
virtual Xfer< PtrList< surfaceScalarField > > phiKdPhifs(const PtrList< surfaceScalarField > &rAUfs) const
As phiKdPhis, but for the face-based algorithm.
virtual Xfer< PtrList< surfaceScalarField > > phiKdPhis(const PtrList< volScalarField > &rAUs) const
Return the explicit drag force fluxes for the cell-based algorithm.
HashPtrTable< surfaceScalarField, phasePairKey, phasePairKey::hash > VmfTable
virtual Xfer< PtrList< surfaceScalarField > > phiFs(const PtrList< volScalarField > &rAUs)
Return the explicit force fluxes for the cell-based algorithm, that.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
virtual const HashPtrTable< surfaceScalarField > & DByAfs() const
Return the phase diffusivities divided by the momentum coefficients.
virtual Xfer< PtrList< surfaceScalarField > > AFfs() const
Return implicit force coefficients on the faces, for the face-based.
virtual Xfer< PtrList< surfaceScalarField > > ddtCorrByAs(const PtrList< volScalarField > &rAUs, const bool includeVirtualMass=false) const
Return the flux corrections for the cell-based algorithm. These.
HashPtrTable< volScalarField, phasePairKey, phasePairKey::hash > KdTable
HashTable< autoPtr< BlendedInterfacialModel< virtualMassModel > >, phasePairKey, phasePairKey::hash > virtualMassModelTable
An STL-conforming hash table.
Definition: HashTable.H:62
PtrList< surfaceScalarField > rAUfs
Definition: pEqn.H:30
virtual ~MomentumTransferPhaseSystem()
Destructor.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:63
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
virtual Xfer< PtrList< volVectorField > > KdUByAs(const PtrList< volScalarField > &rAUs) const
Return the explicit part of the drag force for the cell-based.
HashPtrTable< volScalarField, phasePairKey, phasePairKey::hash > VmTable
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
A class for managing temporary objects.
Definition: PtrList.H:53
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
HashTable< autoPtr< BlendedInterfacialModel< turbulentDispersionModel > >, phasePairKey, phasePairKey::hash > turbulentDispersionModelTable
virtual Xfer< PtrList< surfaceScalarField > > phiFfs(const PtrList< surfaceScalarField > &rAUfs)
As phiFs, but for the face-based algorithm.
Namespace for OpenFOAM.
HashTable< autoPtr< BlendedInterfacialModel< wallLubricationModel > >, phasePairKey, phasePairKey::hash > wallLubricationModelTable
virtual void partialElimination(const PtrList< volScalarField > &rAUs)
Solve the drag system for the velocities and fluxes.
virtual autoPtr< phaseSystem::momentumTransferTable > momentumTransfer()
Return the momentum transfer matrices for the cell-based algorithm.