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-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::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 functions_solver_H
53 #define functions_solver_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  //- Predict the momentum transport
107  virtual void momentumTransportPredictor();
108 
109  //- Predict thermophysical transport
110  virtual void thermophysicalTransportPredictor();
111 
112  //- Construct and optionally solve the momentum equation
113  virtual void momentumPredictor();
114 
115  //- Construct and solve the energy equation,
116  // convert to temperature
117  // and update thermophysical and transport properties
118  virtual void thermophysicalPredictor();
119 
120  //- Construct and solve the pressure equation in the PISO loop
121  virtual void pressureCorrector();
122 
123  //- Correct the momentum transport
124  virtual void momentumTransportCorrector();
125 
126  //- Correct the thermophysical transport
127  virtual void thermophysicalTransportCorrector();
128 
129  //- Called after the PIMPLE loop at the end of the time-step
130  virtual void postSolve();
131 
132 
133  // Member Operators
134 
135  //- Disallow default bitwise assignment
136  void operator=(const functions&) = delete;
137 };
138 
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 } // End namespace solvers
143 } // End namespace Foam
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 #endif
148 
149 // ************************************************************************* //
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
const fvMesh & mesh
Region mesh.
Definition: solver.H:101
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:132
virtual void momentumTransportCorrector()
Correct the momentum transport.
Definition: functions.C:140
virtual void prePredictor()
Called at the beginning of the PIMPLE loop.
Definition: functions.C:116
virtual void postSolve()
Called after the PIMPLE loop at the end of the time-step.
Definition: functions.C:148
virtual void momentumTransportPredictor()
Predict the momentum transport.
Definition: functions.C:120
virtual scalar maxDeltaT() const
Return the current maximum time-step for stable solution.
Definition: functions.C:110
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:136
virtual void momentumPredictor()
Construct and optionally solve the momentum equation.
Definition: functions.C:128
virtual void thermophysicalTransportCorrector()
Correct the thermophysical transport.
Definition: functions.C:144
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:104
virtual void thermophysicalTransportPredictor()
Predict thermophysical transport.
Definition: functions.C:124
Solver module to move the mesh.
Definition: movingMesh.H:56
Namespace for OpenFOAM.