Documentation 6b54b78464
Loading...
Searching...
No Matches
template.hpp
Go to the documentation of this file.
1/*!
2 * \file template.hpp
3 * \brief Declarations of template (empty) numerics classes, these give
4 * an idea of the methods that need to be defined to implement
5 * new schemes in SU2, in practice you should look for a similar
6 * scheme and try to re-use functionality (not by copy-paste).
7 * \author F. Palacios, T. Economon
8 * \version 8.5.0 "Harrier"
9 *
10 * SU2 Project Website: https://su2code.github.io
11 *
12 * The SU2 Project is maintained by the SU2 Foundation
13 * (http://su2foundation.org)
14 *
15 * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md)
16 *
17 * SU2 is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU Lesser General Public
19 * License as published by the Free Software Foundation; either
20 * version 2.1 of the License, or (at your option) any later version.
21 *
22 * SU2 is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 * Lesser General Public License for more details.
26 *
27 * You should have received a copy of the GNU Lesser General Public
28 * License along with SU2. If not, see <http://www.gnu.org/licenses/>.
29 */
30
31#pragma once
32
33#include "CNumerics.hpp"
34
35/*!
36 * \class CConvectiveTemplate
37 * \brief Class for setting up new method for spatial discretization of convective terms in flow equations.
38 * \ingroup ConvDiscr
39 * \author A. Lonkar
40 */
42private:
43
44 /* define private variables here */
45
46public:
47 /*!
48 * \brief Constructor of the class.
49 * \param[in] val_nDim - Number of dimensions of the problem.
50 * \param[in] val_nVar - Number of variables of the problem.
51 * \param[in] config - Definition of the particular problem.
52 */
53 CConvective_Template(unsigned short val_nDim, unsigned short val_nVar, CConfig *config);
54
55 /*!
56 * \brief Destructor of the class.
57 */
58 ~CConvective_Template(void) override;
59
60 /*!
61 * \brief Compute the Roe's flux between two nodes i and j.
62 * \param[out] val_residual - Pointer to the total residual.
63 * \param[out] val_Jacobian_i - Jacobian of the numerical method at node i (implicit computation).
64 * \param[out] val_Jacobian_j - Jacobian of the numerical method at node j (implicit computation).
65 * \param[in] config - Definition of the particular problem.
66 */
67 void ComputeResidual(su2double *val_residual, su2double **val_Jacobian_i, su2double **val_Jacobian_j, CConfig *config) override;
68};
69
70/*!
71 * \class CViscous_Template
72 * \brief Class for computing viscous term using average of gradients.
73 * \ingroup ViscDiscr
74 * \author F. Palacios
75 */
77private:
78
79 /* define private variables here */
80
81public:
82 /*!
83 * \brief Constructor of the class.
84 * \param[in] val_nDim - Number of dimension of the problem.
85 * \param[in] val_nVar - Number of variables of the problem.
86 * \param[in] config - Definition of the particular problem.
87 */
88 CViscous_Template(unsigned short val_nDim, unsigned short val_nVar, CConfig *config);
89
90 /*!
91 * \brief Destructor of the class.
92 */
93 ~CViscous_Template(void) override;
94
95 /*!
96 * \brief Compute the viscous flow residual using an average of gradients.
97 * \param[out] val_residual - Pointer to the total residual.
98 * \param[out] val_Jacobian_i - Jacobian of the numerical method at node i (implicit computation).
99 * \param[out] val_Jacobian_j - Jacobian of the numerical method at node j (implicit computation).
100 * \param[in] config - Definition of the particular problem.
101 */
102 void ComputeResidual(su2double *val_residual, su2double **val_Jacobian_i, su2double **val_Jacobian_j, CConfig *config) override;
103};
104
105/*!
106 * \class CSource_Template
107 * \brief Dummy class.
108 * \ingroup SourceDiscr
109 * \author A. Lonkar.
110 */
112private:
113
114 /* define private variables here */
115
116public:
117 /*!
118 * \brief Constructor of the class.
119 * \param[in] val_nDim - Number of dimensions of the problem.
120 * \param[in] val_nVar - Number of variables of the problem.
121 * \param[in] config - Name of the input config file
122 *
123 */
124 CSource_Template(unsigned short val_nDim, unsigned short val_nVar, CConfig *config);
125
126 /*!
127 * \brief Residual for source term integration.
128 * \param[out] val_residual - Pointer to the total residual.
129 * \param[out] val_Jacobian_i - Jacobian of the numerical method at node i (implicit computation).
130 * \param[in] config - Definition of the particular problem.
131 */
132 void ComputeResidual(su2double *val_residual, su2double **val_Jacobian_i, CConfig *config) override;
133
134 /*!
135 * \brief Destructor of the class.
136 */
137 ~CSource_Template(void) override;
138};
Declaration of the base numerics class, the implementation is in the CNumerics.cpp file.
Main class for defining the problem; basically this class reads the configuration file,...
Definition CConfig.hpp:64
Definition template.hpp:41
void ComputeResidual(su2double *val_residual, su2double **val_Jacobian_i, su2double **val_Jacobian_j, CConfig *config) override
Compute the Roe's flux between two nodes i and j.
Definition template.cpp:37
~CConvective_Template(void) override
Destructor of the class.
Class for defining the numerical methods.
Definition CNumerics.hpp:48
Dummy class.
Definition template.hpp:111
~CSource_Template(void) override
Destructor of the class.
void ComputeResidual(su2double *val_residual, su2double **val_Jacobian_i, CConfig *config) override
Residual for source term integration.
Definition template.cpp:62
Class for computing viscous term using average of gradients.
Definition template.hpp:76
~CViscous_Template(void) override
Destructor of the class.
void ComputeResidual(su2double *val_residual, su2double **val_Jacobian_i, su2double **val_Jacobian_j, CConfig *config) override
Compute the viscous flow residual using an average of gradients.
Definition template.cpp:49
passivedouble su2double
Definition code_config.hpp:181