Documentation 6b54b78464
Loading...
Searching...
No Matches
pressure_based.hpp
Go to the documentation of this file.
1/*!
2 * \file pressure_based.hpp
3 * \brief Declaration of numerics classes for convective schemes for
4 * the pressure based solver, the implementation is in pressure_based.cpp.
5 * \author T. Aalbers
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/*!
35 * \class CPBConvection_Base
36 * \brief Class for computing a linear centered scheme.
37 * \ingroup ConvDiscr
38 * \author T. Aalbers
39 */
41protected:
42
44
45 unsigned short iDim, jDim, iVar, jVar;
46
48 su2double *Flux = nullptr;
49 su2double **Jacobian_i = nullptr;
50 su2double **Jacobian_j = nullptr;
51
54
56
57 /*!
58 * \brief Function which defines the advected quantities
59 */
60 void virtual ComputeAdvectedQuantities(void) = 0;
61
62 /*!
63 * \brief Function which defines jacobian weights
64 */
65 void virtual ComputeJacobianWeights(void) = 0;
66
67 /*!
68 * \brief Function which defines the Jacobian
69 */
70 void ComputeJacobian(su2double val_density, const su2double *val_velocity,
71 su2double val_enthalpy, su2double val_dRhodh,
72 su2double val_scale, su2double **val_Proj_Jac_Tensor);
73
74public:
75
76 /*!
77 * \brief Constructor of the class.
78 * \param[in] val_nDim - Number of dimension of the problem.
79 * \param[in] val_nVar - Number of variables of the problem.
80 * \param[in] config - Definition of the particular problem.
81 */
82 CPBConvection_Base(unsigned short val_nDim, unsigned short val_nVar, CConfig *config);
83
84 /*!
85 * \brief Destructor of the class.
86 */
87 virtual ~CPBConvection_Base(void);
88
89 /*!
90 * \brief Compute the flow residual.
91 * \param[out] val_resconv - Pointer to the convective residual.
92 * \param[out] val_Jacobian_i - Jacobian of the numerical method at node i (implicit computation).
93 * \param[out] val_Jacobian_j - Jacobian of the numerical method at node j (implicit computation).
94 * \param[in] config - Definition of the particular problem.
95 */
96 ResidualType<> ComputeResidual(const CConfig* config) final;
97};
98
99/*!
100 * \class CPBConvection_Central
101 * \brief Class for computing a centered scheme.
102 * \ingroup ConvDiscr
103 * \author T. Aalbers
104 */
106
107public:
108
109 /*!
110 * \brief Constructor of the class.
111 * \param[in] val_nDim - Number of dimension of the problem.
112 * \param[in] val_nVar - Number of variables of the problem.
113 * \param[in] config - Definition of the particular problem.
114 */
115 CPBConvection_Central(unsigned short val_nDim, unsigned short val_nVar, CConfig *config)
116 : CPBConvection_Base(val_nDim, val_nVar, config) {}
117
118 /*!
119 * \brief Function which defines the advected quantities
120 */
121 void ComputeAdvectedQuantities(void) final;
122
123 /*!
124 * \brief Function which defines jacobian weights
125 */
126 void ComputeJacobianWeights(void) final;
127
128};
129
130
131/*!
132 * \class CPBConvection_Upwind
133 * \brief Class for computing an upwind scheme.
134 * \ingroup ConvDiscr
135 * \author T. Aalbers
136 */
138
139public:
140
141 /*!
142 * \brief Constructor of the class.
143 * \param[in] val_nDim - Number of dimension of the problem.
144 * \param[in] val_nVar - Number of variables of the problem.
145 * \param[in] config - Definition of the particular problem.
146 */
147 CPBConvection_Upwind(unsigned short val_nDim, unsigned short val_nVar, CConfig *config)
148 : CPBConvection_Base(val_nDim, val_nVar, config) {}
149
150 /*!
151 * \brief Function which defines the advected quantities
152 */
153 void ComputeAdvectedQuantities(void) final;
154
155 /*!
156 * \brief Function which defines jacobian weights
157 */
158 void ComputeJacobianWeights(void) final;
159
160};
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 computing a linear centered scheme.
Definition pressure_based.hpp:40
su2double * Flux
Definition pressure_based.hpp:48
bool dynamic_grid
Definition pressure_based.hpp:43
unsigned short iVar
Definition pressure_based.hpp:45
unsigned short jDim
Definition pressure_based.hpp:45
ResidualType ComputeResidual(const CConfig *config) final
Compute the flow residual.
Definition pressure_based.cpp:63
su2double Temperature_i
Definition pressure_based.hpp:53
su2double dRhodh_j
Definition pressure_based.hpp:53
su2double ** Jacobian_i
Definition pressure_based.hpp:49
virtual void ComputeJacobianWeights(void)=0
Function which defines jacobian weights.
void ComputeJacobian(su2double val_density, const su2double *val_velocity, su2double val_enthalpy, su2double val_dRhodh, su2double val_scale, su2double **val_Proj_Jac_Tensor)
Function which defines the Jacobian.
Definition pressure_based.cpp:131
virtual ~CPBConvection_Base(void)
Destructor of the class.
Definition pressure_based.cpp:48
su2double ** Jacobian_j
Definition pressure_based.hpp:50
unsigned short iDim
Definition pressure_based.hpp:45
su2double Temperature_j
Definition pressure_based.hpp:53
su2double AdvectedEnthalpy
Definition pressure_based.hpp:47
su2double * AdvectedVelocity
Definition pressure_based.hpp:47
bool energy
Definition pressure_based.hpp:43
su2double MeanDensity
Definition pressure_based.hpp:52
su2double dRhodh_i
Definition pressure_based.hpp:53
bool implicit
Definition pressure_based.hpp:43
su2double weight_jacobian_j
Definition pressure_based.hpp:55
bool variable_density
Definition pressure_based.hpp:43
su2double weight_jacobian_i
Definition pressure_based.hpp:55
unsigned short jVar
Definition pressure_based.hpp:45
virtual void ComputeAdvectedQuantities(void)=0
Function which defines the advected quantities.
Class for computing a centered scheme.
Definition pressure_based.hpp:105
void ComputeAdvectedQuantities(void) final
Function which defines the advected quantities.
Definition pressure_based.cpp:170
CPBConvection_Central(unsigned short val_nDim, unsigned short val_nVar, CConfig *config)
Constructor of the class.
Definition pressure_based.hpp:115
void ComputeJacobianWeights(void) final
Function which defines jacobian weights.
Definition pressure_based.cpp:179
Class for computing an upwind scheme.
Definition pressure_based.hpp:137
void ComputeJacobianWeights(void) final
Function which defines jacobian weights.
Definition pressure_based.cpp:196
CPBConvection_Upwind(unsigned short val_nDim, unsigned short val_nVar, CConfig *config)
Constructor of the class.
Definition pressure_based.hpp:147
void ComputeAdvectedQuantities(void) final
Function which defines the advected quantities.
Definition pressure_based.cpp:185
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