Documentation 6b54b78464
Loading...
Searching...
No Matches
CMMSIncEulerSolution.hpp
Go to the documentation of this file.
1/*!
2 * \file CMMSIncEulerSolution.hpp
3 * \brief Header file for the class CMMSIncEulerSolution.
4 * The implementations are in the <i>CMMSIncEulerSolution.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 CMMSIncEulerSolution
36 * \brief Class to define the required data for the manufactured solution of the
37 * incompressible Euler equations.
38 * \author T. Economon, E. van der Weide
39 */
41 protected:
42 /*--- Variables that define the solution and MMS source term. ---*/
43 su2double Density; /*!< \brief Density, must be constant. */
44 su2double Temperature; /*!< \brief Temperature, just to be safe. */
45
46 /*--- Constants, which describe this manufactured solution. This is a
47 solution where the primitive variables vary as a combination
48 of sine and cosine functions. The solution is from Salari K, and
49 Knupp P, "Code verification by the method of manufactured solutions,"
50 SAND 2000-1444, Sandia National Laboratories, Albuquerque, NM, 2000. ---*/
51
52 su2double P_0; /*!< \brief Parameter for the pressure solution. */
53 su2double u_0; /*!< \brief Parameter for the x-velocity solution. */
54 su2double v_0; /*!< \brief Parameter for the y-velocity solution. */
55 su2double epsilon; /*!< \brief Parameter for the velocity solutions. */
56
57 public:
58 /*!
59 * \brief Constructor of the class.
60 */
62
63 /*!
64 * \overload
65 * \param[in] val_nDim - Number of dimensions of the problem.
66 * \param[in] val_nvar - Number of variables of the problem.
67 * \param[in] val_iMesh - Multigrid level of the solver.
68 * \param[in] config - Configuration of the particular problem.
69 */
70 CMMSIncEulerSolution(unsigned short val_nDim, unsigned short val_nvar, unsigned short val_iMesh, CConfig* config);
71
72 /*!
73 * \brief Destructor of the class.
74 */
75 ~CMMSIncEulerSolution(void) override;
76
77 /*!
78 * \brief Get the exact solution at the current position and time.
79 * \param[in] val_coords - Cartesian coordinates of the current position.
80 * \param[in] val_t - Current physical time.
81 * \param[in] val_solution - Array where the exact solution is stored.
82 */
83 void GetSolution(const su2double* val_coords, const su2double val_t, su2double* val_solution) const override;
84
85 /*!
86 * \brief Get the boundary conditions state for an exact solution.
87 * \param[in] val_coords - Cartesian coordinates of the current position.
88 * \param[in] val_t - Current physical time.
89 * \param[in] val_solution - Array where the exact solution is stored.
90 */
91 void GetBCState(const su2double* val_coords, const su2double val_t, su2double* val_solution) const override;
92
93 /*!
94 * \brief Get the source term for the manufactured solution (MMS).
95 * \param[in] val_coords - Cartesian coordinates of the current position.
96 * \param[in] val_t - Current physical time.
97 * \param[in] val_solution - Array where the exact solution is stored.
98 */
99 void GetMMSSourceTerm(const su2double* val_coords, const su2double val_t, su2double* val_source) const override;
100
101 /*!
102 * \brief Whether or not this verification solution is a manufactured solution.
103 * \return - True, because this is a manufactured solution.
104 */
105 bool IsManufacturedSolution(void) const override;
106};
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 incompressible Euler equations...
Definition CMMSIncEulerSolution.hpp:40
su2double Temperature
Temperature, just to be safe.
Definition CMMSIncEulerSolution.hpp:44
bool IsManufacturedSolution(void) const override
Whether or not this verification solution is a manufactured solution.
Definition CMMSIncEulerSolution.cpp:131
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 CMMSIncEulerSolution.cpp:89
su2double v_0
Parameter for the y-velocity solution.
Definition CMMSIncEulerSolution.hpp:54
su2double u_0
Parameter for the x-velocity solution.
Definition CMMSIncEulerSolution.hpp:53
su2double Density
Density, must be constant.
Definition CMMSIncEulerSolution.hpp:43
~CMMSIncEulerSolution(void) override
Destructor of the class.
su2double P_0
Parameter for the pressure solution.
Definition CMMSIncEulerSolution.hpp:52
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 CMMSIncEulerSolution.cpp:110
CMMSIncEulerSolution(void)
Constructor of the class.
Definition CMMSIncEulerSolution.cpp:30
su2double epsilon
Parameter for the velocity solutions.
Definition CMMSIncEulerSolution.hpp:55
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 CMMSIncEulerSolution.cpp:83
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