Documentation 6b54b78464
Loading...
Searching...
No Matches
poisson_edge_flux.hpp
Go to the documentation of this file.
1/*!
2 * \file poisson_edge_flux.hpp
3 * \brief Pressure correction (Poisson) equation as a third-layer scalar flux,
4 * see numerics/scalar/scalar_edge_flux.hpp.
5 * \author T. Aalbers, P. Gomes
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
32
33/*!
34 * \class CScalarFlux_Poisson
35 * \ingroup ViscDiscr
36 * \brief Diffusion of the pressure correction, with a diagonal (single-equation) coefficient.
37 * \note The equation has no convective term at all, so the solver runs this kernel with
38 * ScalarFluxOptions::convective cleared and the inherited CUpwScalarFlux::finalizeFlux
39 * is never reached; see CPoissonSolver::Viscous_Residual.
40 * \note The diffusion coefficient is the momentum coefficient vol/A_p carried by the solver's
41 * own variables, not a flow primitive, so nothing here reads the flow's primitive row;
42 * the flow variables are only asked which points carry a strong velocity BC.
43 */
44template <class Double, class FlowIndices, int nDim, size_t nVar = 1>
46 : public CUpwScalarBase<Double, CScalarFlux_Poisson<Double, FlowIndices, nDim, nVar>, FlowIndices, nDim, nVar> {
47 public:
48 static constexpr bool Conservative = false;
49 static constexpr bool DiagonalDiffusion = true;
50
52 using Int = typename Base::Int;
53
54 using Base::Base;
55
56 /*!
57 * \brief Momentum coefficient, an i/j average, identical for both edge sides (TSL Jacobian).
58 * \note A point under a strong velocity BC has no momentum equation; its coefficient is the average
59 * of its neighbours' (see CPoissonSolver::SetMomCoeff).
60 */
61 template <class VariableType>
63 const EdgeSide<VariableType>& side_i, Int jPoint,
64 const EdgeSide<VariableType>& side_j,
65 const CPair<Double>&) const {
66 const Double coeff_i = gatherVariables(iPoint, side_i.scalarNodes.GetMomCoeff());
67 const Double coeff_j = gatherVariables(jPoint, side_j.scalarNodes.GetMomCoeff());
68
70 D(0) = 0.5 * (coeff_i + coeff_j);
71 return {D, D};
72 }
73};
A templated matrix/vector-like object.
Definition C2DContainer.hpp:374
Diffusion of the pressure correction, with a diagonal (single-equation) coefficient.
Definition poisson_edge_flux.hpp:46
CPair< Vector< Double, nVar > > coefficients(const FlowIndices &, Int iPoint, const EdgeSide< VariableType > &side_i, Int jPoint, const EdgeSide< VariableType > &side_j, const CPair< Double > &) const
Momentum coefficient, an i/j average, identical for both edge sides (TSL Jacobian).
Definition poisson_edge_flux.hpp:62
typename Base::Int Int
Definition poisson_edge_flux.hpp:52
static constexpr bool Conservative
Definition poisson_edge_flux.hpp:48
static constexpr bool DiagonalDiffusion
Definition poisson_edge_flux.hpp:49
Upwind convection and diffusion of a transported scalar, accumulated into one residual,...
Definition scalar_edge_flux.hpp:316
typename CLaneTraits< Double_ >::Int Int
Definition scalar_edge_flux.hpp:319
Double_ Double
Definition scalar_edge_flux.hpp:318
#define FORCEINLINE
Definition code_config.hpp:44
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
Model-agnostic convection and diffusion of a transported scalar, shared by every scalar solver (turbu...
Simple pair type for i/j variables.
Definition util.hpp:130
Locates the data of one endpoint of an edge.
Definition scalar_edge_flux.hpp:42
const VariableType & scalarNodes
Scalar solver variables.
Definition scalar_edge_flux.hpp:43