Documentation 6b54b78464
Loading...
Searching...
No Matches
centered.hpp
Go to the documentation of this file.
1/*!
2 * \file centered.hpp
3 * \brief Declaration of numerics classes for centered schemes,
4 * the implementation is in centered.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 CCentLaxInc_Flow
35 * \brief Class for computing the Lax-Friedrich centered scheme (modified with incompressible preconditioning).
36 * \ingroup ConvDiscr
37 * \author F. Palacios, T. Economon
38 */
39class CCentLaxInc_Flow final : public CNumerics {
40private:
41 unsigned short iDim, iVar, jVar; /*!< \brief Iteration on dimension and variables. */
42 su2double *Diff_V, /*!< \brief Difference of primitive variables. */
43 *Velocity_i, *Velocity_j, /*!< \brief Velocity at node 0 and 1. */
44 *MeanVelocity, ProjVelocity_i,
45 ProjVelocity_j, /*!< \brief Mean and projected velocities. */
46 *ProjFlux, /*!< \brief Projected inviscid flux tensor. */
47 sq_vel_i, sq_vel_j, /*!< \brief Modulus of the velocity and the normal vector. */
48 Temperature_i, Temperature_j, /*!< \brief Temperature at node 0 and 1. */
49 MeanDensity, MeanPressure,
50 MeanBetaInc2, MeanEnthalpy,
51 MeanCp, MeanTemperature, /*!< \brief Mean values of primitive variables. */
52 MeandRhodh, /*!< \brief Derivative of density w.r.t. enthalpy (variable density flows). */
53 Param_p, Param_Kappa_0, /*!< \brief Artificial dissipation parameters. */
54 Local_Lambda_i, Local_Lambda_j,
55 MeanLambda, /*!< \brief Local eingenvalues. */
56 Phi_i, Phi_j, sc0,
57 StretchingFactor, /*!< \brief Streching parameters. */
58 Epsilon_0; /*!< \brief Artificial dissipation values. */
59 su2double **Precon;
60 bool implicit, /*!< \brief Implicit calculation. */
61 dynamic_grid, /*!< \brief Modification for grid movement. */
62 variable_density, /*!< \brief Variable density incompressible flows. */
63 energy; /*!< \brief computation with the energy equation. */
64
65 su2double fix_factor; /*!< \brief Fix factor for Jacobians. */
66
67 su2double** Jacobian_i = nullptr; /*!< \brief The Jacobian w.r.t. point i after computation. */
68 su2double** Jacobian_j = nullptr; /*!< \brief The Jacobian w.r.t. point j after computation. */
69
70public:
71 /*!
72 * \brief Constructor of the class.
73 * \param[in] val_nDim - Number of dimension of the problem.
74 * \param[in] val_nVar - Number of variables of the problem.
75 * \param[in] config - Definition of the particular problem.
76 */
77 CCentLaxInc_Flow(unsigned short val_nDim, unsigned short val_nVar, const CConfig* config);
78
79 /*!
80 * \brief Destructor of the class.
81 */
82 ~CCentLaxInc_Flow(void) override;
83
84 /*!
85 * \brief Compute the flow residual using a Lax method.
86 * \param[in] config - Definition of the particular problem.
87 * \return A lightweight const-view (read-only) of the residual/flux and Jacobians.
88 */
89 ResidualType<> ComputeResidual(const CConfig* config) override;
90
91};
92
93/*!
94 * \class CCentJSTInc_Flow
95 * \brief Class for centered scheme - modified JST with incompressible preconditioning.
96 * \ingroup ConvDiscr
97 * \author F. Palacios, T. Economon
98 */
99class CCentJSTInc_Flow final : public CNumerics {
100
101private:
102 unsigned short iDim, iVar, jVar; /*!< \brief Iteration on dimension and variables. */
103 su2double *Diff_V, *Diff_Lapl, /*!< \brief Diference of primitive variables and undivided laplacians. */
104 *Velocity_i, *Velocity_j, /*!< \brief Velocity at node 0 and 1. */
105 *MeanVelocity, ProjVelocity_i,
106 ProjVelocity_j, /*!< \brief Mean and projected velocities. */
107 sq_vel_i, sq_vel_j, /*!< \brief Modulus of the velocity and the normal vector. */
108 Temperature_i, Temperature_j, /*!< \brief Temperature at node 0 and 1. */
109 MeanDensity, MeanPressure,
110 MeanBetaInc2, MeanEnthalpy,
111 MeanCp, MeanTemperature, /*!< \brief Mean values of primitive variables. */
112 MeandRhodh, /*!< \brief Derivative of density w.r.t. enthalpy (variable density flows). */
113 Param_p, Param_Kappa_2,
114 Param_Kappa_4, /*!< \brief Artificial dissipation parameters. */
115 Local_Lambda_i, Local_Lambda_j,
116 MeanLambda, /*!< \brief Local eingenvalues. */
117 Phi_i, Phi_j, sc2, sc4,
118 StretchingFactor, /*!< \brief Streching parameters. */
119 *ProjFlux, /*!< \brief Projected inviscid flux tensor. */
120 Epsilon_2, Epsilon_4; /*!< \brief Artificial dissipation values. */
121 su2double **Precon;
122 bool implicit, /*!< \brief Implicit calculation. */
123 dynamic_grid, /*!< \brief Modification for grid movement. */
124 variable_density, /*!< \brief Variable density incompressible flows. */
125 energy; /*!< \brief computation with the energy equation. */
126
127 su2double fix_factor; /*!< \brief Fix factor for Jacobians. */
128
129 su2double** Jacobian_i = nullptr; /*!< \brief The Jacobian w.r.t. point i after computation. */
130 su2double** Jacobian_j = nullptr; /*!< \brief The Jacobian w.r.t. point j after computation. */
131
132public:
133 /*!
134 * \brief Constructor of the class.
135 * \param[in] val_nDim - Number of dimension 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 CCentJSTInc_Flow(unsigned short val_nDim, unsigned short val_nVar, const CConfig* config);
140
141 /*!
142 * \brief Destructor of the class.
143 */
144 ~CCentJSTInc_Flow(void) override;
145
146 /*!
147 * \brief Compute the flow residual using a JST method.
148 * \param[in] config - Definition of the particular problem.
149 * \return A lightweight const-view (read-only) of the residual/flux and Jacobians.
150 */
151 ResidualType<> ComputeResidual(const CConfig* config) override;
152
153};
Class for centered scheme - modified JST with incompressible preconditioning.
Definition centered.hpp:99
ResidualType ComputeResidual(const CConfig *config) override
Compute the flow residual using a JST method.
Definition centered.cpp:308
~CCentJSTInc_Flow(void) override
Destructor of the class.
Definition centered.cpp:284
Class for computing the Lax-Friedrich centered scheme (modified with incompressible preconditioning).
Definition centered.hpp:39
ResidualType ComputeResidual(const CConfig *config) override
Compute the flow residual using a Lax method.
Definition centered.cpp:86
~CCentLaxInc_Flow(void) override
Destructor of the class.
Definition centered.cpp:63
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
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