Documentation 6b54b78464
Loading...
Searching...
No Matches
CTurbSSTSolver.hpp
Go to the documentation of this file.
1/*!
2 * \file CTurbSSTSolver.hpp
3 * \brief Headers of the CTurbSSTSolver class
4 * \author A. Campos, F. Palacios, T. Economon
5 * \version 8.5.0 "Harrier"
6 *
7 * SU2 Project Website: https://su2code.github.io
8 *
9 * The SU2 Project is maintained by the SU2 Foundation
10 * (http://su2foundation.org)
11 *
12 * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md)
13 *
14 * SU2 is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Lesser General Public
16 * License as published by the Free Software Foundation; either
17 * version 2.1 of the License, or (at your option) any later version.
18 *
19 * SU2 is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Lesser General Public License for more details.
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with SU2. If not, see <http://www.gnu.org/licenses/>.
26 */
27
28#pragma once
29
30#include "CTurbSolver.hpp"
31
32/*!
33 * \class CTurbSSTSolver
34 * \brief Main class for defining the turbulence model solver.
35 * \ingroup Turbulence_Model
36 * \author A. Campos, F. Palacios, T. Economon
37 */
38class CTurbSSTSolver final : public CTurbSolver {
39private:
40 su2double constants[11] = {0.0}; /*!< \brief Constants for the model. */
41 SST_ParsedOptions sstParsedOptions;
42
43 /*!
44 * \brief Compute nu tilde from the wall functions.
45 * \param[in] geometry - Geometrical definition of the problem.
46 * \param[in] solver_container - Container vector with all the solutions.
47 * \param[in] conv_numerics - Description of the numerical method.
48 * \param[in] visc_numerics - Description of the numerical method.
49 * \param[in] config - Definition of the particular problem.
50 * \param[in] val_marker - Surface marker where the boundary condition is applied.
51 */
52 void SetTurbVars_WF(CGeometry *geometry,
53 CSolver **solver_container,
54 const CConfig *config,
55 unsigned short val_marker);
56
57 /*!
58 * \brief Compute a suitable under-relaxation parameter to limit the change in the solution variables over
59 * a nonlinear iteration for stability.
60 * \param[in] config - Definition of the particular problem.
61 */
62 void ComputeUnderRelaxationFactor(CSolver** solver_container, const CConfig *config) override;
63
64 /*!
65 * \brief Resolve the compile-time parameters of CScalarFlux_SST and run one of this solver's
66 * boundaries through the shared boundary flux pass.
67 * \param[in] opt - Flags of the boundary, from one of ScalarFluxOptions' named constructors.
68 */
69 void BoundaryFlux(CGeometry* geometry, CSolver** solver_container, CConfig* config, const ScalarFluxOptions& opt,
70 unsigned short val_marker);
71
72public:
73 /*!
74 * \brief Constructor.
75 * \param[in] geometry - Geometrical definition of the problem.
76 * \param[in] config - Definition of the particular problem.
77 * \param[in] iMesh - Index of the mesh in multigrid computations.
78 */
79 CTurbSSTSolver(CGeometry *geometry, CConfig *config, const CSolver* flow_solver, unsigned short iMesh);
80
81 /*!
82 * \brief Destructor of the class.
83 */
84 ~CTurbSSTSolver() = default;
85
86 /*!
87 * \brief Restart residual and compute gradients.
88 * \param[in] geometry - Geometrical definition of the problem.
89 * \param[in] solver_container - Container vector with all the solutions.
90 * \param[in] config - Definition of the particular problem.
91 * \param[in] iMesh - Index of the mesh in multigrid computations.
92 * \param[in] iRKStep - Current step of the Runge-Kutta iteration.
93 * \param[in] RunTime_EqSystem - System of equations which is going to be solved.
94 * \param[in] Output - boolean to determine whether to print output.
95 */
96 void Preprocessing(CGeometry *geometry,
97 CSolver **solver_container,
98 CConfig *config,
99 unsigned short iMesh,
100 unsigned short iRKStep,
101 unsigned short RunTime_EqSystem,
102 bool Output) override;
103
104 /*!
105 * \brief Computes the eddy viscosity.
106 * \param[in] geometry - Geometrical definition of the problem.
107 * \param[in] solver_container - Container vector with all the solutions.
108 * \param[in] config - Definition of the particular problem.
109 * \param[in] iMesh - Index of the mesh in multigrid computations.
110 */
111 void Postprocessing(CGeometry *geometry,
112 CSolver **solver_container,
113 CConfig *config,
114 unsigned short iMesh) override;
115
116 /*!
117 * \brief Compute the spatial integration using the CScalarFlux_SST edge kernel, which computes
118 * and writes both the convective and the diffusive term of every edge.
119 * \param[in] geometry - Geometrical definition of the problem.
120 * \param[in] solver_container - Container vector with all the solutions.
121 * \param[in] numerics_container - Unused, kept only for the boundary conditions.
122 * \param[in] config - Definition of the particular problem.
123 * \param[in] iMesh - Index of the mesh in multigrid computations.
124 */
125 void Upwind_Residual(CGeometry* geometry, CSolver** solver_container, CNumerics** numerics_container,
126 CConfig* config, unsigned short iMesh) override;
127
128 /*!
129 * \brief Source term computation.
130 * \param[in] geometry - Geometrical definition of the problem.
131 * \param[in] solver_container - Container vector with all the solutions.
132 * \param[in] numerics_container - Description of the numerical method.
133 * \param[in] config - Definition of the particular problem.
134 * \param[in] iMesh - Index of the mesh in multigrid computations.
135 */
136 void Source_Residual(CGeometry *geometry,
137 CSolver **solver_container,
138 CNumerics **numerics_container,
139 CConfig *config,
140 unsigned short iMesh) override;
141
142 /*!
143 * \brief Source term computation.
144 * \param[in] geometry - Geometrical definition of the problem.
145 * \param[in] solver_container - Container vector with all the solutions.
146 * \param[in] numerics - Description of the numerical method.
147 * \param[in] config - Definition of the particular problem.
148 * \param[in] iMesh - Index of the mesh in multigrid computations.
149 */
150 void Source_Template(CGeometry *geometry,
151 CSolver **solver_container,
152 CNumerics *numerics,
153 CConfig *config,
154 unsigned short iMesh) override;
155
156 /*!
157 * \brief Impose the Navier-Stokes wall boundary condition.
158 * \param[in] geometry - Geometrical definition of the problem.
159 * \param[in] solver_container - Container vector with all the solutions.
160 * \param[in] conv_numerics - Description of the numerical method.
161 * \param[in] visc_numerics - Description of the numerical method.
162 * \param[in] config - Definition of the particular problem.
163 * \param[in] val_marker - Surface marker where the boundary condition is applied.
164 */
165 void BC_HeatFlux_Wall(CGeometry *geometry,
166 CSolver **solver_container,
167 CNumerics *conv_numerics,
168 CNumerics *visc_numerics,
169 CConfig *config,
170 unsigned short val_marker) override;
171 /*!
172 * \brief Impose the Navier-Stokes wall boundary condition.
173 * \param[in] geometry - Geometrical definition of the problem.
174 * \param[in] solver_container - Container vector with all the solutions.
175 * \param[in] conv_numerics - Description of the numerical method.
176 * \param[in] visc_numerics - Description of the numerical method.
177 * \param[in] config - Definition of the particular problem.
178 * \param[in] val_marker - Surface marker where the boundary condition is applied.
179 */
180 void BC_Isothermal_Wall(CGeometry *geometry,
181 CSolver **solver_container,
182 CNumerics *conv_numerics,
183 CNumerics *visc_numerics,
184 CConfig *config,
185 unsigned short val_marker) override;
186
187 /*!
188 * \brief Impose the inlet boundary condition.
189 * \param[in] geometry - Geometrical definition of the problem.
190 * \param[in] solver_container - Container vector with all the solutions.
191 * \param[in] conv_numerics - Description of the numerical method.
192 * \param[in] visc_numerics - Description of the numerical method.
193 * \param[in] config - Definition of the particular problem.
194 * \param[in] val_marker - Surface marker where the boundary condition is applied.
195 */
196 void BC_Inlet(CGeometry *geometry,
197 CSolver **solver_container,
198 CNumerics *conv_numerics,
199 CNumerics *visc_numerics,
200 CConfig *config,
201 unsigned short val_marker) override;
202
203 /*!
204 * \brief Impose the inlet boundary condition.
205 * \param[in] geometry - Geometrical definition of the problem.
206 * \param[in] solver_container - Container vector with all the solutions.
207 * \param[in] conv_numerics - Description of the numerical method.
208 * \param[in] visc_numerics - Description of the numerical method.
209 * \param[in] config - Definition of the particular problem.
210 * \param[in] val_marker - Surface marker where the boundary condition is applied.
211 */
212 void BC_Inlet_Turbo(CGeometry *geometry,
213 CSolver **solver_container,
214 CNumerics *conv_numerics,
215 CNumerics *visc_numerics,
216 CConfig *config,
217 unsigned short val_marker) override;
218
219 /*!
220 * \brief Impose the inlet boundary condition.
221 * \param[in] geometry - Geometrical definition of the problem.
222 * \param[in] solver_container - Container vector with all the solutions.
223 * \param[in] conv_numerics - Description of the numerical method.
224 * \param[in] visc_numerics - Description of the numerical method.
225 * \param[in] config - Definition of the particular problem.
226 * \param[in] val_marker - Surface marker where the boundary condition is applied.
227 */
228 void BC_Inlet_MixingPlane(CGeometry *geometry,
229 CSolver **solver_container,
230 CNumerics *conv_numerics,
231 CNumerics *visc_numerics,
232 CConfig *config,
233 unsigned short val_marker) override;
234 /*!
235 * \brief Impose the outlet boundary condition.
236 * \param[in] geometry - Geometrical definition of the problem.
237 * \param[in] solver_container - Container vector with all the solutions.
238 * \param[in] conv_numerics - Description of the numerical method.
239 * \param[in] visc_numerics - Description of the numerical method.
240 * \param[in] config - Definition of the particular problem.
241 * \param[in] val_marker - Surface marker where the boundary condition is applied.
242 */
243 void BC_Outlet(CGeometry *geometry,
244 CSolver **solver_container,
245 CNumerics *conv_numerics,
246 CNumerics *visc_numerics,
247 CConfig *config,
248 unsigned short val_marker) override;
249
250 /*!
251 * \brief Impose the far-field boundary condition, via the CScalarFlux_SST edge kernel.
252 * \param[in] geometry - Geometrical definition of the problem.
253 * \param[in] solver_container - Container vector with all the solutions.
254 * \param[in] conv_numerics - Unused, kept only for the boundary condition dispatch.
255 * \param[in] visc_numerics - Unused, kept only for the boundary condition dispatch.
256 * \param[in] config - Definition of the particular problem.
257 * \param[in] val_marker - Surface marker where the boundary condition is applied.
258 */
259 void BC_Far_Field(CGeometry *geometry,
260 CSolver **solver_container,
261 CNumerics *conv_numerics,
262 CNumerics *visc_numerics,
263 CConfig *config,
264 unsigned short val_marker) override;
265
266 /*!
267 * \brief Impose the fluid interface (sliding mesh) boundary condition, via the CScalarFlux_SST
268 * edge kernel. The convective term is a per-donor weighted average, computed in the same
269 * pass that fills the ghost row of each donor; the diffusive term is computed once per
270 * vertex, after the donor loop, from the ghost state the last donor left behind.
271 * \param[in] geometry - Geometrical definition of the problem.
272 * \param[in] solver_container - Container vector with all the solutions.
273 * \param[in] conv_numerics - Unused, kept only for the boundary condition dispatch.
274 * \param[in] visc_numerics - Unused, kept only for the boundary condition dispatch.
275 * \param[in] config - Definition of the particular problem.
276 */
277 void BC_Fluid_Interface(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics,
278 CNumerics *visc_numerics, CConfig *config) override;
279
280 /*!
281 * \brief Get the constants for the SST model.
282 * \return A pointer to an array containing a set of constants
283 */
284 inline const su2double* GetConstants() const override { return constants; }
285
286 /*!
287 * \brief Store of a set of provided inlet profile values at a vertex.
288 * \param[in] val_inlet - vector containing the inlet values for the current vertex.
289 * \param[in] iMarker - Surface marker where the coefficient is computed.
290 * \param[in] iVertex - Vertex of the marker <i>iMarker</i> where the inlet is being set.
291 */
292 void SetInletAtVertex(const su2double *val_inlet,
293 unsigned short iMarker,
294 unsigned long iVertex) override;
295
296 /*!
297 * \brief Get the set of values imposed at an inlet.
298 * \param[in] iMarker - Index of the surface marker.
299 * \param[in] iVertex - Vertex of the marker <i>iMarker</i> where the inlet is being set.
300 * \param[in] geometry - Geometrical definition of the problem.
301 * \param[in,out] val_inlet - vector returning the inlet values for the current vertex.
302 * \return Value of the face area at the vertex.
303 */
304 su2double GetInletAtVertex(unsigned short iMarker, unsigned long iVertex,
305 const CGeometry* geometry, su2double* val_inlet) const override;
306
307 /*!
308 * \brief Set a uniform inlet profile
309 *
310 * The values at the inlet are set to match the values specified for
311 * inlets in the configuration file.
312 *
313 * \param[in] config - Definition of the particular problem.
314 * \param[in] iMarker - Surface marker where the coefficient is computed.
315 */
316 void SetUniformInlet(const CConfig* config, unsigned short iMarker) override;
317
318 /*!
319 * \brief Get the value of the turbulent kinetic energy.
320 * \return Value of the turbulent kinetic energy.
321 */
322 inline su2double GetTke_Inf(void) const override { return Solution_Inf[0]; }
323
324 /*!
325 * \brief Get the value of the turbulent frequency.
326 * \return Value of the turbulent frequency.
327 */
328 inline su2double GetOmega_Inf(void) const override { return Solution_Inf[1]; }
329
330};
Headers of the CTurbSolver class.
Main class for defining the problem; basically this class reads the configuration file,...
Definition CConfig.hpp:64
Parent class for defining the geometry of the problem (complete geometry, multigrid agglomerated geom...
Definition CGeometry.hpp:75
Class for defining the numerical methods.
Definition CNumerics.hpp:48
su2double Solution_Inf[MAXNVAR]
Far-field solution.
Definition CScalarSolver.hpp:73
Definition CSolver.hpp:71
Main class for defining the turbulence model solver.
Definition CTurbSSTSolver.hpp:38
void BC_Inlet_Turbo(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) override
Impose the inlet boundary condition.
Definition CTurbSSTSolver.cpp:754
void BC_Fluid_Interface(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config) override
Impose the fluid interface (sliding mesh) boundary condition, via the CScalarFlux_SST edge kernel....
Definition CTurbSSTSolver.cpp:822
void BC_Far_Field(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) override
Impose the far-field boundary condition, via the CScalarFlux_SST edge kernel.
Definition CTurbSSTSolver.cpp:685
void Source_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container, CConfig *config, unsigned short iMesh) override
Source term computation.
Definition CTurbSSTSolver.cpp:318
const su2double * GetConstants() const override
Get the constants for the SST model.
Definition CTurbSSTSolver.hpp:284
su2double GetInletAtVertex(unsigned short iMarker, unsigned long iVertex, const CGeometry *geometry, su2double *val_inlet) const override
Get the set of values imposed at an inlet.
Definition CTurbSSTSolver.cpp:853
void SetInletAtVertex(const su2double *val_inlet, unsigned short iMarker, unsigned long iVertex) override
Store of a set of provided inlet profile values at a vertex.
Definition CTurbSSTSolver.cpp:843
void Source_Template(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CConfig *config, unsigned short iMesh) override
Source term computation.
Definition CTurbSSTSolver.cpp:414
~CTurbSSTSolver()=default
Destructor of the class.
void Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output) override
Restart residual and compute gradients.
Definition CTurbSSTSolver.cpp:205
void BC_Outlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) override
Impose the outlet boundary condition.
Definition CTurbSSTSolver.cpp:660
void Upwind_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container, CConfig *config, unsigned short iMesh) override
Compute the spatial integration using the CScalarFlux_SST edge kernel, which computes and writes both...
Definition CTurbSSTSolver.cpp:299
void BC_Inlet_MixingPlane(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) override
Impose the inlet boundary condition.
Definition CTurbSSTSolver.cpp:705
void Postprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh) override
Computes the eddy viscosity.
Definition CTurbSSTSolver.cpp:214
void BC_Isothermal_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) override
Impose the Navier-Stokes wall boundary condition.
Definition CTurbSSTSolver.cpp:595
void SetUniformInlet(const CConfig *config, unsigned short iMarker) override
Set a uniform inlet profile.
Definition CTurbSSTSolver.cpp:867
void BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) override
Impose the Navier-Stokes wall boundary condition.
Definition CTurbSSTSolver.cpp:419
void BC_Inlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) override
Impose the inlet boundary condition.
Definition CTurbSSTSolver.cpp:603
su2double GetOmega_Inf(void) const override
Get the value of the turbulent frequency.
Definition CTurbSSTSolver.hpp:328
su2double GetTke_Inf(void) const override
Get the value of the turbulent kinetic energy.
Definition CTurbSSTSolver.hpp:322
Main class for defining the turbulence model solver.
Definition CTurbSolver.hpp:40
passivedouble su2double
Definition code_config.hpp:181
Structure containing parsed SST options.
Definition option_structure.hpp:1136
Loop invariant flags for a scalar edge flux, built once outside the edge loop so the compiler can uns...
Definition scalar_edge_flux.hpp:55