Documentation 6b54b78464
Loading...
Searching...
No Matches
CSpeciesVariable.hpp
Go to the documentation of this file.
1/*!
2 * \file CSpeciesVariable.hpp
3 * \brief Base class for defining the variables of the species transport model.
4 * \author T. Kattmann
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 CSpeciesVariable
34 * \brief Base class for defining the variables of the species transport.
35 */
37 protected:
38 MatrixType Diffusivity; /*!< \brief Matrix (nPoint,nVar) of mass diffusivities for scalar transport. */
39
40 public:
41 static constexpr size_t MAXNVAR = 20; /*!< \brief Max number of variables for static arrays. Increase, if necessary. */
42
43 /*!
44 * \brief Constructor of the class.
45 * \param[in] species_inf - species variable values (initialization value).
46 * \param[in] npoint - Number of points/nodes/vertices in the domain.
47 * \param[in] ndim - Number of dimensions of the problem.
48 * \param[in] nvar - Number of variables of the problem.
49 * \param[in] config - Definition of the particular problem.
50 */
51 CSpeciesVariable(const su2double* species_inf, unsigned long npoint, unsigned long ndim, unsigned long nvar,
52 const CConfig* config);
53
54 /*!
55 * \brief Set the value of the mass diffusivity
56 * \param[in] val_diffusivity - the mass diffusivity.
57 * \param[in] val_ivar - eqn. index to the mass diffusivity.
58 */
59 inline void SetDiffusivity(unsigned long iPoint, su2double val_diffusivity, unsigned short val_ivar) {
60 Diffusivity(iPoint, val_ivar) = val_diffusivity;
61 }
62
63 /*!
64 * \brief Get the value of the mass diffusivity
65 * \param[in] val_ivar - eqn. index to the mass diffusivity.
66 * \return Value of the mass diffusivity
67 */
68 inline su2double GetDiffusivity(unsigned long iPoint, unsigned short val_ivar) const {
69 return Diffusivity(iPoint, val_ivar);
70 }
71
72 /*!
73 * \brief Get the value of the mass diffusivities
74 * \return Pointer to the mass diffusivities
75 */
76 inline const su2double* GetDiffusivity(unsigned long iPoint) const { return Diffusivity[iPoint]; }
77
78 /*!
79 * \brief Get the mass diffusivity container, for a per-species gather by point and equation.
80 */
81 inline const MatrixType& GetDiffusivity() const { return Diffusivity; }
82};
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
Base class for defining the shared variables of scalar solvers.
Definition CScalarVariable.hpp:36
Base class for defining the variables of the species transport.
Definition CSpeciesVariable.hpp:36
MatrixType Diffusivity
Matrix (nPoint,nVar) of mass diffusivities for scalar transport.
Definition CSpeciesVariable.hpp:38
su2double GetDiffusivity(unsigned long iPoint, unsigned short val_ivar) const
Get the value of the mass diffusivity.
Definition CSpeciesVariable.hpp:68
const su2double * GetDiffusivity(unsigned long iPoint) const
Get the value of the mass diffusivities.
Definition CSpeciesVariable.hpp:76
static constexpr size_t MAXNVAR
Max number of variables for static arrays. Increase, if necessary.
Definition CSpeciesVariable.hpp:41
const MatrixType & GetDiffusivity() const
Get the mass diffusivity container, for a per-species gather by point and equation.
Definition CSpeciesVariable.hpp:81
void SetDiffusivity(unsigned long iPoint, su2double val_diffusivity, unsigned short val_ivar)
Set the value of the mass diffusivity.
Definition CSpeciesVariable.hpp:59
passivedouble su2double
Definition code_config.hpp:181