Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduction of AUSM+M and AUSM scheme refactoring in NEMO #1773

Merged
merged 30 commits into from
Feb 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
9faa195
Introduction of a new convective scheme for NEMO: AUSM+M
fmpmorgado Sep 26, 2022
cb18c21
Changes in config_template
fmpmorgado Sep 26, 2022
84cdb7e
Remove unused variables
fmpmorgado Sep 26, 2022
6f7d79f
Code cleanup and use of Sensores
fmpmorgado Sep 26, 2022
787c7ea
Changed TNE2 comment to NEMO
fmpmorgado Sep 26, 2022
67ded69
Remove unused variables
fmpmorgado Sep 27, 2022
39dcc76
Merge branch 'develop' into feature_NEMO_AUSMPLUSM_clean
fmpmorgado Sep 27, 2022
0f7a463
Minor changes
fmpmorgado Sep 27, 2022
3b3643a
Merge branch 'feature_NEMO_AUSMPLUSM_clean' of https://github.com/su2…
fmpmorgado Sep 27, 2022
be9962e
More cleaning
fmpmorgado Sep 27, 2022
794b956
Merge branch 'develop' into feature_NEMO_AUSMPLUSM_clean
fmpmorgado Sep 27, 2022
15b5831
Merge branch 'develop' into feature_NEMO_AUSMPLUSM_clean
fmpmorgado Oct 12, 2022
5996166
Merge branch 'develop' into feature_NEMO_AUSMPLUSM_clean
fmpmorgado Nov 16, 2022
60955d4
Merge branch 'develop' into feature_NEMO_AUSMPLUSM_clean
fmpmorgado Nov 21, 2022
a5d4ab4
update to develop
WallyMaier Jan 11, 2023
6694a34
Merge branch 'develop' into feature_NEMO_AUSMPLUSM_clean
WallyMaier Jan 11, 2023
6328e91
compiles again
WallyMaier Jan 11, 2023
654343c
Merge branch 'feature_NEMO_AUSMPLUSM_clean' of https://github.com/su2…
WallyMaier Jan 11, 2023
d81b8f7
Merge branch 'develop' into feature_NEMO_AUSMPLUSM_clean
WallyMaier Jan 13, 2023
d718d71
Merge branch 'develop' into feature_NEMO_AUSMPLUSM_clean
WallyMaier Jan 17, 2023
745ef8f
adding a test case
WallyMaier Jan 18, 2023
e84c717
Merge branch 'develop' into feature_NEMO_AUSMPLUSM_clean
WallyMaier Jan 19, 2023
adea491
Apply suggestions from code review
WallyMaier Jan 19, 2023
a86cd63
Merge branch 'develop' into feature_NEMO_AUSMPLUSM_clean
WallyMaier Jan 24, 2023
a04a578
undoing line missing commits
WallyMaier Jan 24, 2023
622711d
Merge branch 'develop' into feature_NEMO_AUSMPLUSM_clean
WallyMaier Jan 31, 2023
7beea93
update ausm-m regression (explicit)
WallyMaier Jan 31, 2023
8cb2ba7
refactor AUSM schemes
WallyMaier Feb 3, 2023
2f6c008
addressing PR comments, update regressions
WallyMaier Feb 3, 2023
d90e08d
clang-format
pcarruscag Feb 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ staleLabel: stale
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs.
**If this is still a relevant issue please comment on it to restart the discussion.**
**If this is still a relevant issue please comment on it to restart the discussion.**
Thank you for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
2 changes: 1 addition & 1 deletion .github/workflows/release-management.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ jobs:
asset_path: ${{matrix.os_bin}}.zip
asset_name: SU2-${{ steps.update_release.outputs.tagname }}-${{matrix.os_bin}}.zip
asset_content_type: application/zip

2 changes: 1 addition & 1 deletion Common/include/CConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3714,7 +3714,7 @@ class CConfig {
*/
bool GetAUSMMethod(void) const {
switch (Kind_Upwind_Flow) {
case UPWIND::AUSM : case UPWIND::AUSMPLUSUP: case UPWIND::AUSMPLUSUP2: case UPWIND::AUSMPWPLUS:
case UPWIND::AUSM : case UPWIND::AUSMPLUSUP: case UPWIND::AUSMPLUSUP2: case UPWIND::AUSMPLUSM:
return true;
default:
return false;
Expand Down
4 changes: 2 additions & 2 deletions Common/include/option_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ enum class UPWIND {
LAX_FRIEDRICH, /*!< \brief Lax-Friedrich numerical method. */
AUSMPLUSUP, /*!< \brief AUSM+ -up numerical method (All Speed) */
AUSMPLUSUP2, /*!< \brief AUSM+ -up2 numerical method (All Speed) */
AUSMPWPLUS, /*!< \brief AUSMplus numerical method. (MAYBE for TNE2 ONLY)*/
AUSMPLUSM, /*!< \breif AUSM+M numerical method. (NEMO Only)*/
BOUNDED_SCALAR /*!< \brief Scalar advection numerical method. */
};
static const MapType<std::string, UPWIND> Upwind_Map = {
Expand All @@ -838,7 +838,7 @@ static const MapType<std::string, UPWIND> Upwind_Map = {
MakePair("AUSM", UPWIND::AUSM)
MakePair("AUSMPLUSUP", UPWIND::AUSMPLUSUP)
MakePair("AUSMPLUSUP2", UPWIND::AUSMPLUSUP2)
MakePair("AUSMPWPLUS", UPWIND::AUSMPWPLUS)
MakePair("AUSMPLUSM", UPWIND::AUSMPLUSM)
MakePair("SLAU", UPWIND::SLAU)
MakePair("HLLC", UPWIND::HLLC)
MakePair("SW", UPWIND::SW)
Expand Down
17 changes: 6 additions & 11 deletions Common/src/CConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2333,7 +2333,7 @@ void CConfig::SetConfig_Options() {
/*!\par CONFIG_CATEGORY: FEM flow solver definition \ingroup Config*/
/*--- Options related to the finite element flow solver---*/

/* DESCRIPTION: Riemann solver used for DG (ROE, LAX-FRIEDRICH, AUSM, AUSMPW+, HLLC, VAN_LEER) */
/* DESCRIPTION: Riemann solver used for DG (ROE, LAX-FRIEDRICH, AUSM, HLLC, VAN_LEER) */
addEnumOption("RIEMANN_SOLVER_FEM", Riemann_Solver_FEM, Upwind_Map, UPWIND::ROE);
/* DESCRIPTION: Constant factor applied for quadrature with straight elements (2.0 by default) */
addDoubleOption("QUADRATURE_FACTOR_STRAIGHT_FEM", Quadrature_Factor_Straight, 2.0);
Expand Down Expand Up @@ -3941,16 +3941,11 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
CURRENT_FUNCTION);
}

if (!ideal_gas && !nemo) {
if (Kind_Upwind_Flow != UPWIND::ROE && Kind_Upwind_Flow != UPWIND::HLLC && Kind_Centered_Flow != CENTERED::JST) {
SU2_MPI::Error("Only ROE Upwind, HLLC Upwind scheme, and JST scheme can be used for Non-Ideal Compressible Fluids", CURRENT_FUNCTION);
if (!ideal_gas && !nemo) {
if (Kind_Upwind_Flow != UPWIND::ROE && Kind_Upwind_Flow != UPWIND::HLLC && Kind_Centered_Flow != CENTERED::JST) {
SU2_MPI::Error("Only ROE Upwind, HLLC Upwind scheme, and JST scheme can be used for Non-Ideal Compressible Fluids", CURRENT_FUNCTION);
}
}
}

if (nemo){
if (Kind_Upwind_Flow == UPWIND::AUSMPWPLUS)
SU2_MPI::Error("AUSMPW+ is extremely unstable. Feel free to fix me!", CURRENT_FUNCTION);
}

if (GetBoolTurbomachinery()) {
nBlades = new su2double[nZone];
Expand Down Expand Up @@ -6639,7 +6634,7 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) {
if (Kind_Upwind_Flow == UPWIND::FDS) cout << "Flux difference splitting (FDS) upwind scheme for the flow inviscid terms."<< endl;
if (Kind_Upwind_Flow == UPWIND::AUSMPLUSUP) cout << "AUSM+-up solver for the flow inviscid terms."<< endl;
if (Kind_Upwind_Flow == UPWIND::AUSMPLUSUP2) cout << "AUSM+-up2 solver for the flow inviscid terms."<< endl;
if (Kind_Upwind_Flow == UPWIND::AUSMPWPLUS) cout << "AUSMPWPLUS solver for the flow inviscid terms."<< endl;
if (Kind_Upwind_Flow == UPWIND::AUSMPLUSM) cout << "AUSM+M solver for the flow inviscid terms."<< endl;

if (Kind_Solver == MAIN_SOLVER::EULER || Kind_Solver == MAIN_SOLVER::DISC_ADJ_EULER ||
Kind_Solver == MAIN_SOLVER::NAVIER_STOKES || Kind_Solver == MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES ||
Expand Down
10 changes: 4 additions & 6 deletions SU2_CFD/include/numerics/NEMO/CNEMONumerics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,17 @@
/*!
* \class CNEMONumerics
* \brief Base class template NEMO numerics.
* \author C. Garbacz.
* \author C. Garbacz., W. Maier
*/
class CNEMONumerics : public CNumerics {
public:
bool implicit, ionization;
su2double *rhos_i, *u_i;
su2double *rhos_j, *u_j;
su2double a_i, P_i, h_i;
su2double a_j, P_j, h_j;
su2double rho_i, rho_j;
su2double *rhos_i, *rhos_j;
su2double Velocity_i[MAXNDIM] = {0.0}, Velocity_j[MAXNDIM] = {0.0};
su2double e_ve_i, e_ve_j;
su2double rhoCvtr_i, rhoCvtr_j;
su2double rhoCvve_i, rhoCvve_j;
su2double ProjVelocity_i, ProjVelocity_j;
unsigned short nPrimVar, nPrimVarGrad;

su2double* Flux = nullptr; /*!< \brief The flux / residual across the edge. */
Expand Down
67 changes: 0 additions & 67 deletions SU2_CFD/include/numerics/NEMO/convection/ausm.hpp

This file was deleted.

226 changes: 226 additions & 0 deletions SU2_CFD/include/numerics/NEMO/convection/ausm_slau.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
/*!
* \file ausm_slau.hpp
* \brief Declaration of numerics classes for the AUSM and SLAU family of schemes in NEMO.
* \author F. Palacios, S.R. Copeland, W. Maier, C. Garbacz
* \version 7.5.0 "Blackbird"
*
* SU2 Project Website: https://su2code.github.io
*
* The SU2 Project is maintained by the SU2 Foundation
* (http://su2foundation.org)
*
* Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md)
*
* SU2 is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* SU2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with SU2. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include "../CNEMONumerics.hpp"

/*!
* \class CUpwAUSM_SLAU_Base_NEMO
* \brief Class for solving an approximate Riemann AUSM.
* \ingroup ConvDiscr
* \author F. Palacios, S.R. Copeland, W. Maier, C. Garbacz
*/
class CUpwAUSM_SLAU_Base_NEMO : public CNEMONumerics {
protected:
su2double A_F[2] = {0.0}, PressureFlux[MAXNDIM] = {0.0};
su2double M_L, M_R, M_F;

su2double* Fc_L = nullptr;
su2double* Fc_R = nullptr;
su2double* Fc_LR = nullptr;
su2double* dM_LP = nullptr;
su2double* dM_RM = nullptr;
su2double* dP_LP = nullptr;
su2double* dP_RM = nullptr;
su2double* da_L = nullptr;
su2double* da_R = nullptr;

su2double* Flux = nullptr; /*!< \brief The flux accross the face. */
su2double** Jacobian_i = nullptr; /*!< \brief The Jacobian w.r.t. point i after computation. */
su2double** Jacobian_j = nullptr; /*!< \brief The Jacobian w.r.t. point j after computation. */

/*!
* \brief Compute the interface Mach number, soundspeeds and pressure based on Primitives_i/j..
* \param[in] config - Definition of the particular problem.
* \param[out] pressure - The pressure at the control volume face.
* \param[out] interface_mach - The interface Mach number M_(1/2).
* \param[out] interface_soundspeed - The interface soundspeed (vector for i and j faces if necessary).
*/
virtual void ComputeInterfaceQuantities(const CConfig* config, su2double* pressure, su2double& interface_mach,
su2double* interface_soundspeed) = 0;

private:
/*!
* \brief Compute the flux Jacobians of the AUSM scheme to use as an approximation.
* \param[out] val_Jacobian_i - Jacobian of the numerical method at node i (implicit computation).
* \param[out] val_Jacobian_j - Jacobian of the numerical method at node j (implicit computation).
*/
void ComputeJacobian(su2double** val_Jacobian_i, su2double** val_Jacobian_j);

public:
/*!
* \brief Constructor of the class.
* \param[in] val_nDim - Number of dimension of the problem.
* \param[in] val_nVar - Number of variables of the problem.
* \param[in] val_nPrimVar - Number of primitive variables of the problem.
* \param[in] val_nPrimVarGrad - Number of primitive gradient variables of the problem.
* \param[in] config - Definition of the particular problem.
*/
CUpwAUSM_SLAU_Base_NEMO(unsigned short val_nDim, unsigned short val_nVar, unsigned short val_nPrimVar,
unsigned short val_nPrimVarGrad, const CConfig* config);

/*!
* \brief Destructor of the class.
*/
~CUpwAUSM_SLAU_Base_NEMO(void) override;

/*!
* \brief Compute the AUSM and SLAU family of schemes.
* \param[in] config - Definition of the particular problem.
* \return A lightweight const-view (read-only) of the residual/flux and Jacobians.
*/
ResidualType<> ComputeResidual(const CConfig* config) final;
};

/*!
* \class CUpwAUSM_NEMO
* \brief Class for solving an approximate Riemann AUSM.
* \ingroup ConvDiscr
* \author F. Palacios, S.R. Copeland, W. Maier, C. Garbacz
*/
class CUpwAUSM_NEMO final : public CUpwAUSM_SLAU_Base_NEMO {
private:
/*!
* \brief Compute the interface Mach number, soundspeeds and pressure for AUSM scheme.
* \param[in] config - Definition of the particular problem.
* \param[out] pressure - The pressure at the control volume face.
* \param[out] interface_mach - The interface Mach number M_(1/2).
* \param[out] interface_soundspeed - The interface soundspeed (vector for i and j faces if necessary).
*/
virtual void ComputeInterfaceQuantities(const CConfig* config, su2double* pressure, su2double& interface_mach,
su2double* interface_soundspeed) override;

public:
/*!
* \brief Constructor of the class.
* \param[in] val_nDim - Number of dimensions of the problem.
* \param[in] val_nVar - Number of variables of the problem.
* \param[in] val_nPrimVar - Number of primitive variables of the problem
* \param[in] val_nPrimVarGrad - Number of grad primitive variables of the problem
* \param[in] config - Definition of the particular problem.
*/
CUpwAUSM_NEMO(unsigned short val_nDim, unsigned short val_nVar, unsigned short val_nPrimVar,
unsigned short val_nPrimVarGrad, const CConfig* config);
};

/*!
* \class CUpwAUSMPLUSM_NEMO
* \brief Class for solving an approximate Riemann AUSM+ M, Two-Temperature Model.
* https://doi.org/10.1016/j.apm.2019.09.005 \ingroup ConvDiscr \author F. Morgado
*/
class CUpwAUSMPLUSM_NEMO final : public CUpwAUSM_SLAU_Base_NEMO {
private:
su2double beta;

/*!
* \brief Compute the interface Mach number, soundspeeds and pressure for AUSM+M scheme.
* \param[in] config - Definition of the particular problem.
* \param[out] pressure - The pressure at the control volume face.
* \param[out] interface_mach - The interface Mach number M_(1/2).
* \param[out] interface_soundspeed - The interface soundspeed (vector for i and j faces if necessary).
*/
virtual void ComputeInterfaceQuantities(const CConfig* config, su2double* pressure, su2double& interface_mach,
su2double* interface_soundspeed) override;

public:
/*!
* \brief Constructor of the class.
* \param[in] val_nDim - Number of dimension of the problem.
* \param[in] val_nVar - Number of variables of the problem.
* \param[in] val_nPrimVar - Number of primitive variables of the problem.
* \param[in] val_nPrimVarGrad - Number of primitive gradient variables of the problem.
* \param[in] config - Definition of the particular problem.
*/
CUpwAUSMPLUSM_NEMO(unsigned short val_nDim, unsigned short val_nVar, unsigned short val_nPrimVar,
unsigned short val_nPrimVarGrad, const CConfig* config);
};

/*!
* \class CUpwAUSMPLUSUP2_NEMO
* \brief Class for solving an approximate Riemann AUSM+-up2, Two-Temperature Model.
* https://doi.org/10.1016/j.jcp.2013.02.046 \ingroup ConvDiscr \author W. Maier, A. Sachedeva, C. Garbacz
*/
class CUpwAUSMPLUSUP2_NEMO final : public CUpwAUSM_SLAU_Base_NEMO {
private:
su2double Kp, Ku, sigma;

/*!
* \brief Compute the interface Mach number, soundspeeds and pressure for AUSM+-Up2 scheme.
* \param[in] config - Definition of the particular problem.
* \param[out] pressure - The pressure at the control volume face.
* \param[out] interface_mach - The interface Mach number M_(1/2).
* \param[out] interface_soundspeed - The interface soundspeed (vector for i and j faces if necessary).
*/
virtual void ComputeInterfaceQuantities(const CConfig* config, su2double* pressure, su2double& interface_mach,
su2double* interface_soundspeed) override;

public:
/*!
* \brief Constructor of the class.
* \param[in] val_nDim - Number of dimensions of the problem.
* \param[in] val_nVar - Number of variables of the problem.
* \param[in] val_nPrimVar - Number of primitive variables of the problem
* \param[in] val_nPrimVarGrad - Number of grad primitive variables of the problem
* \param[in] config - Definition of the particular problem.
*/
CUpwAUSMPLUSUP2_NEMO(unsigned short val_nDim, unsigned short val_nVar, unsigned short val_nPrimVar,
unsigned short val_nPrimVarGrad, const CConfig* config);
};

/*!
* \class CUpwAUSMPWplus_NEMO
* \brief Class for solving an approximate Riemann AUSM.
* \ingroup ConvDiscr
* \author F. Palacios, W.Maier, C. Garbacz
*/
class CUpwAUSMPWplus_NEMO : public CUpwAUSM_SLAU_Base_NEMO {
private:
su2double alpha;

/*!
* \brief Compute the interface Mach number, soundspeeds and pressure for AUSMpw+ scheme.
* \param[in] config - Definition of the particular problem.
* \param[out] pressure - The pressure at the control volume face.
* \param[out] interface_mach - The interface Mach number M_(1/2).
* \param[out] interface_soundspeed - The interface soundspeed (vector for i and j faces if necessary).
*/
virtual void ComputeInterfaceQuantities(const CConfig* config, su2double* pressure, su2double& interface_mach,
su2double* interface_soundspeed) override;

public:
/*!
* \brief Constructor of the class.
* \param[in] val_nDim - Number of dimensions of the problem.
* \param[in] val_nVar - Number of variables of the problem.
* \param[in] val_nPrimVar - Number of primitive variables of the problem
* \param[in] val_nPrimVarGrad - Number of grad primitive variables of the problem
* \param[in] config - Definition of the particular problem.
*/
CUpwAUSMPWplus_NEMO(unsigned short val_nDim, unsigned short val_nVar, unsigned short val_nPrimVar,
unsigned short val_nPrimVarGrad, const CConfig* config);
};
Loading