Documentation 6b54b78464
Loading...
Searching...
No Matches
CAdjTurbSolver.hpp
Go to the documentation of this file.
1/*!
2 * \file CAdjTurbSolver.hpp
3 * \brief Headers of the CAdjTurbSolver class
4 * \author F. Palacios, A. Bueno.
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 "CSolver.hpp"
31#include "../variables/CAdjTurbVariable.hpp"
32
33/*!
34 * \class CAdjTurbSolver
35 * \brief Main class for defining the adjoint turbulence model solver.
36 * \ingroup Turbulence_Model
37 * \author F. Palacios, A. Bueno.
38 */
39class CAdjTurbSolver final : public CSolver {
40private:
41 su2double *FlowSolution_i; /*!< \brief Store the flow solution at point i. */
42 su2double *FlowSolution_j; /*!< \brief Store the flow solution at point j. */
43
44 su2double Gamma; /*!< \brief Fluid's Gamma constant (ratio of specific heats). */
45 su2double Gamma_Minus_One; /*!< \brief Fluids's Gamma - 1.0 . */
46
47 CAdjTurbVariable* nodes = nullptr; /*!< \brief The highest level in the variable hierarchy this solver can safely use. */
48
49 /*!
50 * \brief Return nodes to allow CSolver::base_nodes to be set.
51 */
52 inline CVariable* GetBaseClassPointerToNodes() override { return nodes; }
53
54public:
55
56 /*!
57 * \brief Default constructor of the class.
58 */
59 CAdjTurbSolver(void);
60
61 /*!
62 * \overload
63 * \param[in] geometry - Geometrical definition of the problem.
64 * \param[in] config - Definition of the particular problem.
65 */
66 CAdjTurbSolver(CGeometry *geometry, CConfig *config, unsigned short iMesh);
67
68 /*!
69 * \brief Default destructor of the class.
70 */
71 ~CAdjTurbSolver(void) override;
72
73 /*!
74 * \brief Impose the Navier-Stokes turbulent adjoint boundary condition.
75 * \param[in] geometry - Geometrical definition of the problem.
76 * \param[in] solver_container - Container vector with all the solutions.
77 * \param[in] conv_numerics - Description of the numerical method.
78 * \param[in] visc_numerics - Description of the numerical method.
79 * \param[in] config - Definition of the particular problem.
80 * \param[in] val_marker - Surface marker where the boundary condition is applied.
81 */
82 void BC_HeatFlux_Wall(CGeometry *geometry,
83 CSolver **solver_container,
84 CNumerics *conv_numerics,
85 CNumerics *visc_numerics,
86 CConfig *config,
87 unsigned short val_marker) override;
88 /*!
89 * \brief Impose an isothermal wall boundary condition (no-slip).
90 * \param[in] geometry - Geometrical definition of the problem.
91 * \param[in] solver_container - Container vector with all the solutions.
92 * \param[in] conv_numerics - Description of the numerical method.
93 * \param[in] visc_numerics - Description of the numerical method.
94 * \param[in] config - Definition of the particular problem.
95 * \param[in] val_marker - Surface marker where the boundary condition is applied.
96 */
97 void BC_Isothermal_Wall(CGeometry *geometry,
98 CSolver **solver_container,
99 CNumerics *conv_numerics,
100 CNumerics *visc_numerics,
101 CConfig *config,
102 unsigned short val_marker) override;
103
104 /*!
105 * \brief Impose the boundary condition to the far field using characteristics.
106 * \param[in] geometry - Geometrical definition of the problem.
107 * \param[in] solver_container - Container vector with all the solutions.
108 * \param[in] conv_numerics - Description of the numerical method.
109 * \param[in] visc_numerics - Description of the numerical method.
110 * \param[in] config - Definition of the particular problem.
111 * \param[in] val_marker - Surface marker where the boundary condition is applied.
112 */
113 void BC_Far_Field(CGeometry *geometry,
114 CSolver **solver_container,
115 CNumerics *conv_numerics,
116 CNumerics *visc_numerics,
117 CConfig *config,
118 unsigned short val_marker) override;
119
120 /*!
121 * \brief Initializate the residual vectors.
122 * \param[in] geometry - Geometrical definition of the problem.
123 * \param[in] solver_container - Container vector with all the solutions.
124 * \param[in] config - Definition of the particular problem.
125 * \param[in] iRKStep - Current step of the Runge-Kutta iteration.
126 * \param[in] RunTime_EqSystem - System of equations which is going to be solved.
127 * \param[in] Output - boolean to determine whether to print output.
128 */
129 void Preprocessing(CGeometry *geometry,
130 CSolver **solver_container,
131 CConfig *config,
132 unsigned short iMesh,
133 unsigned short iRKStep,
134 unsigned short RunTime_EqSystem,
135 bool Output) override;
136
137 /*!
138 * \brief Compute the spatial integration using a upwind scheme.
139 * \param[in] geometry - Geometrical definition of the problem.
140 * \param[in] solver_container - Container vector with all the solutions.
141 * \param[in] numerics_container - Description of the numerical method.
142 * \param[in] config - Definition of the particular problem.
143 * \param[in] iMesh - Index of the mesh in multigrid computations.
144 */
145 void Upwind_Residual(CGeometry *geometry,
146 CSolver **solver_container,
147 CNumerics **numerics_container,
148 CConfig *config,
149 unsigned short iMesh) override;
150
151 /*!
152 * \brief Compute the viscous residuals for the turbulent adjoint equation.
153 * \param[in] geometry - Geometrical definition of the problem.
154 * \param[in] solver_container - Container vector with all the solutions.
155 * \param[in] numerics_container - Description of the numerical method.
156 * \param[in] config - Definition of the particular problem.
157 * \param[in] iMesh - Index of the mesh in multigrid computations.
158 * \param[in] iRKStep - Current step of the Runge-Kutta iteration.
159 */
160 void Viscous_Residual(CGeometry *geometry,
161 CSolver **solver_container,
162 CNumerics **numerics_container,
163 CConfig *config,
164 unsigned short iMesh,
165 unsigned short iRKStep) override;
166
167 /*!
168 * \brief Source term computation.
169 * \param[in] geometry - Geometrical definition of the problem.
170 * \param[in] solver_container - Container vector with all the solutions.
171 * \param[in] numerics_container - Description of the numerical method.
172 * \param[in] config - Definition of the particular problem.
173 * \param[in] iMesh - Index of the mesh in multigrid computations.
174 */
175 void Source_Residual(CGeometry *geometry,
176 CSolver **solver_container,
177 CNumerics **numerics_container,
178 CConfig *config,
179 unsigned short iMesh) override;
180
181 /*!
182 * \brief Update the solution using an implicit solver.
183 * \param[in] geometry - Geometrical definition of the problem.
184 * \param[in] solver_container - Container vector with all the solutions.
185 * \param[in] config - Definition of the particular problem.
186 */
187 void ImplicitEuler_Iteration(CGeometry *geometry,
188 CSolver **solver_container,
189 CConfig *config) override;
190
191};
Headers of the CSolver class which is inherited by all of the other solvers.
Main class for defining the adjoint turbulence model solver.
Definition CAdjTurbSolver.hpp:39
void ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config) override
Update the solution using an implicit solver.
Definition CAdjTurbSolver.cpp:456
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 turbulent adjoint boundary condition.
Definition CAdjTurbSolver.cpp:172
~CAdjTurbSolver(void) override
Default destructor of the class.
Definition CAdjTurbSolver.cpp:167
void Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output) override
Initializate the residual vectors.
Definition CAdjTurbSolver.cpp:250
void Upwind_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container, CConfig *config, unsigned short iMesh) override
Compute the spatial integration using a upwind scheme.
Definition CAdjTurbSolver.cpp:267
void Source_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container, CConfig *config, unsigned short iMesh) override
Source term computation.
Definition CAdjTurbSolver.cpp:367
void Viscous_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep) override
Compute the viscous residuals for the turbulent adjoint equation.
Definition CAdjTurbSolver.cpp:317
void BC_Isothermal_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) override
Impose an isothermal wall boundary condition (no-slip).
Definition CAdjTurbSolver.cpp:197
void BC_Far_Field(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) override
Impose the boundary condition to the far field using characteristics.
Definition CAdjTurbSolver.cpp:222
CAdjTurbSolver(void)
Default constructor of the class.
Definition CAdjTurbSolver.cpp:31
Main class for defining the variables of the adjoint turbulence model.
Definition CAdjTurbVariable.hpp:38
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
Definition CSolver.hpp:71
Main class for defining the variables.
Definition CVariable.hpp:50
passivedouble su2double
Definition code_config.hpp:181