Documentation 6b54b78464
Loading...
Searching...
No Matches
adj_sources.hpp
Go to the documentation of this file.
1/*!
2 * \file adj_sources.hpp
3 * \brief Declarations of numerics classes for continuous adjoint
4 * source term integration. Implemented in adj_sources.cpp.
5 * \author F. Palacios, T. Economon
6 * \version 8.5.0 "Harrier"
7 *
8 * SU2 Project Website: https://su2code.github.io
9 *
10 * The SU2 Project is maintained by the SU2 Foundation
11 * (http://su2foundation.org)
12 *
13 * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md)
14 *
15 * SU2 is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU Lesser General Public
17 * License as published by the Free Software Foundation; either
18 * version 2.1 of the License, or (at your option) any later version.
19 *
20 * SU2 is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Lesser General Public License for more details.
24 *
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with SU2. If not, see <http://www.gnu.org/licenses/>.
27 */
28
29#pragma once
30
31#include "../CNumerics.hpp"
32
33/*!
34 * \class CSourceAxisymmetric_AdjFlow
35 * \brief Class for source term for solving axisymmetric problems.
36 * \ingroup SourceDiscr
37 * \author F. Palacios
38 */
40public:
41 /*!
42 * \brief Constructor of the class.
43 * \param[in] val_nDim - Number of dimensions of the problem.
44 * \param[in] val_nVar - Number of variables of the problem.
45 * \param[in] config - Definition of the particular problem.
46 */
47 CSourceAxisymmetric_AdjFlow(unsigned short val_nDim, unsigned short val_nVar, CConfig *config);
48
49 /*!
50 * \brief Destructor of the class.
51 */
53
54 /*!
55 * \brief Residual of the rotational frame source term.
56 * \param[out] val_residual - Pointer to the total residual.
57 * \param[in] config - Definition of the particular problem.
58 */
59 void ComputeResidual(su2double *val_residual, su2double **Jacobian_i, CConfig *config) override;
60};
61
63private:
64 su2double *Velocity, *Residual_i, *Residual_j, *Mean_Residual;
65 su2double **Mean_PrimVar_Grad;
66
67public:
68 /*!
69 * \brief Constructor of the class.
70 * \param[in] val_nDim - Number of dimensions of the problem.
71 * \param[in] val_nVar - Number of variables of the problem.
72 * \param[in] config - Definition of the particular problem.
73 */
74 CSourceConservative_AdjFlow(unsigned short val_nDim, unsigned short val_nVar, CConfig *config);
75
76 /*!
77 * \brief Destructor of the class.
78 */
79 ~CSourceConservative_AdjFlow(void) override;
80
81 /*!
82 * \brief Source term integration using a conservative scheme.
83 * \param[out] val_residual - Pointer to the total residual.
84 * \param[in] config - Definition of the particular problem.
85 */
86 void ComputeResidual(su2double *val_residual, CConfig *config) override;
87};
88
89/*!
90 * \class CSourceRotatingFrame_AdjFlow
91 * \brief Source term class for rotating frame adjoint.
92 * \ingroup SourceDiscr
93 * \author T. Economon.
94 */
96public:
97
98 /*!
99 * \brief Constructor of the class.
100 * \param[in] val_nDim - Number of dimensions of the problem.
101 * \param[in] val_nVar - Number of variables of the problem.
102 * \param[in] config - Definition of the particular problem.
103 */
104 CSourceRotatingFrame_AdjFlow(unsigned short val_nDim, unsigned short val_nVar, CConfig *config);
105
106 /*!
107 * \brief Destructor of the class.
108 */
110
111 /*!
112 * \brief Residual of the adjoint rotating frame source term.
113 * \param[out] val_residual - Pointer to the total residual.
114 * \param[out] val_Jacobian_i - Jacobian of the numerical method at node i (implicit computation).
115 * \param[in] config - Definition of the particular problem.
116 */
117 void ComputeResidual(su2double *val_residual, su2double **val_Jacobian_i, CConfig *config) override;
118};
119
120/*!
121 * \class CSourceViscous_AdjFlow
122 * \brief Class for source term integration in adjoint problem.
123 * \ingroup SourceDiscr
124 * \author F. Palacios
125 */
127private:
128 su2double *Velocity, *GradDensity, *GradInvDensity, *dPoDensity2, *alpha, *beta, *Sigma_5_vec;
129 su2double **GradVel_o_Rho, **sigma, **Sigma_phi, **Sigma_5_Tensor, **Sigma;
130
131public:
132
133 /*!
134 * \brief Constructor of the class.
135 * \param[in] val_nDim - Number of dimensions of the problem.
136 * \param[in] val_nVar - Number of variables of the problem.
137 * \param[in] config - Definition of the particular problem.
138 */
139 CSourceViscous_AdjFlow(unsigned short val_nDim, unsigned short val_nVar, CConfig *config);
140
141 /*!
142 * \brief Destructor of the class.
143 */
144 ~CSourceViscous_AdjFlow(void) override;
145
146 /*!
147 * \brief Source term integration of the flow adjoint equation.
148 * \param[out] val_residual - Pointer to the total residual.
149 * \param[in] config - Definition of the particular problem.
150 */
151 void ComputeResidual (su2double *val_residual, CConfig *config) override;
152
153};
154
155/*!
156 * \class CSourceConservative_AdjTurb
157 * \brief Class for source term integration in adjoint turbulent problem using a conservative scheme.
158 * \ingroup SourceDiscr
159 * \author A. Bueno.
160 */
162public:
163
164 /*!
165 * \brief Constructor of the class.
166 * \param[in] val_nDim - Number of dimensions of the problem.
167 * \param[in] val_nVar - Number of variables of the problem.
168 * \param[in] config - Definition of the particular problem.
169 */
170 CSourceConservative_AdjTurb(unsigned short val_nDim, unsigned short val_nVar, CConfig *config);
171
172 /*!
173 * \brief Destructor of the class.
174 */
176
177 /*!
178 * \brief Source term integration using a conservative scheme.
179 * \param[out] val_residual - Pointer to the total residual.
180 * \param[out] val_Jacobian_i - Jacobian of the numerical method at node i (implicit computation).
181 * \param[out] val_Jacobian_j - Jacobian of the numerical method at node j (implicit computation).
182 * \param[in] config - Definition of the particular problem.
183 */
184 void ComputeResidual(su2double *val_residual, su2double **val_Jacobian_i, su2double **val_Jacobian_j, CConfig *config) override;
185};
186
187/*!
188 * \class CSourcePieceWise_AdjTurb
189 * \brief Class for source term integration of the adjoint turbulent equation.
190 * \ingroup SourceDiscr
191 * \author A. Bueno.
192 */
194private:
195 su2double **tau, *Velocity;
196
197public:
198
199 /*!
200 * \brief Constructor of the class.
201 * \param[in] val_nDim - Number of dimensions of the problem.
202 * \param[in] val_nVar - Number of variables of the problem.
203 * \param[in] config - Definition of the particular problem.
204 */
205 CSourcePieceWise_AdjTurb(unsigned short val_nDim, unsigned short val_nVar, CConfig *config);
206
207 /*!
208 * \brief Destructor of the class.
209 */
210 ~CSourcePieceWise_AdjTurb(void) override;
211
212 /*!
213 * \brief Source term integration of the adjoint turbulence equation.
214 * \param[out] val_residual - Pointer to the total residual.
215 * \param[out] val_Jacobian_i - Jacobian of the numerical method at node i (implicit computation).
216 * \param[out] val_Jacobian_j - Jacobian of the numerical method at node j (implicit computation).
217 * \param[in] config - Definition of the particular problem.
218 */
219 void ComputeResidual(su2double *val_residual, su2double **val_Jacobian_i, su2double **val_Jacobian_j, CConfig *config) override;
220};
Main class for defining the problem; basically this class reads the configuration file,...
Definition CConfig.hpp:64
Class for defining the numerical methods.
Definition CNumerics.hpp:48
Class for source term for solving axisymmetric problems.
Definition adj_sources.hpp:39
void ComputeResidual(su2double *val_residual, su2double **Jacobian_i, CConfig *config) override
Residual of the rotational frame source term.
Definition adj_sources.cpp:34
~CSourceAxisymmetric_AdjFlow(void) override
Destructor of the class.
Definition adj_sources.hpp:62
void ComputeResidual(su2double *val_residual, CConfig *config) override
Source term integration using a conservative scheme.
Definition adj_sources.cpp:102
~CSourceConservative_AdjFlow(void) override
Destructor of the class.
Definition adj_sources.cpp:91
Class for source term integration in adjoint turbulent problem using a conservative scheme.
Definition adj_sources.hpp:161
~CSourceConservative_AdjTurb(void) override
Destructor of the class.
void ComputeResidual(su2double *val_residual, su2double **val_Jacobian_i, su2double **val_Jacobian_j, CConfig *config) override
Source term integration using a conservative scheme.
Definition adj_sources.cpp:621
Class for source term integration of the adjoint turbulent equation.
Definition adj_sources.hpp:193
void ComputeResidual(su2double *val_residual, su2double **val_Jacobian_i, su2double **val_Jacobian_j, CConfig *config) override
Source term integration of the adjoint turbulence equation.
Definition adj_sources.cpp:669
~CSourcePieceWise_AdjTurb(void) override
Destructor of the class.
Definition adj_sources.cpp:661
Source term class for rotating frame adjoint.
Definition adj_sources.hpp:95
~CSourceRotatingFrame_AdjFlow(void) override
Destructor of the class.
void ComputeResidual(su2double *val_residual, su2double **val_Jacobian_i, CConfig *config) override
Residual of the adjoint rotating frame source term.
Definition adj_sources.cpp:243
Class for source term integration in adjoint problem.
Definition adj_sources.hpp:126
void ComputeResidual(su2double *val_residual, CConfig *config) override
Source term integration of the flow adjoint equation.
Definition adj_sources.cpp:355
~CSourceViscous_AdjFlow(void) override
Destructor of the class.
Definition adj_sources.cpp:328
passivedouble su2double
Definition code_config.hpp:181