incompressibleFluid.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::incompressibleFluid
26 
27 Description
28  Solver module for steady or transient turbulent flow of incompressible
29  isothermal fluids with optional mesh motion and change.
30 
31  Uses the flexible PIMPLE (PISO-SIMPLE) solution for time-resolved and
32  pseudo-transient and steady simulations.
33 
34  Optional fvModels and fvConstraints are provided to enhance the simulation
35  in many ways including adding various sources, constraining or limiting
36  the solution.
37 
38  Reference:
39  \verbatim
40  Greenshields, C. J., & Weller, H. G. (2022).
41  Notes on Computational Fluid Dynamics: General Principles.
42  CFD Direct Ltd.: Reading, UK.
43  \endverbatim
44 
45 SourceFiles
46  incompressibleFluid.C
47 
48 See also
49  Foam::solvers::fluidSolver
50  Foam::solvers::isothermalFluid
51 
52 \*---------------------------------------------------------------------------*/
53 
54 #ifndef incompressibleFluid_H
55 #define incompressibleFluid_H
56 
57 #include "fluidSolver.H"
58 #include "viscosityModel.H"
60 #include "pressureReference.H"
61 #include "IOMRFZoneList.H"
62 
63 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 
65 namespace Foam
66 {
67 namespace solvers
68 {
69 
70 /*---------------------------------------------------------------------------*\
71  Class incompressibleFluid Declaration
72 \*---------------------------------------------------------------------------*/
73 
75 :
76  public fluidSolver
77 {
78 
79 protected:
80 
81  // Pressure
82 
83  //- Pressure field
85 
86  //- Pressure reference
88 
89 
90  // Kinematic properties
91 
92  //- Velocity field
94 
95  //- Volumetric-flux field
97 
98 
99  // Momentum transport
100 
101  //- Kinematic viscosity model
103 
104  //- Pointer to the momentum transport model
106 
107 
108  // Optional models
109 
110  //- MRF zone list
112 
113 
114  // Cached temporary fields
115 
116  //- Pointer to the surface momentum field
117  // used to recreate the flux after mesh-change
119 
120  //- Optional LTS reciprocal time-step field
122 
123  //- Cached momentum matrix
124  // shared between the momentum predictor and pressure corrector
126 
127 
128  // Protected Member Functions
129 
130  //- Set rDeltaT for LTS
131  void setRDeltaT();
132 
133  //- Correct the cached Courant numbers
134  void correctCoNum();
135 
136  //- Calculate and print the continuity errors
137  void continuityErrors();
138 
139  //- Construct the pressure equation
140  // and correct the pressure and velocity
141  virtual void correctPressure();
142 
143 
144 public:
145 
146  // Public Data
147 
148  //- Reference to the pressure field
149  const volScalarField& p;
150 
151  //- Reference to the velocity field
152  const volVectorField& U;
153 
154  //- Reference to the volumetric-flux field
155  const surfaceScalarField& phi;
156 
157 
158  //- Runtime type information
159  TypeName("incompressibleFluid");
160 
161 
162  // Constructors
163 
164  //- Construct from region mesh
166 
167  //- Disallow default bitwise copy construction
168  incompressibleFluid(const incompressibleFluid&) = delete;
169 
170 
171  //- Destructor
172  virtual ~incompressibleFluid();
173 
174 
175  // Member Functions
176 
177  //- Called at the start of the time-step, before the PIMPLE loop
178  virtual void preSolve();
179 
180  //- Called at the start of the PIMPLE loop to move the mesh
181  virtual void moveMesh();
182 
183  //- Called at the start of the PIMPLE loop
184  virtual void prePredictor();
185 
186  //- Construct and optionally solve the momentum equation
187  virtual void momentumPredictor();
188 
189  //- Construct and solve the energy equation,
190  // convert to temperature
191  // and update thermophysical and transport properties
192  virtual void thermophysicalPredictor();
193 
194  //- Construct and solve the pressure equation in the PISO loop
195  virtual void pressureCorrector();
196 
197  //- Correct the momentum and thermophysical transport modelling
198  virtual void postCorrector();
199 
200  //- Called after the PIMPLE loop at the end of the time-step
201  virtual void postSolve();
202 
203 
204  // Member Operators
205 
206  //- Disallow default bitwise assignment
207  void operator=(const incompressibleFluid&) = delete;
208 };
209 
210 
211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 
213 } // End namespace solvers
214 } // End namespace Foam
215 
216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217 
218 #endif
219 
220 // ************************************************************************* //
Generic GeometricField class.
List of MRF zones with IO functionality. MRF zones are specified by a list of dictionary entries,...
Definition: IOMRFZoneList.H:68
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:101
Provides controls for the pressure reference in closed-volume simulations.
const fvMesh & mesh
Region mesh.
Definition: solver.H:94
Base solver module for fluid solvers.
Definition: fluidSolver.H:62
Solver module for steady or transient turbulent flow of incompressible isothermal fluids with optiona...
virtual void thermophysicalPredictor()
Construct and solve the energy equation,.
volScalarField p_
Pressure field.
const surfaceScalarField & phi
Reference to the volumetric-flux field.
volVectorField U_
Velocity field.
virtual void prePredictor()
Called at the start of the PIMPLE loop.
tmp< fvVectorMatrix > tUEqn
Cached momentum matrix.
virtual void postSolve()
Called after the PIMPLE loop at the end of the time-step.
autoPtr< surfaceVectorField > Uf
Pointer to the surface momentum field.
tmp< volScalarField > trDeltaT
Optional LTS reciprocal time-step field.
virtual void moveMesh()
Called at the start of the PIMPLE loop to move the mesh.
Definition: moveMesh.C:32
const volVectorField & U
Reference to the velocity field.
autoPtr< incompressible::momentumTransportModel > momentumTransport
Pointer to the momentum transport model.
void operator=(const incompressibleFluid &)=delete
Disallow default bitwise assignment.
virtual void pressureCorrector()
Construct and solve the pressure equation in the PISO loop.
IOMRFZoneList MRF
MRF zone list.
virtual void postCorrector()
Correct the momentum and thermophysical transport modelling.
TypeName("incompressibleFluid")
Runtime type information.
virtual void momentumPredictor()
Construct and optionally solve the momentum equation.
virtual void correctPressure()
Construct the pressure equation.
surfaceScalarField phi_
Volumetric-flux field.
void setRDeltaT()
Set rDeltaT for LTS.
Definition: setRDeltaT.C:32
Foam::pressureReference pressureReference
Pressure reference.
void continuityErrors()
Calculate and print the continuity errors.
void correctCoNum()
Correct the cached Courant numbers.
virtual void preSolve()
Called at the start of the time-step, before the PIMPLE loop.
autoPtr< viscosityModel > viscosity
Kinematic viscosity model.
const volScalarField & p
Reference to the pressure field.
incompressibleFluid(fvMesh &mesh)
Construct from region mesh.
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.