functions.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 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::functions
26 
27 Description
28  Solver module to execute the \c functionObjects for a specified solver
29 
30  The solver specified by either the \c subSolver or if not present the \c
31  solver entry in the \c controlDict is instantiated to provide the physical
32  fields needed by the \c functionObjects. The \c functionObjects are then
33  instantiated from the specifications are read from the \c functions entry in
34  the \c controlDict and executed in a time-loop also controlled by entries in
35  \c controlDict and the \c maxDeltaT() returned by the sub-solver.
36 
37  The fields and other objects registered by the sub-solver are set to
38  NO_WRITE as they are not changed by the execution of the functionObjects and
39  should not be written out each write-time. Fields and other objects created
40  and changed by the execution of the functionObjects are written out.
41 
42  When restarting from a time directory which does contain the \c subSolver
43  fields the optional \c controlDict entry \c subSolverTime may be provided to
44  specify which time the \c subSolver should be instantiated for, after which
45  time is reset to \c startTime for the restart.
46 
47 SourceFiles
48  functions.C
49 
50 \*---------------------------------------------------------------------------*/
51 
52 #ifndef solvers_functions_H
53 #define solvers_functions_H
54 
55 #include "movingMesh.H"
56 
57 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58 
59 namespace Foam
60 {
61 namespace solvers
62 {
63 
64 /*---------------------------------------------------------------------------*\
65  Class functions Declaration
66 \*---------------------------------------------------------------------------*/
67 
68 class functions
69 :
70  public movingMesh
71 {
72 
73 protected:
74 
75  //- Pointer to the solid or fluid solver
77 
78 
79 public:
80 
81  //- Runtime type information
82  TypeName("functions");
83 
84 
85  // Constructors
86 
87  //- Construct from region mesh
89 
90  //- Disallow default bitwise copy construction
91  functions(const functions&) = delete;
92 
93 
94  //- Destructor
95  virtual ~functions();
96 
97 
98  // Member Functions
99 
100  //- Return the current maximum time-step for stable solution
101  virtual scalar maxDeltaT() const;
102 
103  //- Called at the beginning of the PIMPLE loop
104  virtual void prePredictor();
105 
106  //- Construct and optionally solve the momentum equation
107  virtual void momentumPredictor();
108 
109  //- Construct and solve the energy equation,
110  // convert to temperature
111  // and update thermophysical and transport properties
112  virtual void thermophysicalPredictor();
113 
114  //- Construct and solve the pressure equation in the PISO loop
115  virtual void pressureCorrector();
116 
117  //- Correct the thermophysical transport modelling
118  virtual void postCorrector();
119 
120  //- Called after the PIMPLE loop at the end of the time-step
121  virtual void postSolve();
122 
123 
124  // Member Operators
125 
126  //- Disallow default bitwise assignment
127  void operator=(const functions&) = delete;
128 };
129 
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 } // End namespace solvers
134 } // End namespace Foam
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 #endif
139 
140 // ************************************************************************* //
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
const fvMesh & mesh
Region mesh.
Definition: solver.H:94
Solver module to execute the functionObjects for a specified solver.
Definition: functions.H:70
virtual void thermophysicalPredictor()
Construct and solve the energy equation,.
Definition: functions.C:115
virtual void prePredictor()
Called at the beginning of the PIMPLE loop.
Definition: functions.C:107
virtual void postSolve()
Called after the PIMPLE loop at the end of the time-step.
Definition: functions.C:127
virtual scalar maxDeltaT() const
Return the current maximum time-step for stable solution.
Definition: functions.C:101
void operator=(const functions &)=delete
Disallow default bitwise assignment.
virtual void pressureCorrector()
Construct and solve the pressure equation in the PISO loop.
Definition: functions.C:119
virtual void postCorrector()
Correct the thermophysical transport modelling.
Definition: functions.C:123
virtual void momentumPredictor()
Construct and optionally solve the momentum equation.
Definition: functions.C:111
autoPtr< solver > solverPtr
Pointer to the solid or fluid solver.
Definition: functions.H:75
functions(fvMesh &mesh)
Construct from region mesh.
Definition: functions.C:43
TypeName("functions")
Runtime type information.
virtual ~functions()
Destructor.
Definition: functions.C:95
Solver module to move the mesh.
Definition: movingMesh.H:56
Namespace for OpenFOAM.