Documentation 6b54b78464
Loading...
Searching...
No Matches
centered.hpp
Go to the documentation of this file.
1/*!
2 * \file centered.hpp
3 * \brief Centered convective schemes.
4 * \author P. Gomes, F. Palacios, T. Economon
5 * \version 8.5.0 "Harrier"
6 *
7 * SU2 Project Website: https://su2code.github.io
8 *
9 * The SU2 Project is maintained by the SU2 Foundation
10 * (http://su2foundation.org)
11 *
12 * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md)
13 *
14 * SU2 is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Lesser General Public
16 * License as published by the Free Software Foundation; either
17 * version 2.1 of the License, or (at your option) any later version.
18 *
19 * SU2 is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Lesser General Public License for more details.
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with SU2. If not, see <http://www.gnu.org/licenses/>.
26 */
27
28#pragma once
29
30#include "../../CNumericsSIMD.hpp"
31#include "../../util.hpp"
32#include "../variables.hpp"
33#include "common.hpp"
34#include "../../../variables/CEulerVariable.hpp"
35#include "../../../../../Common/include/geometry/CGeometry.hpp"
36
37/*!
38 * \class CCenteredBase
39 * \ingroup ConvDiscr
40 * \brief Base class for Centered schemes, derived classes implement
41 * the dissipation term in a const "finalizeFlux" method.
42 * \note See CRoeBase for the role of Base.
43 */
44template<class Derived, class Base>
45class CCenteredBase : public Base {
46protected:
47 using Base::nDim;
49 static constexpr size_t nPrimVar = Max(Base::nPrimVar, nDim+5);
50
53 const bool dynamicGrid;
55
56 /*!
57 * \brief Constructor, store some constants and forward args to base.
58 */
59 template<class... Ts>
60 CCenteredBase(const CConfig& config, Ts&... args) : Base(config, args...),
61 gamma(config.GetGamma()),
62 fixFactor(config.GetCent_Jac_Fix_Factor()),
63 dynamicGrid(config.GetDynamic_Grid()) {
64 }
65
66 /*!
67 * \brief Special treatment needed to fetch integer data.
68 */
69 template<class T, size_t N>
70 FORCEINLINE static Double numNeighbor(const simd::Array<T,N>& idx, const CGeometry& geometry) {
71 Double n;
72 for (size_t k=0; k<N; ++k) n[k] = geometry.nodes->GetnNeighbor(idx[k]);
73 return n;
74 }
75 FORCEINLINE static Double numNeighbor(unsigned long idx, const CGeometry& geometry) {
76 return geometry.nodes->GetnNeighbor(idx);
77 }
78
79public:
80 /*!
81 * \brief Implementation of the base centered flux.
82 */
83 void ComputeFlux(const Int iEdge,
84 const CConfig& config,
85 const CGeometry& geometry,
86 const CVariable& solution_,
87 const UpdateType updateType,
88 const Double updateMask,
90 SparseMatrixType& matrix,
91 su2activevector* edgeMassFluxes) const final {
92
93 /*--- Start preaccumulation, inputs are registered
94 * automatically in "gatherVariables". ---*/
96
97 const bool implicit = (config.GetKind_TimeIntScheme() == EULER_IMPLICIT);
98 const auto& solution = static_cast<const CEulerVariable&>(solution_);
99
100 const auto iPoint = geometry.edges->GetNode(iEdge,0);
101 const auto jPoint = geometry.edges->GetNode(iEdge,1);
102
103 /*--- Geometric properties. ---*/
104
105 const auto normal = gatherVariables<nDim>(iEdge, geometry.edges->GetNormal());
106 const auto area = norm(normal);
107 VectorDbl<nDim> unitNormal;
108 for (size_t iDim = 0; iDim < nDim; ++iDim) {
109 unitNormal(iDim) = normal(iDim) / area;
110 }
111
112 /*--- Primitive variables. ---*/
113
115 V.i.all = gatherVariables<nPrimVar>(iPoint, solution.GetPrimitive());
116 V.j.all = gatherVariables<nPrimVar>(jPoint, solution.GetPrimitive());
117
119 for (size_t iVar = 0; iVar < nPrimVar; ++iVar) {
120 avgV.all(iVar) = 0.5 * (V.i.all(iVar) + V.j.all(iVar));
121 }
122
123 /*--- Compute conservative variables. ---*/
124
128
129 auto avgU = compressibleConservatives(avgV);
130
131 VectorDbl<nVar> diffU;
132 for (size_t iVar = 0; iVar < nVar-1; ++iVar) {
133 diffU(iVar) = U.i.all(iVar) - U.j.all(iVar);
134 }
135 diffU(nVar-1) = V.i.density()*V.i.enthalpy() - V.j.density()*V.j.enthalpy();
136
137 /*--- Inviscid fluxes and Jacobians. ---*/
138
139 auto flux = inviscidProjFlux(avgV, avgU, normal);
140
141 MatrixDbl<nVar> jac_i, jac_j;
142 if (implicit) {
143 jac_i = inviscidProjJac(gamma, V.i.velocity(), U.i.energy(), normal, 0.5);
144 jac_j = inviscidProjJac(gamma, V.j.velocity(), U.j.energy(), normal, 0.5);
145 }
146
147 /*--- Grid motion. ---*/
148
149 Double projGridVel = 0.0;
150 if (dynamicGrid) {
151 const auto& gridVel = geometry.nodes->GetGridVel();
152 projGridVel = 0.5*(dot(gatherVariables<nDim>(iPoint,gridVel), normal)+
153 dot(gatherVariables<nDim>(jPoint,gridVel), normal));
154
155 for (size_t iVar = 0; iVar < nVar; ++iVar) {
156 flux(iVar) -= projGridVel * avgU.all(iVar);
157 if (implicit) {
158 jac_i(iVar,iVar) -= 0.5 * projGridVel;
159 jac_j(iVar,iVar) -= 0.5 * projGridVel;
160 }
161 }
162 }
163
164 const Double projVel = dot(avgV.velocity(), normal) - projGridVel;
165
166 /*--- Finalize in derived class (static polymorphism). ---*/
167
168 const auto derived = static_cast<const Derived*>(this);
169
170 derived->finalizeFlux(flux, jac_i, jac_j, implicit, area, projVel, avgV, V,
171 diffU, iPoint, jPoint, geometry, solution, unitNormal);
172
173 /*--- Add the contributions from the base class (static decorator). ---*/
174
175 Base::viscousTerms(iEdge, iPoint, jPoint, avgV, V, solution_, geometry,
176 config, area, unitNormal, implicit, flux, jac_i, jac_j);
177
178 /*--- Stop preaccumulation. ---*/
179
180 stopPreacc(flux);
181
182 /*--- Update the vector and system matrix. ---*/
183
184 updateLinearSystem(iEdge, iPoint, jPoint, implicit, updateType,
185 updateMask, flux, jac_i, jac_j, vector, matrix);
186
187 /*--- Store the mass flux (density-equation flux) for bounded-scalar transport. ---*/
188
189 updateEdgeMassFlux(iEdge, flux(0), edgeMassFluxes);
190 }
191};
192
193/*!
194 * \class CJSTScheme
195 * \ingroup ConvDiscr
196 * \brief Classical JST scheme with scalar dissipation.
197 */
198template<class Decorator>
199class CJSTScheme : public CCenteredBase<CJSTScheme<Decorator>,Decorator> {
200private:
201 using Base = CCenteredBase<CJSTScheme<Decorator>,Decorator>;
202 using Base::nDim;
203 using Base::nVar;
204 using Base::gamma;
205 using Base::fixFactor;
206 using Base::stretchParam;
207 const su2double kappa2;
208 const su2double kappa4;
209
210public:
211 /*!
212 * \brief Constructor, forward everything to base.
213 */
214 template<class... Ts>
215 CJSTScheme(const CConfig& config, Ts&... args) : Base(config, args...),
216 kappa2(config.GetKappa_2nd_Flow()),
217 kappa4(config.GetKappa_4th_Flow()) {
218 }
219
220 /*!
221 * \brief Updates flux and Jacobians with JST dissipation.
222 * \note "Ts" is here just in case other schemes in the family need extra args.
223 */
224 template<class PrimVarType, class... Ts>
226 MatrixDbl<nVar>& jac_i,
227 MatrixDbl<nVar>& jac_j,
228 const bool implicit,
229 const Double& area,
230 const Double& projVel,
231 const PrimVarType& avgV,
232 const CPair<PrimVarType>& V,
233 const VectorDbl<nVar>& diffU,
234 const Int& iPoint,
235 const Int& jPoint,
236 const CGeometry& geometry,
237 const CEulerVariable& solution,
238 Ts&...) const {
239
240 Double lambda = abs(projVel) + avgV.speedSound()*area;
241 lambda = correctedSpectralRadius(iPoint, jPoint, lambda, stretchParam, solution);
242
243 /*--- Compute dissipation coefficients. ---*/
244
245 const auto ni = Base::numNeighbor(iPoint, geometry);
246 const auto nj = Base::numNeighbor(jPoint, geometry);
247 const Double sc2 = 3 * (ni+nj) / (ni*nj);
248 const Double sc4 = 0.25*pow(sc2, 2);
249
250 const auto si = gatherVariables(iPoint, solution.GetSensor());
251 const auto sj = gatherVariables(jPoint, solution.GetSensor());
252 const Double eps2 = kappa2 * 0.5*(si+sj) * sc2;
253 const Double eps4 = fmax(0.0, kappa4-eps2) * sc4;
254
255 /*--- Update flux and Jacobians with dissipation terms. ---*/
256
257 const auto lapl_i = gatherVariables<nVar>(iPoint, solution.GetUndivided_Laplacian());
258 const auto lapl_j = gatherVariables<nVar>(jPoint, solution.GetUndivided_Laplacian());
259
260 for (size_t iVar = 0; iVar < nVar; ++iVar) {
261 flux(iVar) += (eps2*diffU(iVar) - eps4*(lapl_i(iVar)-lapl_j(iVar))) * lambda;
262 }
263
264 if (implicit) {
265 const Double dissip_i = fixFactor * (eps2 + eps4*(ni+1)) * lambda;
266 const Double dissip_j = -fixFactor * (eps2 + eps4*(nj+1)) * lambda;
267 scalarDissipationJacobian(V.i, gamma, dissip_i, jac_i);
268 scalarDissipationJacobian(V.j, gamma, dissip_j, jac_j);
269 }
270 }
271};
272
273/*!
274 * \class CJSTmatScheme
275 * \ingroup ConvDiscr
276 * \brief JST scheme with matrix dissipation.
277 */
278template<class Decorator>
279class CJSTmatScheme : public CCenteredBase<CJSTmatScheme<Decorator>,Decorator> {
280private:
282 using Base::nDim;
283 using Base::nVar;
284 using Base::gamma;
285 using Base::fixFactor;
286 const su2double kappa2;
287 const su2double kappa4;
288 const su2double entropyFix;
289
290public:
291 /*!
292 * \brief Constructor, forward everything to base.
293 */
294 template<class... Ts>
295 CJSTmatScheme(const CConfig& config, Ts&... args) : Base(config, args...),
296 kappa2(config.GetKappa_2nd_Flow()),
297 kappa4(config.GetKappa_4th_Flow()),
298 entropyFix(config.GetEntropyFix_Coeff()) {
299 }
300
301 /*!
302 * \brief Updates flux and Jacobians.
303 * \note "Ts" is here just in case other schemes in the family need extra args.
304 */
305 template<class PrimVarType, class... Ts>
307 MatrixDbl<nVar>& jac_i,
308 MatrixDbl<nVar>& jac_j,
309 const bool implicit,
310 const Double& area,
311 const Double& projVel,
312 const PrimVarType& avgV,
313 const CPair<PrimVarType>& V,
314 const VectorDbl<nVar>& diffU,
315 const Int& iPoint,
316 const Int& jPoint,
317 const CGeometry& geometry,
318 const CEulerVariable& solution,
319 const VectorDbl<nDim>& unitNormal,
320 Ts&...) const {
321
322 /*--- Compute scalar dissipation. ---*/
323
324 const auto ni = Base::numNeighbor(iPoint, geometry);
325 const auto nj = Base::numNeighbor(jPoint, geometry);
326 const Double sc2 = 3 * (ni+nj) / (ni*nj);
327 const Double sc4 = 0.25*pow(sc2, 2);
328
329 const auto si = gatherVariables(iPoint, solution.GetSensor());
330 const auto sj = gatherVariables(jPoint, solution.GetSensor());
331 const Double eps2 = kappa2 * 0.5*(si+sj) * sc2;
332 const Double eps4 = fmax(0.0, kappa4-eps2) * sc4;
333
334 const auto lapl_i = gatherVariables<nVar>(iPoint, solution.GetUndivided_Laplacian());
335 const auto lapl_j = gatherVariables<nVar>(jPoint, solution.GetUndivided_Laplacian());
336
337 VectorDbl<nVar> scalarDissip;
338 for (size_t iVar = 0; iVar < nVar; ++iVar) {
339 scalarDissip(iVar) = eps2*diffU(iVar) - eps4*(lapl_i(iVar)-lapl_j(iVar));
340 }
341
342 MatrixDbl<nVar> scalarJac;
343 if (implicit) {
344 scalarJac = Double(0.0);
345 Double factor = fixFactor * (eps2 + 0.5*eps4*(ni+nj+2));
346 scalarDissipationJacobian(avgV, gamma, factor, scalarJac);
347 }
348
349 /*--- Compute matrix dissipation terms. ---*/
350
351 const auto unitProjVel = dot(avgV.velocity(), unitNormal);
352
353 auto pMat = pMatrix(gamma, avgV.density(), avgV.velocity(),
354 unitProjVel, avgV.speedSound(), unitNormal);
355
356 auto pMatInv = pMatrixInv(gamma, avgV.density(), avgV.velocity(),
357 unitProjVel, avgV.speedSound(), unitNormal);
358
359 /*--- Compute limited absolute eigenvalues (times area). ---*/
360
361 VectorDbl<nVar> lambda;
362 for (size_t iDim = 0; iDim < nDim; ++iDim) {
363 lambda(iDim) = projVel;
364 }
365 lambda(nDim) = projVel + avgV.speedSound()*area;
366 lambda(nDim+1) = projVel - avgV.speedSound()*area;
367
368 const Double maxLambda = fmax(lambda(nDim), -lambda(nDim+1));
369
370 for (size_t iVar = 0; iVar < nVar; ++iVar) {
371 lambda(iVar) = fmax(abs(lambda(iVar)), entropyFix*maxLambda);
372 }
373
374 /*--- Update flux and Jacobians with scaled dissipation terms. ---*/
375
376 for (size_t iVar = 0; iVar < nVar; ++iVar) {
377 for (size_t jVar = 0; jVar < nVar; ++jVar) {
378 /*--- Matrix scaling, P x |S * Lambda| x P^-1. ---*/
379
380 Double scale = 0.0;
381 for (size_t kVar = 0; kVar < nVar; ++kVar) {
382 scale += pMat(iVar,kVar) * lambda(kVar) * pMatInv(kVar,jVar);
383 }
384
385 /*--- Update flux and Jacobians. ---*/
386
387 flux(iVar) += scale * scalarDissip(jVar);
388
389 if (implicit) {
390 for (size_t kVar = 0; kVar < nVar; ++kVar) {
391 jac_i(iVar,kVar) += scale * scalarJac(jVar,kVar);
392 jac_j(iVar,kVar) -= scale * scalarJac(jVar,kVar);
393 }
394 }
395 }
396 }
397 }
398};
399
400/*!
401 * \class CJSTkeScheme
402 * \ingroup ConvDiscr
403 * \brief JST scheme without 4th order dissipation.
404 */
405template<class Decorator>
406class CJSTkeScheme : public CCenteredBase<CJSTkeScheme<Decorator>,Decorator> {
407private:
409 using Base::nDim;
410 using Base::nVar;
411 using Base::gamma;
412 using Base::fixFactor;
413 using Base::stretchParam;
414 const su2double kappa2;
415
416public:
417 /*!
418 * \brief Constructor, forward everything to base.
419 */
420 template<class... Ts>
421 CJSTkeScheme(const CConfig& config, Ts&... args) : Base(config, args...),
422 kappa2(config.GetKappa_2nd_Flow()) {
423 }
424
425 /*!
426 * \brief Updates flux and Jacobians with 2nd order dissipation.
427 * \note "Ts" is here just in case other schemes in the family need extra args.
428 */
429 template<class PrimVarType, class... Ts>
431 MatrixDbl<nVar>& jac_i,
432 MatrixDbl<nVar>& jac_j,
433 const bool implicit,
434 const Double& area,
435 const Double& projVel,
436 const PrimVarType& avgV,
437 const CPair<PrimVarType>& V,
438 const VectorDbl<nVar>& diffU,
439 const Int& iPoint,
440 const Int& jPoint,
441 const CGeometry& geometry,
442 const CEulerVariable& solution,
443 Ts&...) const {
444
445 Double lambda = abs(projVel) + avgV.speedSound()*area;
446 lambda = correctedSpectralRadius(iPoint, jPoint, lambda, stretchParam, solution);
447
448 /*--- Compute dissipation coefficient. ---*/
449
450 const auto ni = Base::numNeighbor(iPoint, geometry);
451 const auto nj = Base::numNeighbor(jPoint, geometry);
452 const Double sc2 = 3 * (ni+nj) / (ni*nj);
453
454 const auto si = gatherVariables(iPoint, solution.GetSensor());
455 const auto sj = gatherVariables(jPoint, solution.GetSensor());
456 const Double dissip = kappa2 * 0.5*(si+sj) * sc2 * lambda;
457
458 /*--- Update flux and Jacobians with dissipation term. ---*/
459
460 for (size_t iVar = 0; iVar < nVar; ++iVar) {
461 flux(iVar) += dissip * diffU(iVar);
462 }
463
464 if (implicit) {
465 scalarDissipationJacobian(V.i, gamma, fixFactor*dissip, jac_i);
466 scalarDissipationJacobian(V.j, gamma, -fixFactor*dissip, jac_j);
467 }
468 }
469};
470
471/*!
472 * \class CLaxScheme
473 * \ingroup ConvDiscr
474 * \brief Lax–Friedrichs 1st order scheme.
475 */
476template<class Decorator>
477class CLaxScheme : public CCenteredBase<CLaxScheme<Decorator>,Decorator> {
478private:
479 using Base = CCenteredBase<CLaxScheme<Decorator>,Decorator>;
480 using Base::nDim;
481 using Base::nVar;
482 using Base::gamma;
483 using Base::fixFactor;
484 using Base::stretchParam;
485 const su2double kappa0;
486
487public:
488 /*!
489 * \brief Constructor, forward everything to base.
490 */
491 template<class... Ts>
492 CLaxScheme(const CConfig& config, Ts&... args) : Base(config, args...),
493 kappa0(config.GetKappa_1st_Flow()) {
494 }
495
496 /*!
497 * \brief Updates flux and Jacobians with 1st order scalar dissipation.
498 * \note "Ts" is here just in case other schemes in the family need extra args.
499 */
500 template<class PrimVarType, class... Ts>
502 MatrixDbl<nVar>& jac_i,
503 MatrixDbl<nVar>& jac_j,
504 const bool implicit,
505 const Double& area,
506 const Double& projVel,
507 const PrimVarType& avgV,
508 const CPair<PrimVarType>& V,
509 const VectorDbl<nVar>& diffU,
510 const Int& iPoint,
511 const Int& jPoint,
512 const CGeometry& geometry,
513 const CEulerVariable& solution,
514 Ts&...) const {
515
516 Double lambda = abs(projVel) + avgV.speedSound()*area;
517 lambda = correctedSpectralRadius(iPoint, jPoint, lambda, stretchParam, solution);
518
519 /*--- Compute dissipation coefficient. ---*/
520
521 const auto ni = Base::numNeighbor(iPoint, geometry);
522 const auto nj = Base::numNeighbor(jPoint, geometry);
523 const Double dissip = kappa0 * nDim * (ni+nj) / (ni*nj) * lambda;
524
525 /*--- Update flux and Jacobians with dissipation term. ---*/
526
527 for (size_t iVar = 0; iVar < nVar; ++iVar) {
528 flux(iVar) += dissip * diffU(iVar);
529 }
530
531 if (implicit) {
532 scalarDissipationJacobian(V.i, gamma, fixFactor*dissip, jac_i);
533 scalarDissipationJacobian(V.j, gamma, -fixFactor*dissip, jac_j);
534 }
535 }
536};
simd::Array< su2double > Double
Define Double and Int SIMD types.
Definition CNumericsSIMD.hpp:36
A templated matrix/vector-like object.
Definition C2DContainer.hpp:374
Base class for Centered schemes, derived classes implement the dissipation term in a const "finalizeF...
Definition centered.hpp:45
void ComputeFlux(const Int iEdge, const CConfig &config, const CGeometry &geometry, const CVariable &solution_, const UpdateType updateType, const Double updateMask, CSysVector< su2double > &vector, SparseMatrixType &matrix, su2activevector *edgeMassFluxes) const final
Implementation of the base centered flux.
Definition centered.hpp:83
CCenteredBase(const CConfig &config, Ts &... args)
Constructor, store some constants and forward args to base.
Definition centered.hpp:60
const bool dynamicGrid
Definition centered.hpp:53
const su2double fixFactor
Definition centered.hpp:52
static constexpr size_t nVar
Definition centered.hpp:48
const su2double gamma
Definition centered.hpp:51
static Double numNeighbor(const simd::Array< T, N > &idx, const CGeometry &geometry)
Special treatment needed to fetch integer data.
Definition centered.hpp:70
static constexpr size_t nPrimVar
Definition centered.hpp:49
static Double numNeighbor(unsigned long idx, const CGeometry &geometry)
Definition centered.hpp:75
const su2double stretchParam
Definition centered.hpp:54
Main class for defining the problem; basically this class reads the configuration file,...
Definition CConfig.hpp:64
Class for defining the variables of the compressible Euler solver.
Definition CEulerVariable.hpp:46
Parent class for defining the geometry of the problem (complete geometry, multigrid agglomerated geom...
Definition CGeometry.hpp:75
CPoint * nodes
Node vector (dual grid information).
Definition CGeometry.hpp:253
Classical JST scheme with scalar dissipation.
Definition centered.hpp:199
CJSTScheme(const CConfig &config, Ts &... args)
Constructor, forward everything to base.
Definition centered.hpp:215
void finalizeFlux(VectorDbl< nVar > &flux, MatrixDbl< nVar > &jac_i, MatrixDbl< nVar > &jac_j, const bool implicit, const Double &area, const Double &projVel, const PrimVarType &avgV, const CPair< PrimVarType > &V, const VectorDbl< nVar > &diffU, const Int &iPoint, const Int &jPoint, const CGeometry &geometry, const CEulerVariable &solution, Ts &...) const
Updates flux and Jacobians with JST dissipation.
Definition centered.hpp:225
JST scheme without 4th order dissipation.
Definition centered.hpp:406
CJSTkeScheme(const CConfig &config, Ts &... args)
Constructor, forward everything to base.
Definition centered.hpp:421
void finalizeFlux(VectorDbl< nVar > &flux, MatrixDbl< nVar > &jac_i, MatrixDbl< nVar > &jac_j, const bool implicit, const Double &area, const Double &projVel, const PrimVarType &avgV, const CPair< PrimVarType > &V, const VectorDbl< nVar > &diffU, const Int &iPoint, const Int &jPoint, const CGeometry &geometry, const CEulerVariable &solution, Ts &...) const
Updates flux and Jacobians with 2nd order dissipation.
Definition centered.hpp:430
JST scheme with matrix dissipation.
Definition centered.hpp:279
CJSTmatScheme(const CConfig &config, Ts &... args)
Constructor, forward everything to base.
Definition centered.hpp:295
void finalizeFlux(VectorDbl< nVar > &flux, MatrixDbl< nVar > &jac_i, MatrixDbl< nVar > &jac_j, const bool implicit, const Double &area, const Double &projVel, const PrimVarType &avgV, const CPair< PrimVarType > &V, const VectorDbl< nVar > &diffU, const Int &iPoint, const Int &jPoint, const CGeometry &geometry, const CEulerVariable &solution, const VectorDbl< nDim > &unitNormal, Ts &...) const
Updates flux and Jacobians.
Definition centered.hpp:306
Lax–Friedrichs 1st order scheme.
Definition centered.hpp:477
void finalizeFlux(VectorDbl< nVar > &flux, MatrixDbl< nVar > &jac_i, MatrixDbl< nVar > &jac_j, const bool implicit, const Double &area, const Double &projVel, const PrimVarType &avgV, const CPair< PrimVarType > &V, const VectorDbl< nVar > &diffU, const Int &iPoint, const Int &jPoint, const CGeometry &geometry, const CEulerVariable &solution, Ts &...) const
Updates flux and Jacobians with 1st order scalar dissipation.
Definition centered.hpp:501
CLaxScheme(const CConfig &config, Ts &... args)
Constructor, forward everything to base.
Definition centered.hpp:492
unsigned short GetnNeighbor(unsigned long iPoint) const
Get the number of neighbor of a point.
Definition CPoint.hpp:466
Class for holding and manipulating vectors needed by linear solvers.
Definition CSysVector.hpp:195
Main class for defining the variables.
Definition CVariable.hpp:50
su2double * GetUndivided_Laplacian(unsigned long iPoint)
Get the undivided laplacian of the solution.
Definition CVariable.hpp:993
su2double GetSensor(unsigned long iPoint) const
Get the pressure sensor.
Definition CVariable.hpp:965
#define FORCEINLINE
Definition code_config.hpp:44
passivedouble su2double
Definition code_config.hpp:181
MatrixDbl< nDim+2 > pMatrix(const Double &gamma, const Double &density, const RandomAccessIterator &velocity, const Double &projVel, const Double &speedSound, const VectorDbl< nDim > &normal)
Compute and return the P tensor (compressible flow, ideal gas).
Definition common.hpp:136
MatrixDbl< nDim+2 > inviscidProjJac(const Double &gamma, RandomAccessIterator velocity, const Double &energy, const VectorDbl< nDim > &normal, const Double &scale)
Jacobian of the convective flux (compressible flow, ideal gas).
Definition common.hpp:280
MatrixDbl< nDim+2 > pMatrixInv(const Double &gamma, const Double &density, const RandomAccessIterator &velocity, const Double &projVel, const Double &speedSound, const VectorDbl< nDim > &normal)
Compute and return the inverse P tensor (compressible flow, ideal gas).
Definition common.hpp:198
VectorDbl< nDim+2 > inviscidProjFlux(const PrimVarType &V, const ConsVarType &U, const VectorDbl< nDim > &normal)
Convective projected (onto normal) flux (compressible flow).
Definition common.hpp:262
Double correctedSpectralRadius(const Int &iPoint, const Int &jPoint, const Double &avgLambda, const T &stretchParam, const VariableType &solution)
Correct spectral radius (avgLambda) for stretching.
Definition common.hpp:370
void scalarDissipationJacobian(const VariableType &V, const Double &gamma, Double dissipConst, MatrixDbl< nVar > &jac)
Update of a flux Jacobian due to a scalar dissipation term.
Definition common.hpp:389
Helper functions for viscous methods.
FORCEINLINE ARRAY_T pow(const ARRAY_T &a, const ARRAY_T &b)
Definition special_vectorization.hpp:179
FORCEINLINE ARRAY_T abs(const ARRAY_T &x)
Definition special_vectorization.hpp:117
void StartPreacc()
Starts a new preaccumulation section and sets the input variables.
Definition ad_structure.hpp:215
UpdateType
Ways to update vectors and system matrices. COLORING is the typical i/j update, whereas for REDUCTION...
Definition util.hpp:44
void stopPreacc(Vector< Double, nVar > &x)
Stop the AD preaccumulation.
Definition util.hpp:392
constexpr size_t Max(size_t a, size_t b)
Constexpr version of max.
Definition util.hpp:124
void updateEdgeMassFlux(Int iEdge, const Double &massFlux, su2activevector *target)
Store the (scalar) mass flux of an edge, e.g. for "bounded scalar" transport equations.
Definition util.hpp:636
Double norm(const Vector< Double, nDim > &vector)
Vector norm.
Definition util.hpp:267
void updateLinearSystem(Int iEdge, Int iPoint, Int jPoint, bool implicit, UpdateType updateType, Double updateMask, const Vector< Double, nVar > &flux, const Matrix< Double, nVar, nVar > &jac_i, const Matrix< Double, nVar, nVar > &jac_j, CSysVector< su2double > &vector, SparseMatrixType &matrix)
Update the matrix and right-hand-side of a linear system with one conservative flux.
Definition util.hpp:571
auto dot(ForwardIterator iterator, const T *ptr) -> typename std::decay< decltype(*ptr)>::type
Dot product.
Definition util.hpp:203
Double gatherVariables(Int iPoint, const Container &vars, size_t iVar=0)
Gather a single variable, from column iVar (0 by default) of row iPoint of a 2D container,...
Definition util.hpp:277
@ EULER_IMPLICIT
Implicit Euler time integration definition.
Definition option_structure.hpp:1711
@ V
Menter k-w SST model with vorticity production terms.
Type to store compressible conservative (i.e. solution) variables.
Definition variables.hpp:70
Type to store compressible primitive variables and access them by name.
Definition variables.hpp:37
VectorDbl< nVar > all
Definition variables.hpp:40
Double & velocity(size_t iDim)
Definition variables.hpp:45
Simple pair type for i/j variables.
Definition util.hpp:130
T i
Definition util.hpp:131
T j
Definition util.hpp:131
CCompressibleConservatives< nDim > compressibleConservatives(const CCompressiblePrimitives< nDim, N > &V)
Primitive to conservative conversion.
Definition variables.hpp:90