Documentation 6b54b78464
Loading...
Searching...
No Matches
CMMSNSUnitQuadSolution.hpp
Go to the documentation of this file.
1/*!
2 * \file CMMSNSUnitQuadSolution.hpp
3 * \brief Header file for the class CMMSNSUnitQuadSolution.
4 * The implementations are in the <i>CMMSNSUnitQuadSolution.cpp</i> file.
5 * \author T. Economon, E. van der Weide
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 <cmath>
33
34/*!
35 * \class CMMSNSUnitQuadSolution
36 * \brief Class to define the required data for the manufactured solution of the
37 laminar Navier-Stokes equations on a unit quad.
38 * \author E. van der Weide, T. Economon
39 */
41 protected:
42 /*--- Variables that define the solution and MMS source term. ---*/
43 su2double Gamma; /*!< \brief Specific heat ratio. */
44 su2double RGas; /*!< \brief Gas constant. */
45 su2double Viscosity; /*!< \brief Viscosity, must be constant. */
46 su2double Conductivity; /*!< \brief Thermal conductivity, must be constant. */
47
48 /*--- Constants, which describe this manufactured solution. This is a viscous
49 solution on the unit quad, where the primitive variables vary as a
50 combination of sine and cosine functions. The unit quad is probably not
51 necessary, and an arbitrary domain should work as well. ---*/
52
53 su2double L; /*!< \brief Length scale. */
54 su2double a_Px; /*!< \brief Parameter for the pressure solution. */
55 su2double a_Pxy; /*!< \brief Parameter for the pressure solution. */
56 su2double a_Py; /*!< \brief Parameter for the pressure solution. */
57 su2double a_rhox; /*!< \brief Parameter for the density solution. */
58 su2double a_rhoxy; /*!< \brief Parameter for the density solution. */
59 su2double a_rhoy; /*!< \brief Parameter for the density solution. */
60 su2double a_ux; /*!< \brief Parameter for the x-velocity solution. */
61 su2double a_uxy; /*!< \brief Parameter for the x-velocity solution. */
62 su2double a_uy; /*!< \brief Parameter for the x-velocity solution. */
63 su2double a_vx; /*!< \brief Parameter for the y-velocity solution. */
64 su2double a_vxy; /*!< \brief Parameter for the y-velocity solution. */
65 su2double a_vy; /*!< \brief Parameter for the y-velocity solution. */
66 su2double P_0; /*!< \brief Parameter for the pressure solution. */
67 su2double P_x; /*!< \brief Parameter for the pressure solution. */
68 su2double P_xy; /*!< \brief Parameter for the pressure solution. */
69 su2double P_y; /*!< \brief Parameter for the pressure solution. */
70 su2double rho_0; /*!< \brief Parameter for the density solution. */
71 su2double rho_x; /*!< \brief Parameter for the density solution. */
72 su2double rho_xy; /*!< \brief Parameter for the density solution. */
73 su2double rho_y; /*!< \brief Parameter for the density solution. */
74 su2double u_0; /*!< \brief Parameter for the x-velocity solution. */
75 su2double u_x; /*!< \brief Parameter for the x-velocity solution. */
76 su2double u_xy; /*!< \brief Parameter for the x-velocity solution. */
77 su2double u_y; /*!< \brief Parameter for the x-velocity solution. */
78 su2double v_0; /*!< \brief Parameter for the y-velocity solution. */
79 su2double v_x; /*!< \brief Parameter for the y-velocity solution. */
80 su2double v_xy; /*!< \brief Parameter for the y-velocity solution. */
81 su2double v_y; /*!< \brief Parameter for the y-velocity solution. */
82
83 public:
84 /*!
85 * \brief Constructor of the class.
86 */
88
89 /*!
90 * \overload
91 * \param[in] val_nDim - Number of dimensions of the problem.
92 * \param[in] val_nvar - Number of variables of the problem.
93 * \param[in] val_iMesh - Multigrid level of the solver.
94 * \param[in] config - Configuration of the particular problem.
95 */
96 CMMSNSUnitQuadSolution(unsigned short val_nDim, unsigned short val_nvar, unsigned short val_iMesh, CConfig* config);
97
98 /*!
99 * \brief Destructor of the class.
100 */
102
103 /*!
104 * \brief Get the exact solution at the current position and time.
105 * \param[in] val_coords - Cartesian coordinates of the current position.
106 * \param[in] val_t - Current physical time.
107 * \param[in] val_solution - Array where the exact solution is stored.
108 */
109 void GetSolution(const su2double* val_coords, const su2double val_t, su2double* val_solution) const override;
110
111 /*!
112 * \brief Get the boundary conditions state for an exact solution.
113 * \param[in] val_coords - Cartesian coordinates of the current position.
114 * \param[in] val_t - Current physical time.
115 * \param[in] val_solution - Array where the exact solution is stored.
116 */
117 void GetBCState(const su2double* val_coords, const su2double val_t, su2double* val_solution) const override;
118
119 /*!
120 * \brief Get the source term for the manufactured solution (MMS).
121 * \param[in] val_coords - Cartesian coordinates of the current position.
122 * \param[in] val_t - Current physical time.
123 * \param[in] val_solution - Array where the exact solution is stored.
124 */
125 void GetMMSSourceTerm(const su2double* val_coords, const su2double val_t, su2double* val_source) const override;
126
127 /*!
128 * \brief Whether or not this verification solution is a manufactured solution.
129 * \return - True, because this is a manufactured solution.
130 */
131 bool IsManufacturedSolution(void) const override;
132};
Header file for the base class CVerificationSolution. The implementations are in the CVerificationSol...
Main class for defining the problem; basically this class reads the configuration file,...
Definition CConfig.hpp:64
Class to define the required data for the manufactured solution of the laminar Navier-Stokes equation...
Definition CMMSNSUnitQuadSolution.hpp:40
su2double L
Length scale.
Definition CMMSNSUnitQuadSolution.hpp:53
su2double RGas
Gas constant.
Definition CMMSNSUnitQuadSolution.hpp:44
su2double a_vx
Parameter for the y-velocity solution.
Definition CMMSNSUnitQuadSolution.hpp:63
su2double a_Px
Parameter for the pressure solution.
Definition CMMSNSUnitQuadSolution.hpp:54
su2double u_0
Parameter for the x-velocity solution.
Definition CMMSNSUnitQuadSolution.hpp:74
su2double P_0
Parameter for the pressure solution.
Definition CMMSNSUnitQuadSolution.hpp:66
su2double v_y
Parameter for the y-velocity solution.
Definition CMMSNSUnitQuadSolution.hpp:81
su2double rho_x
Parameter for the density solution.
Definition CMMSNSUnitQuadSolution.hpp:71
su2double a_uy
Parameter for the x-velocity solution.
Definition CMMSNSUnitQuadSolution.hpp:62
su2double v_xy
Parameter for the y-velocity solution.
Definition CMMSNSUnitQuadSolution.hpp:80
void GetSolution(const su2double *val_coords, const su2double val_t, su2double *val_solution) const override
Get the exact solution at the current position and time.
Definition CMMSNSUnitQuadSolution.cpp:118
su2double a_rhox
Parameter for the density solution.
Definition CMMSNSUnitQuadSolution.hpp:57
su2double a_vy
Parameter for the y-velocity solution.
Definition CMMSNSUnitQuadSolution.hpp:65
su2double Gamma
Specific heat ratio.
Definition CMMSNSUnitQuadSolution.hpp:43
su2double u_xy
Parameter for the x-velocity solution.
Definition CMMSNSUnitQuadSolution.hpp:76
su2double P_xy
Parameter for the pressure solution.
Definition CMMSNSUnitQuadSolution.hpp:68
su2double v_x
Parameter for the y-velocity solution.
Definition CMMSNSUnitQuadSolution.hpp:79
su2double a_Py
Parameter for the pressure solution.
Definition CMMSNSUnitQuadSolution.hpp:56
~CMMSNSUnitQuadSolution(void) override
Destructor of the class.
void GetMMSSourceTerm(const su2double *val_coords, const su2double val_t, su2double *val_source) const override
Get the source term for the manufactured solution (MMS).
Definition CMMSNSUnitQuadSolution.cpp:151
su2double v_0
Parameter for the y-velocity solution.
Definition CMMSNSUnitQuadSolution.hpp:78
su2double u_x
Parameter for the x-velocity solution.
Definition CMMSNSUnitQuadSolution.hpp:75
su2double u_y
Parameter for the x-velocity solution.
Definition CMMSNSUnitQuadSolution.hpp:77
su2double Viscosity
Viscosity, must be constant.
Definition CMMSNSUnitQuadSolution.hpp:45
su2double a_ux
Parameter for the x-velocity solution.
Definition CMMSNSUnitQuadSolution.hpp:60
bool IsManufacturedSolution(void) const override
Whether or not this verification solution is a manufactured solution.
Definition CMMSNSUnitQuadSolution.cpp:386
su2double a_rhoxy
Parameter for the density solution.
Definition CMMSNSUnitQuadSolution.hpp:58
su2double rho_0
Parameter for the density solution.
Definition CMMSNSUnitQuadSolution.hpp:70
su2double a_rhoy
Parameter for the density solution.
Definition CMMSNSUnitQuadSolution.hpp:59
su2double rho_xy
Parameter for the density solution.
Definition CMMSNSUnitQuadSolution.hpp:72
su2double rho_y
Parameter for the density solution.
Definition CMMSNSUnitQuadSolution.hpp:73
su2double P_y
Parameter for the pressure solution.
Definition CMMSNSUnitQuadSolution.hpp:69
void GetBCState(const su2double *val_coords, const su2double val_t, su2double *val_solution) const override
Get the boundary conditions state for an exact solution.
Definition CMMSNSUnitQuadSolution.cpp:112
su2double a_vxy
Parameter for the y-velocity solution.
Definition CMMSNSUnitQuadSolution.hpp:64
su2double a_uxy
Parameter for the x-velocity solution.
Definition CMMSNSUnitQuadSolution.hpp:61
su2double P_x
Parameter for the pressure solution.
Definition CMMSNSUnitQuadSolution.hpp:67
su2double a_Pxy
Parameter for the pressure solution.
Definition CMMSNSUnitQuadSolution.hpp:55
su2double Conductivity
Thermal conductivity, must be constant.
Definition CMMSNSUnitQuadSolution.hpp:46
CMMSNSUnitQuadSolution(void)
Constructor of the class.
Definition CMMSNSUnitQuadSolution.cpp:30
Class for holding verification PDE solutions, e.g., phi = phi(x,y,z,t), used for initial conditions,...
Definition CVerificationSolution.hpp:40
passivedouble su2double
Definition code_config.hpp:181