Documentation 6b54b78464
Loading...
Searching...
No Matches
CAdjNSSolver.hpp
Go to the documentation of this file.
1/*!
2 * \file CAdjNSSolver.hpp
3 * \brief Headers of the CAdjNSSolver class
4 * \author F. Palacios
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 "CAdjEulerSolver.hpp"
31
32/*!
33 * \class CAdjNSSolver
34 * \brief Main class for defining the Navier-Stokes' adjoint flow solver.
35 * \ingroup Navier_Stokes_Equations
36 * \author F. Palacios
37 */
38class CAdjNSSolver final : public CAdjEulerSolver {
39public:
40
41 /*!
42 * \brief Constructor of the class.
43 */
44 CAdjNSSolver(void);
45
46 /*!
47 * \overload
48 * \param[in] geometry - Geometrical definition of the problem.
49 * \param[in] config - Definition of the particular problem.
50 * \param[in] iMesh - Index of the mesh in multigrid computations.
51 */
52 CAdjNSSolver(CGeometry *geometry, CConfig *config, unsigned short iMesh);
53
54 /*!
55 * \brief Destructor of the class.
56 */
57 ~CAdjNSSolver(void) override;
58
59 /*!
60 * \brief A virtual member.
61 * \param[in] geometry - Geometrical definition of the problem.
62 * \param[in] solver_container - Container vector with all the solutions.
63 * \param[in] config - Definition of the particular problem.
64 * \param[in] iMesh - Index of the mesh in multigrid computations.
65 * \param[in] Iteration - Index of the current iteration.
66 */
67 void SetTime_Step(CGeometry *geometry,
68 CSolver **solver_container,
69 CConfig *config,
70 unsigned short iMesh,
71 unsigned long Iteration) override;
72
73
74 /*!
75 * \brief Impose via the residual or brute force the Navier-Stokes adjoint boundary condition (heat flux).
76 * \param[in] geometry - Geometrical definition of the problem.
77 * \param[in] solver_container - Container vector with all the solutions.
78 * \param[in] conv_numerics - Description of the numerical method.
79 * \param[in] visc_numerics - Description of the numerical method.
80 * \param[in] config - Definition of the particular problem.
81 * \param[in] val_marker - Surface marker where the boundary condition is applied.
82 */
83 void BC_HeatFlux_Wall(CGeometry *geometry,
84 CSolver **solver_container,
85 CNumerics *conv_numerics,
86 CNumerics *visc_numerics,
87 CConfig *config,
88 unsigned short val_marker) override;
89
90 /*!
91 * \brief Impose via the residual or brute force the Navier-Stokes adjoint boundary condition (heat flux).
92 * \param[in] geometry - Geometrical definition of the problem.
93 * \param[in] solver_container - Container vector with all the solutions.
94 * \param[in] conv_numerics - Description of the numerical method.
95 * \param[in] visc_numerics - Description of the numerical method.
96 * \param[in] config - Definition of the particular problem.
97 * \param[in] val_marker - Surface marker where the boundary condition is applied.
98 */
99 void BC_Isothermal_Wall(CGeometry *geometry,
100 CSolver **solver_container,
101 CNumerics *conv_numerics,
102 CNumerics *visc_numerics,
103 CConfig *config,
104 unsigned short val_marker) override;
105
106 /*!
107 * \brief Restart residual and compute gradients.
108 * \param[in] geometry - Geometrical definition of the problem.
109 * \param[in] solver_container - Container vector with all the solutions.
110 * \param[in] config - Definition of the particular problem.
111 * \param[in] iRKStep - Current step of the Runge-Kutta iteration.
112 * \param[in] RunTime_EqSystem - System of equations which is going to be solved.
113 * \param[in] Output - boolean to determine whether to print output.
114 */
115 void Preprocessing(CGeometry *geometry,
116 CSolver **solver_container,
117 CConfig *config,
118 unsigned short iMesh,
119 unsigned short iRKStep,
120 unsigned short RunTime_EqSystem,
121 bool Output) override;
122
123 /*!
124 * \brief Compute the viscous sensitivity of the functional.
125 * \param[in] geometry - Geometrical definition of the problem.
126 * \param[in] solver_container - Container vector with all the solutions.
127 * \param[in] numerics_container - Description of the numerical method.
128 * \param[in] config - Definition of the particular problem.
129 */
130 void Viscous_Sensitivity(CGeometry *geometry,
131 CSolver **solver_container,
132 CNumerics *numerics,
133 CConfig *config) override;
134
135 /*!
136 * \brief Compute the viscous residuals for the adjoint equation.
137 * \param[in] geometry - Geometrical definition of the problem.
138 * \param[in] solver_container - Container vector with all the solutions.
139 * \param[in] numerics - Description of the numerical method.
140 * \param[in] config - Definition of the particular problem.
141 * \param[in] iMesh - Index of the mesh in multigrid computations.
142 * \param[in] iRKStep - Current step of the Runge-Kutta iteration.
143 */
144 void Viscous_Residual(CGeometry *geometry,
145 CSolver **solver_container,
146 CNumerics **numerics_container,
147 CConfig *config,
148 unsigned short iMesh,
149 unsigned short iRKStep) override;
150
151 /*!
152 * \brief Source term computation.
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 */
159 void Source_Residual(CGeometry *geometry,
160 CSolver **solver_container,
161 CNumerics **numerics_container,
162 CConfig *config,
163 unsigned short iMesh) override;
164
165};
Headers of the CAdjEulerSolver class.
Main class for defining the Euler's adjoint flow solver.
Definition CAdjEulerSolver.hpp:39
Main class for defining the Navier-Stokes' adjoint flow solver.
Definition CAdjNSSolver.hpp:38
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 CAdjNSSolver.cpp:304
void BC_Isothermal_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) override
Impose via the residual or brute force the Navier-Stokes adjoint boundary condition (heat flux).
Definition CAdjNSSolver.cpp:1534
void SetTime_Step(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned long Iteration) override
A virtual member.
Definition CAdjNSSolver.cpp:293
void Source_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container, CConfig *config, unsigned short iMesh) override
Source term computation.
Definition CAdjNSSolver.cpp:445
~CAdjNSSolver(void) override
Destructor of the class.
void Viscous_Sensitivity(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CConfig *config) override
Compute the viscous sensitivity of the functional.
Definition CAdjNSSolver.cpp:588
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 adjoint equation.
Definition CAdjNSSolver.cpp:394
void BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) override
Impose via the residual or brute force the Navier-Stokes adjoint boundary condition (heat flux).
Definition CAdjNSSolver.cpp:1171
CAdjNSSolver(void)
Constructor of the class.
Definition CAdjNSSolver.cpp:33
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