All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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-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::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 "phaseSystem.H"
57 #include "buoyancy.H"
58 #include "pressureReference.H"
59 
60 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
61 
62 namespace Foam
63 {
64 namespace solvers
65 {
66 
67 /*---------------------------------------------------------------------------*\
68  Class multiphaseEuler Declaration
69 \*---------------------------------------------------------------------------*/
70 
71 class multiphaseEuler
72 :
73  public fluidSolver
74 {
75 
76 protected:
77 
78  // Controls
79 
80  //- Momentum equation predictor switch
81  // Defaults to false
83 
84  //- Cell/face momentum equation switch
85  // Defaults to false, i.e. uses the cell momentum equation
87 
88  //- Cell/face drag correction for cell momentum corrector
89  // Defaults to false
91 
92  //- Number of energy correctors
93  // Used to improve stability of phase-change sibulations
94  // Defaults to 1
96 
97 
98  //- Optional LTS reciprocal time-step field
100 
101  //- Optional LTS reciprocal face time-step field
103 
104  //- Buoyancy force
106 
107 
108  // Phase properties
109 
111 
113 
115 
117 
119 
120 
121  // Thermophysical properties
122 
124 
125  //- Reference to the buoyant pressure for buoyant cases
126  // otherwise to the pressure
128 
129 
130  // Pressure reference
131 
132  //- Pressure reference
134 
135 
136  // Optional models
137 
138  const IOMRFZoneList& MRF;
139 
140 
141  // Cached temporary fields
142 
143  //- Temporary phase momentum matrices
144  // shared between the momentum predictor and pressure corrector
146 
147  //- Temporary storage for the reciprocal momentum equation diagonal
148  // Used by the phase-fraction predictor and pressure corrector
150 
151  //- Stored divU from the previous mesh so that it can be
152  // mapped and used in correctPhi to ensure the corrected phi
153  // has the same divergence
155 
156  //- Read controls
157  virtual bool read();
158 
159 
160 private:
161 
162  // Private Member Functions
163 
164  //- Set rDeltaT for LTS
165  virtual void setRDeltaT();
166 
167  //- Correct the cached Courant numbers
168  void correctCoNum();
169 
170  //- Composition predictor
171  // called in prePredictor() after phase-fraction prediction
172  void compositionPredictor();
173 
174  //- Energy and temperature predictor
175  void energyPredictor();
176 
177  //- Cell-based momentum equation predictor
178  void cellMomentumPredictor();
179 
180  //- Face-based momentum equation predictor
181  void faceMomentumPredictor();
182 
183  //- Cell-based pressure equation predictor
184  void cellPressureCorrector();
185 
186  //- Face-based pressure equation predictor
187  void facePressureCorrector();
188 
189  //- Return the list of pressure equation compressibility contributions
190  PtrList<fvScalarMatrix> compressibilityEqns
191  (
192  const PtrList<volScalarField>& dmdts,
193  const PtrList<volScalarField>& d2mdtdps
194  ) const;
195 
196 
197 public:
198 
199  // Public Data
200 
201  //- Reference to the multiphase fluid
202  const phaseSystem& fluid;
203 
204  //- Reference to the phases
206 
207  //- Reference to the moving phases
209 
210  //- Reference to the pressure field
211  const volScalarField& p;
212 
213  //- Reference to the mass-flux field
214  const surfaceScalarField& phi;
215 
216 
217  //- Runtime type information
218  TypeName("multiphaseEuler");
219 
220 
221  // Constructors
222 
223  //- Construct from region mesh
225 
226  //- Disallow default bitwise copy construction
227  multiphaseEuler(const multiphaseEuler&) = delete;
228 
229 
230  //- Destructor
231  virtual ~multiphaseEuler();
232 
233 
234  // Member Functions
235 
236  //- Called at the start of the time-step, before the PIMPLE loop
237  virtual void preSolve();
238 
239  //- Called at the start of the PIMPLE loop to move the mesh
240  virtual void moveMesh();
241 
242  //- Corrections that follow mesh motion
243  virtual void motionCorrector();
244 
245  //- Called at the start of the PIMPLE loop
246  virtual void prePredictor();
247 
248  //- Construct and optionally solve the momentum equation
249  virtual void momentumPredictor();
250 
251  //- Construct and solve the energy equation,
252  // convert to temperature
253  // and update thermophysical and transport properties
254  virtual void thermophysicalPredictor();
255 
256  //- Construct and solve the pressure equation in the PISO loop
257  virtual void pressureCorrector();
258 
259  //- Correct the momentum and thermophysical transport modelling
260  virtual void postCorrector();
261 
262  //- Called after the PIMPLE loop at the end of the time-step
263  virtual void postSolve();
264 
265 
266  // Member Operators
267 
268  //- Disallow default bitwise assignment
269  void operator=(const multiphaseEuler&) = delete;
270 };
271 
272 
273 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
274 
275 } // End namespace solvers
276 } // End namespace Foam
277 
278 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
279 
280 #endif
281 
282 // ************************************************************************* //
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:99
Class to represent a system of phases and model interfacial transfers between them.
Definition: phaseSystem.H:73
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,.
volScalarField & p_rgh
Reference to the buoyant pressure for buoyant cases.
const surfaceScalarField & phi
Reference to the mass-flux field.
virtual void prePredictor()
Called at the start of the PIMPLE loop.
virtual void postSolve()
Called after the PIMPLE loop at the end of the time-step.
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.
virtual void motionCorrector()
Corrections that follow mesh motion.
Definition: moveMesh.C:64
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.
virtual void postCorrector()
Correct the momentum and thermophysical transport modelling.
Switch predictMomentum
Momentum equation predictor switch.
virtual void momentumPredictor()
Construct and optionally solve the momentum equation.
Switch faceMomentum
Cell/face momentum equation switch.
Switch dragCorrection
Cell/face drag correction for cell momentum corrector.
autoPtr< phaseSystem > fluidPtr_
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.
virtual ~multiphaseEuler()
Destructor.
phaseSystem::phaseModelPartialList & movingPhases_
const volScalarField & p
Reference to the pressure field.
multiphaseEuler(fvMesh &mesh)
Construct from region mesh.
virtual bool read()
Read controls.
const phaseSystem & fluid
Reference to the multiphase fluid.
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.