Documentation a537f1bdf2
Loading...
Searching...
No Matches
radiation.hpp
Go to the documentation of this file.
1/*!
2 * \file radiation.hpp
3 * \brief Declaration and inlines of the classes used to compute
4 * residual terms in radiation problems.
5 * \author Ruben Sanchez
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
31#include "CNumerics.hpp"
32
34protected:
36 const su2double *RadVar_i; /*!< \brief Vector of radiation variables at point i. */
37 const su2double *RadVar_j; /*!< \brief Vector of radiation variables at point j. */
38 CMatrixView<const su2double> RadVar_Grad_i; /*!< \brief Gradient of turbulent variables at point i. */
39 CMatrixView<const su2double> RadVar_Grad_j; /*!< \brief Gradient of turbulent variables at point j. */
40 su2double Absorption_Coeff; /*!< \brief Absorption coefficient. */
41 su2double Scattering_Coeff; /*!< \brief Scattering coefficient. */
42
43 su2double Temperature_Ref; /*!< \brief Reference temperature for redimensionalization of P1 solver. */
44
45public:
46 /*!
47 * \brief Constructor of the class.
48 * \param[in] val_nDim - Number of dimensions of the problem.
49 * \param[in] val_nVar - Number of variables of the problem.
50 * \param[in] config - Definition of the particular problem.
51 */
52 CNumericsRadiation(unsigned short val_nDim, unsigned short val_nVar, const CConfig *config);
53
54 /*!
55 * \brief Set the value of the radiation variable.
56 * \param[in] val_radvar_i - Value of the turbulent variable at point i.
57 * \param[in] val_radvar_j - Value of the turbulent variable at point j.
58 */
59 inline void SetRadVar(const su2double *val_radvar_i, const su2double *val_radvar_j) final {
60 RadVar_i = val_radvar_i;
61 RadVar_j = val_radvar_j;
62 }
63
64 /*!
65 * \brief Set the gradient of the radiation variables.
66 * \param[in] val_radvar_grad_i - Gradient of the turbulent variable at point i.
67 * \param[in] val_radvar_grad_j - Gradient of the turbulent variable at point j.
68 */
69 inline void SetRadVarGradient(CMatrixView<const su2double> val_radvar_grad_i,
70 CMatrixView<const su2double> val_radvar_grad_j) final {
71 RadVar_Grad_i = val_radvar_grad_i;
72 RadVar_Grad_j = val_radvar_grad_j;
73 }
74
75};
76
77
78class CSourceP1 final : public CNumericsRadiation {
79private:
80 su2double BlackBody_Intensity;
81 su2double Energy_i, Temperature_i;
82
83public:
84 /*!
85 * \param[in] val_nDim - Number of dimensions of the problem.
86 * \param[in] val_nVar - Number of variables of the problem.
87 * \param[in] config - Definition of the particular problem.
88 */
89 CSourceP1(unsigned short val_nDim, unsigned short val_nVar, const CConfig *config);
90
91 /*!
92 * \brief Source term integration of the P1 model.
93 * \param[out] val_residual - Pointer to the residual vector.
94 * \param[out] val_Jacobian_i - Jacobian of the numerical method at node i (implicit computation).
95 * \param[in] config - Definition of the particular problem.
96 */
97 void ComputeResidual(su2double *val_residual, su2double **val_Jacobian_i, CConfig *config) override;
98
99};
100
102 private:
103 su2double GammaP1; /*!< \brief P1 parameter */
104
105 public:
106 /*!
107 * \brief Constructor of the class.
108 * \param[in] val_nDim - Number of dimensions of the problem.
109 * \param[in] val_nVar - Number of variables of the problem.
110 * \param[in] config - Definition of the particular problem.
111 */
112 CAvgGradCorrected_P1(unsigned short val_nDim, unsigned short val_nVar, const CConfig *config);
113
114 /*!
115 * \brief Compute the viscous residual of the P1 equation.
116 * \param[out] val_residual - Pointer to the total residual.
117 * \param[out] Jacobian_i - Jacobian of the numerical method at node i (implicit computation).
118 * \param[out] Jacobian_j - Jacobian of the numerical method at node j (implicit computation).
119 * \param[in] config - Definition of the particular problem.
120 */
121 void ComputeResidual(su2double *val_residual, su2double **Jacobian_i,
122 su2double **Jacobian_j, CConfig *config) override;
123
124};
Declaration of the base numerics class, the implementation is in the CNumerics.cpp file.
Definition radiation.hpp:101
void ComputeResidual(su2double *val_residual, su2double **Jacobian_i, su2double **Jacobian_j, CConfig *config) override
Compute the viscous residual of the P1 equation.
Definition radiation.cpp:79
Main class for defining the problem; basically this class reads the configuration file,...
Definition CConfig.hpp:64
Class to represent a matrix (without owning the data, this just wraps a pointer).
Definition container_decorators.hpp:40
Definition radiation.hpp:33
su2double Absorption_Coeff
Absorption coefficient.
Definition radiation.hpp:40
CMatrixView< const su2double > RadVar_Grad_i
Gradient of turbulent variables at point i.
Definition radiation.hpp:38
void SetRadVar(const su2double *val_radvar_i, const su2double *val_radvar_j) final
Set the value of the radiation variable.
Definition radiation.hpp:59
su2double Scattering_Coeff
Scattering coefficient.
Definition radiation.hpp:41
bool implicit
Definition radiation.hpp:35
CMatrixView< const su2double > RadVar_Grad_j
Gradient of turbulent variables at point j.
Definition radiation.hpp:39
su2double Temperature_Ref
Reference temperature for redimensionalization of P1 solver.
Definition radiation.hpp:43
const su2double * RadVar_i
Vector of radiation variables at point i.
Definition radiation.hpp:36
void SetRadVarGradient(CMatrixView< const su2double > val_radvar_grad_i, CMatrixView< const su2double > val_radvar_grad_j) final
Set the gradient of the radiation variables.
Definition radiation.hpp:69
bool incompressible
Definition radiation.hpp:35
const su2double * RadVar_j
Vector of radiation variables at point j.
Definition radiation.hpp:37
Class for defining the numerical methods.
Definition CNumerics.hpp:48
Definition radiation.hpp:78
void ComputeResidual(su2double *val_residual, su2double **val_Jacobian_i, CConfig *config) override
Source term integration of the P1 model.
Definition radiation.cpp:51
passivedouble su2double
Definition code_config.hpp:181