|
30 | 30 |
|
31 | 31 | #include "../../CNumerics.hpp" |
32 | 32 |
|
33 | | -/*! |
34 | | - * \class CCentBase_Flow |
35 | | - * \brief Intermediate class to define centered schemes. |
36 | | - * \ingroup ConvDiscr |
37 | | - * \author F. Palacios |
38 | | - */ |
39 | | -class CCentBase_Flow : public CNumerics { |
40 | | - |
41 | | -protected: |
42 | | - unsigned short iDim, iVar, jVar; /*!< \brief Iteration on dimension and variables. */ |
43 | | - bool dynamic_grid; /*!< \brief Consider grid movement. */ |
44 | | - bool implicit; /*!< \brief Implicit calculation (compute Jacobians). */ |
45 | | - su2double fix_factor; /*!< \brief Fix factor for dissipation Jacobians (more diagonal dominance). */ |
46 | | - |
47 | | - su2double Velocity_i[MAXNDIM] = {0.0}; /*!< \brief Velocity at node i. */ |
48 | | - su2double Velocity_j[MAXNDIM] = {0.0}; /*!< \brief Velocity at node j. */ |
49 | | - su2double MeanVelocity[MAXNDIM] = {0.0}; /*!< \brief Mean velocity. */ |
50 | | - su2double ProjVelocity_i, ProjVelocity_j; /*!< \brief Velocities in the face normal direction. */ |
51 | | - su2double sq_vel_i, sq_vel_j; /*!< \brief Squared norm of the velocity vectors. */ |
52 | | - su2double Energy_i, Energy_j, MeanEnergy; /*!< \brief Energy at nodes i and j and mean. */ |
53 | | - su2double MeanDensity, MeanPressure, MeanEnthalpy; /*!< \brief Mean density, pressure, and enthalpy. */ |
54 | | - su2double *ProjFlux = nullptr; /*!< \brief "The" flux. */ |
55 | | - |
56 | | - su2double *Diff_U = nullptr, *Diff_Lapl = nullptr; /*!< \brief Differences of conservatives and undiv. Laplacians. */ |
57 | | - su2double Local_Lambda_i, Local_Lambda_j, MeanLambda; /*!< \brief Local eingenvalues. */ |
58 | | - su2double Param_p, Phi_i, Phi_j, StretchingFactor; /*!< \brief Streching parameters. */ |
59 | | - su2double cte_0, cte_1; /*!< \brief Constants for the scalar dissipation Jacobian. */ |
60 | | - |
61 | | - su2double ProjGridVel; /*!< \brief Projected grid velocity. */ |
62 | | - |
63 | | - su2double** Jacobian_i = nullptr; /*!< \brief The Jacobian w.r.t. point i after computation. */ |
64 | | - su2double** Jacobian_j = nullptr; /*!< \brief The Jacobian w.r.t. point j after computation. */ |
65 | | - |
66 | | - /*! |
67 | | - * \brief Hook method for derived classes to define preaccumulated variables, optional to implement. |
68 | | - * \return true if any variable was set as preacc. input, in which case the residual will be output. |
69 | | - */ |
70 | | - virtual bool SetPreaccInVars(void) {return false;} |
71 | | - |
72 | | - /*! |
73 | | - * \brief Derived classes must implement this method, called in ComputeResidual after inviscid part. |
74 | | - * \param[in,out] val_residual - Pointer to the convective flux contribution to the residual. |
75 | | - * \param[in,out] val_Jacobian_i - Jacobian of the numerical method at node i (implicit computation). |
76 | | - * \param[in,out] val_Jacobian_j - Jacobian of the numerical method at node j (implicit computation). |
77 | | - */ |
78 | | - virtual void DissipationTerm(su2double *val_residual, su2double **val_Jacobian_i, su2double **val_Jacobian_j) = 0; |
79 | | - |
80 | | - /*! |
81 | | - * \brief Add the contribution of a scalar dissipation term to the Jacobians. |
82 | | - * \param[in,out] val_Jacobian_i - Jacobian of the numerical method at node i. |
83 | | - * \param[in,out] val_Jacobian_j - Jacobian of the numerical method at node j. |
84 | | - */ |
85 | | - void ScalarDissipationJacobian(su2double **val_Jacobian_i, su2double **val_Jacobian_j); |
86 | | - |
87 | | -public: |
88 | | - /*! |
89 | | - * \brief Constructor of the class. |
90 | | - * \param[in] val_nDim - Number of dimension of the problem. |
91 | | - * \param[in] val_nVar - Number of variables of the problem. |
92 | | - * \param[in] config - Definition of the particular problem. |
93 | | - */ |
94 | | - CCentBase_Flow(unsigned short val_nDim, unsigned short val_nVar, const CConfig* config); |
95 | | - |
96 | | - /*! |
97 | | - * \brief Destructor of the class. |
98 | | - */ |
99 | | - ~CCentBase_Flow(void) override; |
100 | | - |
101 | | - /*! |
102 | | - * \brief Compute the flow residual using a centered method with artificial dissipation. |
103 | | - * \param[in] config - Definition of the particular problem. |
104 | | - * \return A lightweight const-view (read-only) of the residual/flux and Jacobians. |
105 | | - */ |
106 | | - ResidualType<> ComputeResidual(const CConfig* config) final; |
107 | | - |
108 | | -}; |
109 | | - |
110 | | -/*! |
111 | | - * \class CCentLax_Flow |
112 | | - * \brief Class for computing the Lax-Friedrich centered scheme. |
113 | | - * \ingroup ConvDiscr |
114 | | - * \author F. Palacios |
115 | | - */ |
116 | | -class CCentLax_Flow final : public CCentBase_Flow { |
117 | | -private: |
118 | | - su2double Param_Kappa_0; /*!< \brief Artificial dissipation parameter. */ |
119 | | - su2double sc0; /*!< \brief Streching parameter. */ |
120 | | - su2double Epsilon_0; /*!< \brief Artificial dissipation coefficient. */ |
121 | | - |
122 | | - /*! |
123 | | - * \brief Lax-Friedrich first order dissipation term. |
124 | | - * \param[in,out] val_residual - Pointer to the convective flux contribution to the residual. |
125 | | - * \param[in,out] val_Jacobian_i - Jacobian of the numerical method at node i (implicit computation). |
126 | | - * \param[in,out] val_Jacobian_j - Jacobian of the numerical method at node j (implicit computation). |
127 | | - */ |
128 | | - void DissipationTerm(su2double *val_residual, su2double **val_Jacobian_i, su2double **val_Jacobian_j) override; |
129 | | - |
130 | | - /*! |
131 | | - * \brief Set input variables for AD preaccumulation. |
132 | | - * \return true, as we will define inputs. |
133 | | - */ |
134 | | - bool SetPreaccInVars(void) override; |
135 | | - |
136 | | -public: |
137 | | - /*! |
138 | | - * \brief Constructor of the class. |
139 | | - * \param[in] val_nDim - Number of dimension of the problem. |
140 | | - * \param[in] val_nVar - Number of variables of the problem. |
141 | | - * \param[in] config - Definition of the particular problem. |
142 | | - */ |
143 | | - CCentLax_Flow(unsigned short val_nDim, unsigned short val_nVar, const CConfig* config); |
144 | | - |
145 | | -}; |
146 | | - |
147 | | -/*! |
148 | | - * \class CCentJST_KE_Flow |
149 | | - * \brief Class for centered scheme - JST_KE (no 4th dissipation order term). |
150 | | - * \ingroup ConvDiscr |
151 | | - * \author F. Palacios |
152 | | - */ |
153 | | -class CCentJST_KE_Flow final : public CCentBase_Flow { |
154 | | - |
155 | | -private: |
156 | | - su2double Param_Kappa_2; /*!< \brief Artificial dissipation parameter. */ |
157 | | - su2double sc2; /*!< \brief Streching parameter. */ |
158 | | - su2double Epsilon_2; /*!< \brief Artificial dissipation coefficient. */ |
159 | | - |
160 | | - /*! |
161 | | - * \brief JST_KE second order dissipation term. |
162 | | - * \param[in,out] val_residual - Pointer to the convective flux contribution to the residual. |
163 | | - * \param[in,out] val_Jacobian_i - Jacobian of the numerical method at node i (implicit computation). |
164 | | - * \param[in,out] val_Jacobian_j - Jacobian of the numerical method at node j (implicit computation). |
165 | | - */ |
166 | | - void DissipationTerm(su2double *val_residual, su2double **val_Jacobian_i, su2double **val_Jacobian_j) override; |
167 | | - |
168 | | - /*! |
169 | | - * \brief Set input variables for AD preaccumulation. |
170 | | - * \return true, as we will define inputs. |
171 | | - */ |
172 | | - bool SetPreaccInVars(void) override; |
173 | | - |
174 | | -public: |
175 | | - /*! |
176 | | - * \brief Constructor of the class. |
177 | | - * \param[in] val_nDim - Number of dimension of the problem. |
178 | | - * \param[in] val_nVar - Number of variables of the problem. |
179 | | - * \param[in] config - Definition of the particular problem. |
180 | | - */ |
181 | | - CCentJST_KE_Flow(unsigned short val_nDim, unsigned short val_nVar, const CConfig* config); |
182 | | - |
183 | | -}; |
184 | | - |
185 | | -/*! |
186 | | - * \class CCentJST_Flow |
187 | | - * \brief Class for centered scheme - JST. |
188 | | - * \ingroup ConvDiscr |
189 | | - * \author F. Palacios |
190 | | - */ |
191 | | -class CCentJST_Flow final : public CCentBase_Flow { |
192 | | - |
193 | | -private: |
194 | | - su2double Param_Kappa_2, Param_Kappa_4; /*!< \brief Artificial dissipation parameters. */ |
195 | | - su2double sc2, sc4; /*!< \brief Streching parameters. */ |
196 | | - su2double Epsilon_2, Epsilon_4; /*!< \brief Artificial dissipation coefficients. */ |
197 | | - |
198 | | - /*! |
199 | | - * \brief JST second and forth order dissipation terms. |
200 | | - * \param[in,out] val_residual - Pointer to the convective flux contribution to the residual. |
201 | | - * \param[in,out] val_Jacobian_i - Jacobian of the numerical method at node i (implicit computation). |
202 | | - * \param[in,out] val_Jacobian_j - Jacobian of the numerical method at node j (implicit computation). |
203 | | - */ |
204 | | - void DissipationTerm(su2double *val_residual, su2double **val_Jacobian_i, su2double **val_Jacobian_j) override; |
205 | | - |
206 | | - /*! |
207 | | - * \brief Set input variables for AD preaccumulation. |
208 | | - * \return true, as we will define inputs. |
209 | | - */ |
210 | | - bool SetPreaccInVars(void) override; |
211 | | - |
212 | | -public: |
213 | | - /*! |
214 | | - * \brief Constructor of the class. |
215 | | - * \param[in] val_nDim - Number of dimension of the problem. |
216 | | - * \param[in] val_nVar - Number of variables of the problem. |
217 | | - * \param[in] config - Definition of the particular problem. |
218 | | - */ |
219 | | - CCentJST_Flow(unsigned short val_nDim, unsigned short val_nVar, const CConfig* config); |
220 | | - |
221 | | -}; |
222 | | - |
223 | 33 | /*! |
224 | 34 | * \class CCentLaxInc_Flow |
225 | 35 | * \brief Class for computing the Lax-Friedrich centered scheme (modified with incompressible preconditioning). |
|
0 commit comments