solid.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::solid
26 
27 Description
28  Solver module for thermal transport in solid domains and regions for
29  conjugate heat transfer, HVAC and similar applications, with optional mesh
30  motion and mesh topology changes.
31 
32 SourceFiles
33  solid.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef solid_H
38 #define solid_H
39 
40 #include "solver.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 namespace solvers
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class solid Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class solid
55 :
56  public solver
57 {
58 
59 protected:
60 
61  // Control parameters
62 
63  scalar maxDi;
64 
65  scalar maxDeltaT_;
66 
67 
68  // Thermophysical properties
69 
71 
73 
75 
76 
77  // Thermophysical transport
78 
79  //- Pointer to the solid thermophysical transport model
81 
82 
83  // Time-step controls
84 
85  scalar DiNum;
86 
87 
88  // Protected Member Functions
89 
90  //- Return true if the solver's dependencies have been modified
91  virtual bool dependenciesModified() const;
92 
93  //- Read controls
94  virtual bool read();
95 
96 
97 private:
98 
99  // Private Member Functions
100 
101  //- Correct the cached Courant numbers
102  void correctDiNum();
103 
104 
105 public:
106 
107  // Public Data
108 
109  //- Reference to the solid thermophysical properties
110  const solidThermo& thermo;
111 
112  //- Reference to the temperature field
113  const volScalarField& T;
114 
115 
116  //- Runtime type information
117  TypeName("solid");
118 
119 
120  // Constructors
121 
122  //- Construct from region mesh and thermophysical properties
124 
125  //- Construct from region mesh
126  solid(fvMesh& mesh);
127 
128  //- Disallow default bitwise copy construction
129  solid(const solid&) = delete;
130 
131 
132  //- Destructor
133  virtual ~solid();
134 
135 
136  // Member Functions
137 
138  //- Return the current maximum time-step for stable solution
139  virtual scalar maxDeltaT() const;
140 
141  //- Called at the start of the time-step, before the PIMPLE loop
142  virtual void preSolve();
143 
144  //- Called at the start of the PIMPLE loop to move the mesh
145  virtual void moveMesh();
146 
147  //- Corrections that follow mesh motion
148  virtual void motionCorrector();
149 
150  //- Called at the beginning of the PIMPLE loop
151  virtual void prePredictor();
152 
153  //- Construct and optionally solve the momentum equation
154  virtual void momentumPredictor();
155 
156  //- Construct and solve the energy equation,
157  // convert to temperature
158  // and update thermophysical and transport properties
159  virtual void thermophysicalPredictor();
160 
161  //- Construct and solve the pressure equation in the PISO loop
162  virtual void pressureCorrector();
163 
164  //- Correct the thermophysical transport modelling
165  virtual void postCorrector();
166 
167  //- Called after the PIMPLE loop at the end of the time-step
168  virtual void postSolve();
169 
170 
171  // Member Operators
172 
173  //- Disallow default bitwise assignment
174  void operator=(const solid&) = delete;
175 };
176 
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 } // End namespace solvers
181 } // End namespace Foam
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 #endif
186 
187 // ************************************************************************* //
Generic GeometricField class.
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
Base-class for solid thermodynamic properties.
Definition: solidThermo.H:59
Abstract base class for run-time selectable region solvers.
Definition: solver.H:56
const fvMesh & mesh
Region mesh.
Definition: solver.H:101
Solver module for thermal transport in solid domains and regions for conjugate heat transfer,...
Definition: solid.H:56
virtual void thermophysicalPredictor()
Construct and solve the energy equation,.
Definition: solid.C:218
virtual void prePredictor()
Called at the beginning of the PIMPLE loop.
Definition: solid.C:205
virtual void postSolve()
Called after the PIMPLE loop at the end of the time-step.
Definition: solid.C:259
virtual bool dependenciesModified() const
Return true if the solver's dependencies have been modified.
Definition: solid.C:79
virtual void moveMesh()
Called at the start of the PIMPLE loop to move the mesh.
Definition: solid.C:184
virtual scalar maxDeltaT() const
Return the current maximum time-step for stable solution.
Definition: solid.C:157
TypeName("solid")
Runtime type information.
virtual void motionCorrector()
Corrections that follow mesh motion.
Definition: solid.C:201
autoPtr< solidThermo > thermoPtr_
Definition: solid.H:69
const solidThermo & thermo
Reference to the solid thermophysical properties.
Definition: solid.H:109
virtual void pressureCorrector()
Construct and solve the pressure equation in the PISO loop.
Definition: solid.C:246
virtual void postCorrector()
Correct the thermophysical transport modelling.
Definition: solid.C:250
virtual void momentumPredictor()
Construct and optionally solve the momentum equation.
Definition: solid.C:214
autoPtr< solidThermophysicalTransportModel > thermophysicalTransport
Pointer to the solid thermophysical transport model.
Definition: solid.H:79
volScalarField & T_
Definition: solid.H:73
void operator=(const solid &)=delete
Disallow default bitwise assignment.
solid(fvMesh &mesh, autoPtr< solidThermo >)
Construct from region mesh and thermophysical properties.
Definition: solid.C:104
const volScalarField & T
Reference to the temperature field.
Definition: solid.H:112
virtual void preSolve()
Called at the start of the time-step, before the PIMPLE loop.
Definition: solid.C:170
solidThermo & thermo_
Definition: solid.H:71
scalar maxDeltaT_
Definition: solid.H:64
virtual bool read()
Read controls.
Definition: solid.C:85
virtual ~solid()
Destructor.
Definition: solid.C:151
Namespace for OpenFOAM.