Documentation a537f1bdf2
Loading...
Searching...
No Matches
CPoissonVariable.hpp
Go to the documentation of this file.
1/*!
2 * \file CPoissonVariable.hpp
3 * \brief Class for defining the variables of the finite-volume poisson equation solver.
4 * \author T. Aalbers
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 "CScalarVariable.hpp"
31
32/*!
33 * \class CPoissonVariable
34 * \brief Class for defining the variables of the finite-volume poisson equation solver.
35 * \author T. Aalbers
36 * \version 8.5.0 "Harrier"
37 */
38class CPoissonVariable final : public CScalarVariable {
39protected:
40 VectorType MomCoeff; /*!< \brief Momentum coefficients vol/A_p used as the diffusion coefficients in the poisson solver. */
41 MatrixType MomentumCorrection; /*!< \brief (rho*u)' in the context of: (rho*u)** = (rho*u)* + (rho*u)'. */
42 MatrixType HbyACorrection; /*!< \brief H(rhou')/A = (sum_nb A_nb (rhou)'_nb) / A; used by the second pressure correction in the PISO algorithm. */
43public:
44 static constexpr size_t MAXNVAR = 1; /*!< \brief Max number of variables, for static arrays. */
45
46 /*!
47 * \brief Constructor of the class.
48 * \param[in] value - Values of the poisson solution (initialization value).
49 * \param[in] npoint - Number of points/nodes/vertices in the domain.
50 * \param[in] ndim - Number of dimensions of the problem.
51 * \param[in] nvar - Number of variables of the problem.
52 * \param[in] config - Definition of the particular problem.
53 */
54 CPoissonVariable(su2double value, unsigned long npoint, unsigned long ndim, unsigned long nvar, CConfig *config);
55
56 /*!
57 * \brief Get the momentum coefficient of the point.
58 * \return Value of the momentum coefficient of the point.
59 */
60 inline su2double GetMomCoeff(unsigned long iPoint) final { return MomCoeff(iPoint);}
61
62 /*!
63 * \brief Get the momentum coefficients of all points, the diffusion coefficients of the
64 * equation (see CScalarFlux_Poisson).
65 */
66 inline const VectorType& GetMomCoeff() const { return MomCoeff; }
67
68
69 /*!
70 * \brief Set the momentum coefficient of the point.
71 */
72 inline void SetMomCoeff(unsigned long iPoint, su2double val_Mom_Coeff) final { MomCoeff(iPoint) = val_Mom_Coeff; }
73
74 /*!
75 * \brief Set H(u')/A for the point
76 * \param[in] iPoint - Point index.
77 * \param[in] iDim - Dimension index.
78 * \param[in] val_HbyA - HbyA correction.
79 */
80 inline void SetHbyACorrection(unsigned long iPoint, unsigned short iDim, su2double val_HbyA) final { HbyACorrection(iPoint, iDim) = val_HbyA; }
81
82 /*!
83 * \brief Get H(u')/A for the point
84 * \param[in] iPoint - Point index.
85 * \param[in] iDim - Dimension index.
86 * \return The H(u')/A for the point.
87 */
88 inline su2double GetHbyACorrection(unsigned long iPoint, unsigned short iDim) final { return HbyACorrection(iPoint, iDim); }
89
90 /*!
91 * \brief Set (rho*u)' for the point
92 * \param[in] iPoint - Point index.
93 * \param[in] iDim - Dimension index.
94 * \param[in] val_mom - Momentum correction (rho*u)' value.
95 */
96 inline void SetMomentumCorrection(unsigned long iPoint, unsigned short iDim, su2double val_mom) final { MomentumCorrection(iPoint, iDim) = val_mom; }
97
98 /*!
99 * \brief Get (rho*u)' for the point
100 * \param[in] iPoint - Point index.
101 * \param[in] iDim - Dimension index.
102 * \return The (rho*u)' for the point.
103 */
104 inline su2double GetMomentumCorrection(unsigned long iPoint, unsigned short iDim) final { return MomentumCorrection(iPoint, iDim); }
105
106};
Base class for defining the shared variables of scalar solvers.
Main class for defining the problem; basically this class reads the configuration file,...
Definition CConfig.hpp:64
Class for defining the variables of the finite-volume poisson equation solver.
Definition CPoissonVariable.hpp:38
void SetHbyACorrection(unsigned long iPoint, unsigned short iDim, su2double val_HbyA) final
Set H(u')/A for the point.
Definition CPoissonVariable.hpp:80
MatrixType HbyACorrection
H(rhou')/A = (sum_nb A_nb (rhou)'_nb) / A; used by the second pressure correction in the PISO algorit...
Definition CPoissonVariable.hpp:42
VectorType MomCoeff
Momentum coefficients vol/A_p used as the diffusion coefficients in the poisson solver.
Definition CPoissonVariable.hpp:40
su2double GetHbyACorrection(unsigned long iPoint, unsigned short iDim) final
Get H(u')/A for the point.
Definition CPoissonVariable.hpp:88
su2double GetMomCoeff(unsigned long iPoint) final
Get the momentum coefficient of the point.
Definition CPoissonVariable.hpp:60
const VectorType & GetMomCoeff() const
Get the momentum coefficients of all points, the diffusion coefficients of the equation (see CScalarF...
Definition CPoissonVariable.hpp:66
static constexpr size_t MAXNVAR
Max number of variables, for static arrays.
Definition CPoissonVariable.hpp:44
su2double GetMomentumCorrection(unsigned long iPoint, unsigned short iDim) final
Get (rho*u)' for the point.
Definition CPoissonVariable.hpp:104
void SetMomCoeff(unsigned long iPoint, su2double val_Mom_Coeff) final
Set the momentum coefficient of the point.
Definition CPoissonVariable.hpp:72
MatrixType MomentumCorrection
(rho*u)' in the context of: (rho*u)** = (rho*u)* + (rho*u)'.
Definition CPoissonVariable.hpp:41
void SetMomentumCorrection(unsigned long iPoint, unsigned short iDim, su2double val_mom) final
Set (rho*u)' for the point.
Definition CPoissonVariable.hpp:96
Base class for defining the shared variables of scalar solvers.
Definition CScalarVariable.hpp:36
passivedouble su2double
Definition code_config.hpp:181