incompressibleDriftFlux.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) 2023-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::incompressibleDriftFlux
26 
27 Description
28  Solver module for 2 incompressible fluids using the mixture approach with
29  the drift-flux approximation for relative motion of the phases, with
30  optional mesh motion and mesh topology changes including adaptive
31  re-meshing.
32 
33  The momentum and other fluid properties are of the "mixture" and a single
34  momentum equation is solved with mixture transport modelling in which a
35  single laminar, RAS or LES model is selected to model the momentum stress.
36 
37  Uses the flexible PIMPLE (PISO-SIMPLE) solution for time-resolved and
38  pseudo-transient and steady simulations.
39 
40  Optional fvModels and fvConstraints are provided to enhance the simulation
41  in many ways including adding various sources, Lagrangian
42  particles, surface film etc. and constraining or limiting the solution.
43 
44 SourceFiles
45  incompressibleDriftFlux.C
46 
47 See also
48  Foam::solvers::VoFSolver
49  Foam::solvers::twoPhaseSolver
50  Foam::solvers::compressibleVoF
51 
52 \*---------------------------------------------------------------------------*/
53 
54 #ifndef incompressibleDriftFlux_H
55 #define incompressibleDriftFlux_H
56 
57 #include "twoPhaseSolver.H"
59 #include "relativeVelocityModel.H"
60 #include "packingDispersionModel.H"
61 #include "momentumTransportModel.H"
63 
64 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
65 
66 namespace Foam
67 {
68 namespace solvers
69 {
70 
71 /*---------------------------------------------------------------------------*\
72  Class incompressibleDriftFlux Declaration
73 \*---------------------------------------------------------------------------*/
74 
76 :
77  public twoPhaseSolver
78 {
79 
80 protected:
81 
82  // Phase properties
83 
84  //- The compressible two-phase mixture
86 
87 
88  // Thermophysical properties
89 
90  //- Static pressure field
92 
93 
94  // Pressure reference
95 
96  //- Pressure reference
98 
99 
100  // Momentum transport
101 
102  //- Pointer to the dispersed phase relative velocity model
104 
105  //- Pointer to the dispersed phase packing dispersion model
107 
108  //- Pointer to the momentum transport model
110 
111 
112 private:
113 
114  // Private Member Functions
115 
116  //- Correct the cached Courant numbers
117  virtual void correctCoNum();
118 
119 
120 protected:
121 
122  // Protected Member Functions
123 
124  //- Return the pressure reference
125  virtual const Foam::pressureReference& pressureReference() const
126  {
127  return pressureReference_;
128  }
129 
130  //- The flow is incompressible
131  virtual bool incompressible() const
132  {
133  return true;
134  }
135 
136  //- Is the flow divergent?
137  // i.e. includes phase-fraction sources
138  virtual bool divergent() const
139  {
140  return
143  }
144 
145  //- Return the mixture compressibility/density
146  // Not required for incompressible fluids
147  virtual tmp<volScalarField> psiByRho() const
148  {
149  return tmp<volScalarField>(nullptr);
150  }
151 
153  (
154  const surfaceScalarField& phi,
155  const volScalarField& alpha
156  );
157 
158  //- Adjust the rDeltaT in the vicinity of the interface
159  virtual void setInterfaceRDeltaT(volScalarField& rDeltaT);
160 
161  //- Calculate the alpha equation sources
162  virtual void alphaSuSp
163  (
166  );
167 
168  //- Correct the interface properties following mesh-change
169  // and phase-fraction update
170  virtual void correctInterface();
171 
172  //- Return the interface surface tension force for the momentum equation
174 
175  //- Return the momentum equation stress term
177  {
178  return
179  relativeVelocity->divDevTau()
180  + momentumTransport->divDevTau(U);
181  }
182 
183 
184 public:
185 
186  //- Runtime type information
187  TypeName("incompressibleDriftFlux");
188 
189 
190  // Constructors
191 
192  //- Construct from region mesh
194 
195  //- Disallow default bitwise copy construction
197 
198 
199  //- Destructor
200  virtual ~incompressibleDriftFlux();
201 
202 
203  // Member Functions
204 
205  //- Return the current maximum time-step for stable solution
206  virtual scalar maxDeltaT() const;
207 
208  //- Called at the start of the PIMPLE loop
209  virtual void prePredictor();
210 
211  //- Predict the momentum transport
212  virtual void momentumTransportPredictor();
213 
214  //- Predict thermophysical transport
215  virtual void thermophysicalTransportPredictor();
216 
217  //- Construct and solve the energy equation,
218  // convert to temperature
219  // and update thermophysical and transport properties
220  virtual void thermophysicalPredictor();
221 
222  //- Construct and solve the pressure equation in the PISO loop
223  virtual void pressureCorrector();
224 
225  //- Correct the momentum transport
226  virtual void momentumTransportCorrector();
227 
228  //- Correct the thermophysical transport
229  virtual void thermophysicalTransportCorrector();
230 
231 
232  // Member Operators
233 
234  //- Disallow default bitwise assignment
235  void operator=(const incompressibleDriftFlux&) = delete;
236 };
237 
238 
239 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
240 
241 } // End namespace solvers
242 } // End namespace Foam
243 
244 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
245 
246 #endif
247 
248 // ************************************************************************* //
Generic GeometricField class.
const word & name() const
Return name.
Definition: IOobject.H:307
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
virtual bool addsSupToField(const word &fieldName) const
Return true if an fvModel adds a source term to the given.
Definition: fvModels.C:229
Class to represent a mixture of two constant density phases.
Provides controls for the pressure reference in closed-volume simulations.
Foam::fvModels & fvModels() const
Return the fvModels that are created on demand.
Definition: solver.C:96
const fvMesh & mesh
Region mesh.
Definition: solver.H:101
const surfaceScalarField & phi
Reference to the mass-flux field.
Definition: VoFSolver.H:216
const volVectorField & U
Reference to the velocity field.
Definition: VoFSolver.H:213
Solver module for 2 incompressible fluids using the mixture approach with the drift-flux approximatio...
virtual void thermophysicalPredictor()
Construct and solve the energy equation,.
virtual tmp< volScalarField > psiByRho() const
Return the mixture compressibility/density.
virtual tmp< surfaceScalarField > surfaceTensionForce() const
Return the interface surface tension force for the momentum equation.
autoPtr< packingDispersionModel > packingDispersion
Pointer to the dispersed phase packing dispersion model.
virtual const Foam::pressureReference & pressureReference() const
Return the pressure reference.
virtual void momentumTransportCorrector()
Correct the momentum transport.
virtual void prePredictor()
Called at the start of the PIMPLE loop.
virtual bool incompressible() const
The flow is incompressible.
virtual bool divergent() const
Is the flow divergent?
virtual void momentumTransportPredictor()
Predict the momentum transport.
incompressibleDriftFlux(fvMesh &mesh)
Construct from region mesh.
virtual void alphaSuSp(tmp< volScalarField::Internal > &Su, tmp< volScalarField::Internal > &Sp)
Calculate the alpha equation sources.
Definition: alphaSuSp.C:49
virtual scalar maxDeltaT() const
Return the current maximum time-step for stable solution.
autoPtr< relativeVelocityModel > relativeVelocity
Pointer to the dispersed phase relative velocity model.
TypeName("incompressibleDriftFlux")
Runtime type information.
incompressibleDriftFluxMixture & mixture
The compressible two-phase mixture.
virtual void pressureCorrector()
Construct and solve the pressure equation in the PISO loop.
virtual void setInterfaceRDeltaT(volScalarField &rDeltaT)
Adjust the rDeltaT in the vicinity of the interface.
void operator=(const incompressibleDriftFlux &)=delete
Disallow default bitwise assignment.
virtual void thermophysicalTransportCorrector()
Correct the thermophysical transport.
virtual void correctInterface()
Correct the interface properties following mesh-change.
virtual tmp< surfaceScalarField > alphaPhi(const surfaceScalarField &phi, const volScalarField &alpha)
Definition: alphaSuSp.C:34
Foam::pressureReference pressureReference_
Pressure reference.
volScalarField p
Static pressure field.
virtual tmp< fvVectorMatrix > divDevTau(volVectorField &U)
Return the momentum equation stress term.
virtual void thermophysicalTransportPredictor()
Predict thermophysical transport.
autoPtr< compressible::momentumTransportModel > momentumTransport
Pointer to the momentum transport model.
Solver module base-class for 2 immiscible fluids, with optional mesh motion and mesh topology changes...
volScalarField & alpha1
Reference to the phase1-fraction.
volScalarField & alpha2
Reference to the phase2-fraction.
A class for managing temporary objects.
Definition: tmp.H:55
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
tmp< VolField< Type > > Su(const VolField< Type > &su, const VolField< Type > &vf)
Definition: fvcSup.C:44
tmp< VolField< Type > > Sp(const volScalarField &sp, const VolField< Type > &vf)
Definition: fvcSup.C:67
Namespace for OpenFOAM.