multiphaseEuler.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) 2022-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::solvers::multiphaseEuler
26 
27 Description
28  Solver module for a system of any number of compressible fluid phases with a
29  common pressure, but otherwise separate properties. The type of phase model
30  is run time selectable and can optionally represent multiple species and
31  in-phase reactions. The phase system is also run time selectable and can
32  optionally represent different types of momentum, heat and mass transfer.
33 
34  Uses the flexible PIMPLE (PISO-SIMPLE) solution for time-resolved and
35  pseudo-transient and steady simulations.
36 
37  Optional fvModels and fvConstraints are provided to enhance the simulation
38  in many ways including adding various sources, Lagrangian
39  particles, surface film etc. and constraining or limiting the solution.
40 
41 SourceFiles
42  multiphaseEuler.C
43 
44 See also
45  Foam::solvers::compressibleVoF
46  Foam::solvers::fluidSolver
47  Foam::solvers::incompressibleFluid
48 
49 \*---------------------------------------------------------------------------*/
50 
51 #ifndef multiphaseEuler_H
52 #define multiphaseEuler_H
53 
54 #include "fluidSolver.H"
55 #include "momentumTransferSystem.H"
56 #include "heatTransferSystem.H"
59 #include "buoyancy.H"
60 #include "pressureReference.H"
61 
62 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 
64 namespace Foam
65 {
66 namespace solvers
67 {
68 
69 /*---------------------------------------------------------------------------*\
70  Class multiphaseEuler Declaration
71 \*---------------------------------------------------------------------------*/
72 
73 class multiphaseEuler
74 :
75  public fluidSolver
76 {
77 
78 protected:
79 
80  // Controls
81 
82  //- Momentum equation predictor switch
83  // Defaults to false
85 
86  //- Cell/face momentum equation switch
87  // Defaults to false, i.e. uses the cell momentum equation
89 
90  //- Cell/face drag correction for cell momentum corrector
91  // Defaults to false
93 
94  //- Number of energy correctors
95  // Used to improve stability of phase-change simulations
96  // Defaults to 1
98 
100 
101 
102  //- Optional LTS reciprocal time-step field
104 
105  //- Optional LTS reciprocal face time-step field
107 
108  //- Buoyancy force
110 
111 
112  // Phase properties
113 
115 
117 
119 
121 
123 
125 
127 
128 
129  // Thermophysical properties
130 
132 
133  //- Reference to the buoyant pressure for buoyant cases
134  // otherwise to the pressure
136 
137 
138  // Pressure reference
139 
140  //- Pressure reference
142 
143 
144  // Optional models
145 
146  const IOMRFZoneList& MRF;
147 
148 
149  // Cached temporary fields
150 
151  //- Temporary phase momentum matrices
152  // shared between the momentum predictor and pressure corrector
154 
155  //- Temporary storage for the reciprocal momentum equation diagonal
156  // Used by the phase-fraction predictor and pressure corrector
158 
159  //- Stored divU from the previous mesh so that it can be
160  // mapped and used in correctPhi to ensure the corrected phi
161  // has the same divergence
163 
164  //- Read controls
165  virtual bool read();
166 
167 
168 private:
169 
170  // Private Member Functions
171 
172  //- Set rDeltaT for LTS
173  virtual void setRDeltaT();
174 
175  //- Correct the cached Courant numbers
176  void correctCoNum();
177 
178  //- Composition predictor
179  // called in prePredictor() after phase-fraction prediction
180  void compositionPredictor();
181 
182  //- Energy and temperature predictor
183  void energyPredictor();
184 
185  //- Cell-based momentum equation predictor
186  void cellMomentumPredictor();
187 
188  //- Face-based momentum equation predictor
189  void faceMomentumPredictor();
190 
191  //- Cell-based pressure equation predictor
192  void cellPressureCorrector();
193 
194  //- Face-based pressure equation predictor
195  void facePressureCorrector();
196 
197  //- Return the list of pressure equation compressibility contributions
198  PtrList<fvScalarMatrix> compressibilityEqns
199  (
201  ) const;
202 
203 
204 public:
205 
206  // Public Data
207 
208  //- Reference to the multiphase fluid
209  const phaseSystem& fluid;
210 
211  //- Reference to the phases
213 
214  //- Reference to the moving phases
216 
217  //- Reference to the momentum transfer system
219 
220  //- Reference to the heat transfer system
222 
223  //- Reference to the pressure field
224  const volScalarField& p;
225 
226  //- Reference to the buoyant pressure for buoyant cases
227  // otherwise to the pressure
228  const volScalarField& p_rgh;
229 
230  //- Reference to the mass-flux field
231  const surfaceScalarField& phi;
232 
233 
234  //- Runtime type information
235  TypeName("multiphaseEuler");
236 
237 
238  // Constructors
239 
240  //- Construct from region mesh
242 
243  //- Disallow default bitwise copy construction
244  multiphaseEuler(const multiphaseEuler&) = delete;
245 
246 
247  //- Destructor
248  virtual ~multiphaseEuler();
249 
250 
251  // Member Functions
252 
253  //- Called at the start of the time-step, before the PIMPLE loop
254  virtual void preSolve();
255 
256  //- Called at the start of the PIMPLE loop to move the mesh
257  virtual void moveMesh();
258 
259  //- Corrections that follow mesh motion
260  virtual void motionCorrector();
261 
262  //- Called at the start of the PIMPLE loop
263  virtual void prePredictor();
264 
265  //- Predict the momentum transport
266  virtual void momentumTransportPredictor();
267 
268  //- Predict thermophysical transport
269  virtual void thermophysicalTransportPredictor();
270 
271  //- Construct and optionally solve the momentum equation
272  virtual void momentumPredictor();
273 
274  //- Construct and solve the energy equation,
275  // convert to temperature
276  // and update thermophysical and transport properties
277  virtual void thermophysicalPredictor();
278 
279  //- Construct and solve the pressure equation in the PISO loop
280  virtual void pressureCorrector();
281 
282  //- Correct the momentum transport
283  virtual void momentumTransportCorrector();
284 
285  //- Correct the thermophysical transport
286  virtual void thermophysicalTransportCorrector();
287 
288  //- Called after the PIMPLE loop at the end of the time-step
289  virtual void postSolve();
290 
291 
292  // Member Operators
293 
294  //- Disallow default bitwise assignment
295  void operator=(const multiphaseEuler&) = delete;
296 };
297 
298 
299 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
300 
301 } // End namespace solvers
302 } // End namespace Foam
303 
304 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
305 
306 #endif
307 
308 // ************************************************************************* //
Generic GeometricField class.
List of MRF zones with IO functionality. MRF zones are specified by a list of dictionary entries,...
Definition: IOMRFZoneList.H:68
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 simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:61
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:96
Class which provides interfacial momentum transfer between a number of phases. Drag,...
Class which provides interfacial momentum transfer between a number of phases. Drag,...
Class to represent a system of phases.
Definition: phaseSystem.H:74
Class which provides population balance functionality. Holds a number of population balances and prov...
Provides controls for the pressure reference in closed-volume simulations.
const fvMesh & mesh
Region mesh.
Definition: solver.H:101
Buoyancy related data for the Foam::solvers::isothermalFluid solver module when solving buoyant cases...
Definition: buoyancy.H:70
Base solver module for fluid solvers.
Definition: fluidSolver.H:62
Solver module for a system of any number of compressible fluid phases with a common pressure,...
virtual void thermophysicalPredictor()
Construct and solve the energy equation,.
const surfaceScalarField & phi
Reference to the mass-flux field.
virtual void momentumTransportCorrector()
Correct the momentum transport.
virtual void prePredictor()
Called at the start of the PIMPLE loop.
const volScalarField & p_rgh
Reference to the buoyant pressure for buoyant cases.
virtual void postSolve()
Called after the PIMPLE loop at the end of the time-step.
virtual void momentumTransportPredictor()
Predict the momentum transport.
solvers::buoyancy buoyancy
Buoyancy force.
int nEnergyCorrectors
Number of energy correctors.
tmp< volScalarField > trDeltaT
Optional LTS reciprocal time-step field.
phaseSystem::phaseModelList & phases_
virtual void moveMesh()
Called at the start of the PIMPLE loop to move the mesh.
Definition: moveMesh.C:32
TypeName("multiphaseEuler")
Runtime type information.
autoPtr< volScalarField > divU
Stored divU from the previous mesh so that it can be.
const heatTransferSystem & heatTransfer
Reference to the heat transfer system.
virtual void motionCorrector()
Corrections that follow mesh motion.
Definition: moveMesh.C:60
PtrList< fvVectorMatrix > UEqns
Temporary phase momentum matrices.
const phaseSystem::phaseModelPartialList & movingPhases
Reference to the moving phases.
virtual void pressureCorrector()
Construct and solve the pressure equation in the PISO loop.
Switch predictMomentum
Momentum equation predictor switch.
virtual void momentumPredictor()
Construct and optionally solve the momentum equation.
momentumTransferSystem momentumTransferSystem_
virtual void thermophysicalTransportCorrector()
Correct the thermophysical transport.
Switch faceMomentum
Cell/face momentum equation switch.
Switch dragCorrection
Cell/face drag correction for cell momentum corrector.
volScalarField & p_rgh_
Reference to the buoyant pressure for buoyant cases.
Foam::pressureReference pressureReference
Pressure reference.
tmp< surfaceScalarField > trDeltaTf
Optional LTS reciprocal face time-step field.
PtrList< volScalarField > rAs
Temporary storage for the reciprocal momentum equation diagonal.
virtual void preSolve()
Called at the start of the time-step, before the PIMPLE loop.
const phaseSystem::phaseModelList & phases
Reference to the phases.
void operator=(const multiphaseEuler &)=delete
Disallow default bitwise assignment.
phaseSystem::alphaControl alphaControls
virtual ~multiphaseEuler()
Destructor.
phaseSystem::phaseModelPartialList & movingPhases_
const volScalarField & p
Reference to the pressure field.
const momentumTransferSystem & momentumTransfer
Reference to the momentum transfer system.
virtual void thermophysicalTransportPredictor()
Predict thermophysical transport.
multiphaseEuler(fvMesh &mesh)
Construct from region mesh.
populationBalanceSystem populationBalanceSystem_
virtual bool read()
Read controls.
const phaseSystem & fluid
Reference to the multiphase fluid.
heatTransferSystem heatTransferSystem_
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.
alpha solution control structure
Definition: phaseSystem.H:81