Documentation 6b54b78464
Loading...
Searching...
No Matches
ausm_slau.hpp
Go to the documentation of this file.
1/*!
2 * \file ausm_slau.hpp
3 * \brief Declaration of numerics classes for the AUSM family of schemes,
4 * including SLAU. The implementation is in ausm.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 CUpwAUSMPLUS_SLAU_Base_Flow
35 * \brief Base class for AUSM+up(2) and SLAU(2) convective schemes.
36 * \ingroup ConvDiscr
37 * \author Amit Sachdeva, P. Gomes
38 */
40protected:
45
48 su2double *psi_i = nullptr, *psi_j = nullptr;
50
51 /*--- Roe variables (for approximate Jacobian) ---*/
52 su2double *Lambda = nullptr, *Epsilon = nullptr, RoeVelocity[MAXNDIM] = {0.0};
53 su2double **P_Tensor = nullptr, **invP_Tensor = nullptr;
54
55 su2double* Flux = nullptr; /*!< \brief The flux accross the face. */
56 su2double** Jacobian_i = nullptr; /*!< \brief The Jacobian w.r.t. point i after computation. */
57 su2double** Jacobian_j = nullptr; /*!< \brief The Jacobian w.r.t. point j after computation. */
58
59 /*!
60 * \brief Compute the mass flux and pressure based on Primitives_i/j, derived classes must implement this method.
61 * \note See the body of the (empty) default implementation for instructions on how to implement the method.
62 * \param[in] config - Definition of the particular problem.
63 * \param[out] mdot - The mass flux.
64 * \param[out] pressure - The pressure at the control volume face.
65 */
66 virtual void ComputeMassAndPressureFluxes(const CConfig* config, su2double &mdot, su2double &pressure) = 0;
67
68private:
69 /*!
70 * \brief Compute the flux Jacobians of the Roe scheme to use as an approximation.
71 * \param[out] val_Jacobian_i - Jacobian of the numerical method at node i (implicit computation).
72 * \param[out] val_Jacobian_j - Jacobian of the numerical method at node j (implicit computation).
73 */
74 void ApproximateJacobian(su2double **val_Jacobian_i, su2double **val_Jacobian_j);
75
76 /*!
77 * \brief Compute the flux Jacobians using a mix of finite differences and manual differentiation.
78 * \param[out] val_Jacobian_i - Jacobian of the numerical method at node i (implicit computation).
79 * \param[out] val_Jacobian_j - Jacobian of the numerical method at node j (implicit computation).
80 */
81 void AccurateJacobian(const CConfig* config, su2double **val_Jacobian_i, su2double **val_Jacobian_j);
82
83public:
84
85 /*!
86 * \brief Constructor of the class.
87 * \param[in] val_nDim - Number of dimensions of the problem.
88 * \param[in] val_nVar - Number of variables of the problem.
89 * \param[in] config - Definition of the particular problem.
90 */
91 CUpwAUSMPLUS_SLAU_Base_Flow(unsigned short val_nDim, unsigned short val_nVar, const CConfig* config);
92
93 /*!
94 * \brief Destructor of the class.
95 */
96 ~CUpwAUSMPLUS_SLAU_Base_Flow(void) override;
97
98 /*!
99 * \brief Compute the AUSM+ and SLAU family of schemes.
100 * \param[in] config - Definition of the particular problem.
101 * \return A lightweight const-view (read-only) of the residual/flux and Jacobians.
102 */
103 ResidualType<> ComputeResidual(const CConfig* config) final;
104
105};
106
107/*!
108 * \class CUpwAUSMPLUSUP_Flow
109 * \brief Class for solving an approximate Riemann AUSM+ -up.
110 * \ingroup ConvDiscr
111 * \author Amit Sachdeva, P. Gomes
112 */
114private:
115 su2double Kp, Ku, sigma;
116
117 /*!
118 * \brief Mass flux and pressure for the AUSM+up scheme.
119 * \param[in] config - Definition of the particular problem.
120 * \param[out] mdot - The mass flux.
121 * \param[out] pressure - The pressure at the control volume face.
122 */
123 void ComputeMassAndPressureFluxes(const CConfig* config, su2double &mdot, su2double &pressure) override;
124
125public:
126
127 /*!
128 * \brief Constructor of the class.
129 * \param[in] val_nDim - Number of dimensions of the problem.
130 * \param[in] val_nVar - Number of variables of the problem.
131 * \param[in] config - Definition of the particular problem.
132 */
133 CUpwAUSMPLUSUP_Flow(unsigned short val_nDim, unsigned short val_nVar, const CConfig* config);
134
135};
136
137/*!
138 * \class CUpwAUSMPLUSUP2_Flow
139 * \brief Class for solving an approximate Riemann AUSM+ -up.
140 * \ingroup ConvDiscr
141 * \author Amit Sachdeva, P. Gomes
142 */
144private:
145 su2double Kp, sigma;
146
147 /*!
148 * \brief Mass flux and pressure for the AUSM+up2 scheme.
149 * \param[in] config - Definition of the particular problem.
150 * \param[out] mdot - The mass flux.
151 * \param[out] pressure - The pressure at the control volume face.
152 */
153 void ComputeMassAndPressureFluxes(const CConfig* config, su2double &mdot, su2double &pressure) override;
154
155public:
156
157 /*!
158 * \brief Constructor of the class.
159 * \param[in] val_nDim - Number of dimensions of the problem.
160 * \param[in] val_nVar - Number of variables of the problem.
161 * \param[in] config - Definition of the particular problem.
162 */
163 CUpwAUSMPLUSUP2_Flow(unsigned short val_nDim, unsigned short val_nVar, const CConfig* config);
164
165};
166
167/*!
168 * \class CUpwSLAU_Flow
169 * \brief Class for solving the Low-Dissipation AUSM.
170 * \ingroup ConvDiscr
171 * \author E. Molina, P. Gomes
172 */
174protected:
176 bool slau2;
177
178 /*!
179 * \brief Mass flux and pressure for the SLAU and SLAU2 schemes.
180 * \param[in] config - Definition of the particular problem.
181 * \param[out] mdot - The mass flux.
182 * \param[out] pressure - The pressure at the control volume face.
183 */
184 void ComputeMassAndPressureFluxes(const CConfig* config, su2double &mdot, su2double &pressure) final;
185
186public:
187
188 /*!
189 * \brief Constructor of the class.
190 * \param[in] val_nDim - Number of dimensions of the problem.
191 * \param[in] val_nVar - Number of variables of the problem.
192 * \param[in] config - Definition of the particular problem.
193 */
194 CUpwSLAU_Flow(unsigned short val_nDim, unsigned short val_nVar, const CConfig* config, bool val_low_dissipation);
195
196};
197
198/*!
199 * \class CUpwSLAU2_Flow
200 * \brief Class for solving the Simple Low-Dissipation AUSM 2.
201 * \ingroup ConvDiscr
202 * \author E. Molina, P. Gomes
203 */
204class CUpwSLAU2_Flow final : public CUpwSLAU_Flow {
205public:
206 /*!
207 * \brief Constructor of the class.
208 * \param[in] val_nDim - Number of dimensions of the problem.
209 * \param[in] val_nVar - Number of variables of the problem.
210 * \param[in] config - Definition of the particular problem.
211 */
212 CUpwSLAU2_Flow(unsigned short val_nDim, unsigned short val_nVar, const CConfig* config, bool val_low_dissipation);
213
214};
215
216/*!
217 * \class CUpwAUSM_Flow
218 * \brief Class for solving an approximate Riemann AUSM.
219 * \ingroup ConvDiscr
220 * \author F. Palacios
221 */
222class CUpwAUSM_Flow final : public CNumerics {
223private:
224 bool implicit;
225 su2double *Diff_U;
226 su2double Velocity_i[MAXNDIM], Velocity_j[MAXNDIM], RoeVelocity[MAXNDIM];
227 su2double *ProjFlux_i, *ProjFlux_j;
228 su2double *delta_wave;
229 su2double *Lambda, *Epsilon;
230 su2double **P_Tensor, **invP_Tensor;
231 su2double sq_vel, Proj_ModJac_Tensor_ij, Density_i, Energy_i, SoundSpeed_i, Pressure_i, Enthalpy_i,
232 Density_j, Energy_j, SoundSpeed_j, Pressure_j, Enthalpy_j, R, RoeDensity, RoeEnthalpy, RoeSoundSpeed,
233 ProjVelocity, ProjVelocity_i, ProjVelocity_j;
234 unsigned short iDim, iVar, jVar, kVar;
235 su2double mL, mR, mLP, mRM, mF, pLP, pRM, pF, Phi;
236
237 su2double* Flux; /*!< \brief The flux accross the face. */
238 su2double** Jacobian_i; /*!< \brief The Jacobian w.r.t. point i after computation. */
239 su2double** Jacobian_j; /*!< \brief The Jacobian w.r.t. point j after computation. */
240public:
241
242 /*!
243 * \brief Constructor of the class.
244 * \param[in] val_nDim - Number of dimensions of the problem.
245 * \param[in] val_nVar - Number of variables of the problem.
246 * \param[in] config - Definition of the particular problem.
247 */
248 CUpwAUSM_Flow(unsigned short val_nDim, unsigned short val_nVar, const CConfig* config);
249
250 /*!
251 * \brief Destructor of the class.
252 */
253 ~CUpwAUSM_Flow(void) override;
254
255 /*!
256 * \brief Compute the Roe's flux between two nodes i and j.
257 * \param[in] config - Definition of the particular problem.
258 * \return A lightweight const-view (read-only) of the residual/flux and Jacobians.
259 */
260 ResidualType<> ComputeResidual(const CConfig* config) override;
261
262};
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
static constexpr size_t MAXNDIM
Max number of space dimensions, used in some static arrays.
Definition CNumerics.hpp:50
Class for solving an approximate Riemann AUSM+ -up.
Definition ausm_slau.hpp:143
Class for solving an approximate Riemann AUSM+ -up.
Definition ausm_slau.hpp:113
Base class for AUSM+up(2) and SLAU(2) convective schemes.
Definition ausm_slau.hpp:39
su2double DissFlux
Definition ausm_slau.hpp:46
bool HasAnalyticalDerivatives
Definition ausm_slau.hpp:43
su2double * Lambda
Definition ausm_slau.hpp:52
su2double MassFlux
Definition ausm_slau.hpp:46
su2double ** invP_Tensor
Definition ausm_slau.hpp:53
~CUpwAUSMPLUS_SLAU_Base_Flow(void) override
Destructor of the class.
Definition ausm_slau.cpp:63
su2double dmdot_dVi[6]
Definition ausm_slau.hpp:49
su2double ** Jacobian_i
The Jacobian w.r.t. point i after computation.
Definition ausm_slau.hpp:56
su2double * psi_j
Definition ausm_slau.hpp:48
ResidualType ComputeResidual(const CConfig *config) final
Compute the AUSM+ and SLAU family of schemes.
Definition ausm_slau.cpp:316
su2double dpres_dVi[6]
Definition ausm_slau.hpp:49
su2double * Flux
The flux accross the face.
Definition ausm_slau.hpp:55
su2double RoeVelocity[MAXNDIM]
Definition ausm_slau.hpp:52
su2double FinDiffStep
Definition ausm_slau.hpp:44
su2double ** P_Tensor
Definition ausm_slau.hpp:53
su2double Pressure
Definition ausm_slau.hpp:46
su2double Velocity_i[MAXNDIM]
Definition ausm_slau.hpp:47
bool UseAccurateJacobian
Definition ausm_slau.hpp:42
su2double dmdot_dVj[6]
Definition ausm_slau.hpp:49
su2double * Epsilon
Definition ausm_slau.hpp:52
su2double * psi_i
Definition ausm_slau.hpp:48
su2double Velocity_j[MAXNDIM]
Definition ausm_slau.hpp:47
bool implicit
Definition ausm_slau.hpp:41
su2double ** Jacobian_j
The Jacobian w.r.t. point j after computation.
Definition ausm_slau.hpp:57
virtual void ComputeMassAndPressureFluxes(const CConfig *config, su2double &mdot, su2double &pressure)=0
Compute the mass flux and pressure based on Primitives_i/j, derived classes must implement this metho...
Definition ausm_slau.cpp:84
su2double dpres_dVj[6]
Definition ausm_slau.hpp:49
Class for solving an approximate Riemann AUSM.
Definition ausm_slau.hpp:222
ResidualType ComputeResidual(const CConfig *config) override
Compute the Roe's flux between two nodes i and j.
Definition ausm_slau.cpp:837
~CUpwAUSM_Flow(void) override
Destructor of the class.
Definition ausm_slau.cpp:815
Class for solving the Simple Low-Dissipation AUSM 2.
Definition ausm_slau.hpp:204
Class for solving the Low-Dissipation AUSM.
Definition ausm_slau.hpp:173
void ComputeMassAndPressureFluxes(const CConfig *config, su2double &mdot, su2double &pressure) final
Mass flux and pressure for the SLAU and SLAU2 schemes.
Definition ausm_slau.cpp:720
bool slau2
Definition ausm_slau.hpp:176
bool slau_low_diss
Definition ausm_slau.hpp:175
passivedouble su2double
Definition code_config.hpp:181
Return type used in some "ComputeResidual" overloads to give a const-view of the internally stored fl...
Definition CNumerics.hpp:218