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