Documentation 6b54b78464
Loading...
Searching...
No Matches
CSpeciesFlameletVariable.hpp
Go to the documentation of this file.
1/*!
2 * \file CSpeciesFlameletVariable.hpp
3 * \brief Base class for defining the variables of the flamelet transport model.
4 * \author D. Mayer, T. Economon, N. Beishuizen
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 "CSpeciesVariable.hpp"
31
32/*!
33 * \class CSpeciesFlameletVariable
34 * \brief Base class for defining the variables of the flamelet model.
35 */
37 protected:
38 MatrixType source_scalar; /*!< \brief Vector of the source terms from the lookup table for each scalar equation */
39 MatrixType lookup_scalar; /*!< \brief Vector of the source terms from the lookup table for each scalar equation */
40 su2vector<unsigned short> table_misses; /*!< \brief Vector of lookup table misses. */
41 MatrixType source_cons_jac; /*!< \brief Consumption-rate Jacobian dS_aux_i/dY_aux_i = source_cons_i, one column per user scalar. */
42
43 public:
44 /*!
45 * \brief Constructor of the class.
46 * \param[in] species_inf - species variable values (initialization value).
47 * \param[in] npoint - Number of points/nodes/vertices in the domain.
48 * \param[in] ndim - Number of dimensions of the problem.
49 * \param[in] nvar - Number of variables of the problem.
50 * \param[in] config - Definition of the particular problem.
51 */
52 CSpeciesFlameletVariable(const su2double* species_inf, unsigned long npoint, unsigned long ndim, unsigned long nvar,
53 const CConfig* config);
54
55 /*!
56 * \brief Set the value of the transported scalar source term.
57 * \param[in] iPoint - the location where the value has to be set.
58 * \param[in] val_lookup_scalar - the value of the scalar to set.
59 * \param[in] val_ivar - Eqn. index to the transport equation.
60 */
61 inline void SetLookupScalar(unsigned long iPoint, su2double val_lookup_scalar, unsigned short val_ivar) override {
62 lookup_scalar(iPoint, val_ivar) = val_lookup_scalar;
63 }
64
65 /*!
66
67 * \brief Set a source term for the specie transport equation.
68 * \param[in] iPoint - Node index.
69 * \param[in] val_ivar - Species index.
70 * \param[in] val_source - Source term value.
71 */
72 inline void SetScalarSource(unsigned long iPoint, unsigned short val_ivar, su2double val_source) override {
73 source_scalar(iPoint, val_ivar) = val_source;
74 }
75
76 /*!
77 * \brief Get the value of the transported scalars source term.
78 * \return Pointer to the transported scalars source term.
79 */
80 inline const su2double* GetScalarSources(unsigned long iPoint) const override { return source_scalar[iPoint]; }
81
82 /*!
83 * \brief Get the value of the looked up table based on the transported scalar.
84 * \return Pointer to the transported scalars source term.
85 */
86 inline const su2double* GetScalarLookups(unsigned long iPoint) const override { return lookup_scalar[iPoint]; }
87
88 inline void SetTableMisses(unsigned long iPoint, unsigned short misses) override { table_misses[iPoint] = misses; }
89
90 inline unsigned short GetTableMisses(unsigned long iPoint) const override { return table_misses[iPoint]; }
91
92 /*!
93 * \brief Store the consumption-rate Jacobian dS_aux_i/dY_aux_i = source_cons_i for user scalar i_aux.
94 */
95 inline void SetAuxSourceCons(unsigned long iPoint, unsigned long i_aux, su2double val) {
96 source_cons_jac(iPoint, i_aux) = val;
97 }
98
99 /*!
100 * \brief Get the consumption-rate Jacobian entry for user scalar i_aux at iPoint.
101 */
102 inline su2double GetAuxSourceCons(unsigned long iPoint, unsigned long i_aux) const {
103 return source_cons_jac(iPoint, i_aux);
104 }
105};
Base class for defining the variables of the species transport model.
Main class for defining the problem; basically this class reads the configuration file,...
Definition CConfig.hpp:64
Base class for defining the variables of the flamelet model.
Definition CSpeciesFlameletVariable.hpp:36
void SetScalarSource(unsigned long iPoint, unsigned short val_ivar, su2double val_source) override
Set a source term for the specie transport equation.
Definition CSpeciesFlameletVariable.hpp:72
MatrixType lookup_scalar
Vector of the source terms from the lookup table for each scalar equation.
Definition CSpeciesFlameletVariable.hpp:39
unsigned short GetTableMisses(unsigned long iPoint) const override
Definition CSpeciesFlameletVariable.hpp:90
const su2double * GetScalarLookups(unsigned long iPoint) const override
Get the value of the looked up table based on the transported scalar.
Definition CSpeciesFlameletVariable.hpp:86
MatrixType source_scalar
Vector of the source terms from the lookup table for each scalar equation.
Definition CSpeciesFlameletVariable.hpp:38
su2double GetAuxSourceCons(unsigned long iPoint, unsigned long i_aux) const
Get the consumption-rate Jacobian entry for user scalar i_aux at iPoint.
Definition CSpeciesFlameletVariable.hpp:102
void SetTableMisses(unsigned long iPoint, unsigned short misses) override
Definition CSpeciesFlameletVariable.hpp:88
void SetLookupScalar(unsigned long iPoint, su2double val_lookup_scalar, unsigned short val_ivar) override
Set the value of the transported scalar source term.
Definition CSpeciesFlameletVariable.hpp:61
MatrixType source_cons_jac
Consumption-rate Jacobian dS_aux_i/dY_aux_i = source_cons_i, one column per user scalar.
Definition CSpeciesFlameletVariable.hpp:41
const su2double * GetScalarSources(unsigned long iPoint) const override
Get the value of the transported scalars source term.
Definition CSpeciesFlameletVariable.hpp:80
su2vector< unsigned short > table_misses
Vector of lookup table misses.
Definition CSpeciesFlameletVariable.hpp:40
void SetAuxSourceCons(unsigned long iPoint, unsigned long i_aux, su2double val)
Store the consumption-rate Jacobian dS_aux_i/dY_aux_i = source_cons_i for user scalar i_aux.
Definition CSpeciesFlameletVariable.hpp:95
Base class for defining the variables of the species transport.
Definition CSpeciesVariable.hpp:36
passivedouble su2double
Definition code_config.hpp:181