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

Fix adjoint MUSCL species bug #1550

Merged
merged 16 commits into from
Mar 15, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
26 changes: 13 additions & 13 deletions Common/include/CConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,12 @@ class CConfig {
DIFFUSIVITYMODEL Kind_Diffusivity_Model; /*!< \brief Kind of the mass diffusivity Model */
FREESTREAM_OPTION Kind_FreeStreamOption; /*!< \brief Kind of free stream option to choose if initializing with density or temperature */
MAIN_SOLVER Kind_Solver; /*!< \brief Kind of solver: Euler, NS, Continuous adjoint, etc. */
ENUM_LIMITER Kind_SlopeLimit, /*!< \brief Global slope limiter. */
Kind_SlopeLimit_Flow, /*!< \brief Slope limiter for flow equations.*/
Kind_SlopeLimit_Turb, /*!< \brief Slope limiter for the turbulence equation.*/
Kind_SlopeLimit_AdjTurb, /*!< \brief Slope limiter for the adjoint turbulent equation.*/
Kind_SlopeLimit_AdjFlow, /*!< \brief Slope limiter for the adjoint equation.*/
Kind_SlopeLimit_Species; /*!< \brief Slope limiter for the species equation.*/
unsigned short Kind_FluidModel, /*!< \brief Kind of the Fluid Model: Ideal, van der Waals, etc. */
Kind_InitOption, /*!< \brief Kind of Init option to choose if initializing with Reynolds number or with thermodynamic conditions */
Kind_GridMovement, /*!< \brief Kind of the static mesh movement. */
Expand All @@ -505,12 +511,6 @@ class CConfig {
Kind_AdjTurb_Linear_Prec, /*!< \brief Preconditioner of the turbulent adjoint linear solver. */
Kind_DiscAdj_Linear_Solver, /*!< \brief Linear solver for the discrete adjoint system. */
Kind_DiscAdj_Linear_Prec, /*!< \brief Preconditioner of the discrete adjoint linear solver. */
Kind_SlopeLimit, /*!< \brief Global slope limiter. */
Kind_SlopeLimit_Flow, /*!< \brief Slope limiter for flow equations.*/
Kind_SlopeLimit_Turb, /*!< \brief Slope limiter for the turbulence equation.*/
Kind_SlopeLimit_AdjTurb, /*!< \brief Slope limiter for the adjoint turbulent equation.*/
Kind_SlopeLimit_AdjFlow, /*!< \brief Slope limiter for the adjoint equation.*/
Kind_SlopeLimit_Species, /*!< \brief Slope limiter for the species equation.*/
Kind_TimeNumScheme, /*!< \brief Global explicit or implicit time integration. */
Kind_TimeIntScheme_Flow, /*!< \brief Time integration for the flow equations. */
Kind_TimeIntScheme_FEM_Flow, /*!< \brief Time integration for the flow equations. */
Expand Down Expand Up @@ -2302,7 +2302,7 @@ class CConfig {
* \param[in] val_kind_fem - If FEM, what kind of FEM discretization.
*/
void SetKind_ConvNumScheme(unsigned short val_kind_convnumscheme, unsigned short val_kind_centered,
unsigned short val_kind_upwind, unsigned short val_kind_slopelimit,
unsigned short val_kind_upwind, ENUM_LIMITER val_kind_slopelimit,
bool val_muscl, unsigned short val_kind_fem);

/*!
Expand Down Expand Up @@ -4571,37 +4571,37 @@ class CConfig {
* \brief Get the method for limiting the spatial gradients.
* \return Method for limiting the spatial gradients.
*/
unsigned short GetKind_SlopeLimit(void) const { return Kind_SlopeLimit; }
ENUM_LIMITER GetKind_SlopeLimit(void) const { return Kind_SlopeLimit; }

/*!
* \brief Get the method for limiting the spatial gradients.
* \return Method for limiting the spatial gradients solving the flow equations.
*/
unsigned short GetKind_SlopeLimit_Flow(void) const { return Kind_SlopeLimit_Flow; }
ENUM_LIMITER GetKind_SlopeLimit_Flow(void) const { return Kind_SlopeLimit_Flow; }

/*!
* \brief Get the method for limiting the spatial gradients.
* \return Method for limiting the spatial gradients solving the turbulent equation.
*/
unsigned short GetKind_SlopeLimit_Turb(void) const { return Kind_SlopeLimit_Turb; }
ENUM_LIMITER GetKind_SlopeLimit_Turb(void) const { return Kind_SlopeLimit_Turb; }

/*!
* \brief Get the method for limiting the spatial gradients.
* \return Method for limiting the spatial gradients solving the species equation.
*/
unsigned short GetKind_SlopeLimit_Species() const { return Kind_SlopeLimit_Species; }
ENUM_LIMITER GetKind_SlopeLimit_Species() const { return Kind_SlopeLimit_Species; }

/*!
* \brief Get the method for limiting the spatial gradients.
* \return Method for limiting the spatial gradients solving the adjoint turbulent equation.
*/
unsigned short GetKind_SlopeLimit_AdjTurb(void) const { return Kind_SlopeLimit_AdjTurb; }
ENUM_LIMITER GetKind_SlopeLimit_AdjTurb(void) const { return Kind_SlopeLimit_AdjTurb; }

/*!
* \brief Get the method for limiting the spatial gradients.
* \return Method for limiting the spatial gradients solving the adjoint flow equation.
*/
unsigned short GetKind_SlopeLimit_AdjFlow(void) const { return Kind_SlopeLimit_AdjFlow; }
ENUM_LIMITER GetKind_SlopeLimit_AdjFlow(void) const { return Kind_SlopeLimit_AdjFlow; }

/*!
* \brief Value of the calibrated constant for the Lax method (center scheme).
Expand Down
30 changes: 15 additions & 15 deletions Common/include/option_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -887,23 +887,23 @@ static const MapType<std::string, ENUM_MATRIX_COLORING> MatrixColoring_Map = {
/*!
* \brief Types of slope limiters
*/
enum ENUM_LIMITER {
NO_LIMITER = 0, /*!< \brief No limiter. */
VENKATAKRISHNAN = 1, /*!< \brief Slope limiter using Venkatakrisnan method (stencil formulation). */
VENKATAKRISHNAN_WANG = 2, /*!< \brief Slope limiter using Venkatakrisnan method, eps based on solution (stencil formulation). */
BARTH_JESPERSEN = 3, /*!< \brief Slope limiter using Barth-Jespersen method (stencil formulation). */
VAN_ALBADA_EDGE = 4, /*!< \brief Slope limiter using Van Albada method (edge formulation). */
SHARP_EDGES = 5, /*!< \brief Slope limiter using sharp edges. */
WALL_DISTANCE = 6 /*!< \brief Slope limiter using wall distance. */
enum class ENUM_LIMITER {
pcarruscag marked this conversation as resolved.
Show resolved Hide resolved
NONE , /*!< \brief No limiter. */
VENKATAKRISHNAN , /*!< \brief Slope limiter using Venkatakrisnan method (stencil formulation). */
VENKATAKRISHNAN_WANG , /*!< \brief Slope limiter using Venkatakrisnan method, eps based on solution (stencil formulation). */
BARTH_JESPERSEN , /*!< \brief Slope limiter using Barth-Jespersen method (stencil formulation). */
VAN_ALBADA_EDGE , /*!< \brief Slope limiter using Van Albada method (edge formulation). */
SHARP_EDGES , /*!< \brief Slope limiter using sharp edges. */
WALL_DISTANCE /*!< \brief Slope limiter using wall distance. */
};
static const MapType<std::string, ENUM_LIMITER> Limiter_Map = {
MakePair("NONE", NO_LIMITER)
MakePair("VENKATAKRISHNAN", VENKATAKRISHNAN)
MakePair("VENKATAKRISHNAN_WANG", VENKATAKRISHNAN_WANG)
MakePair("BARTH_JESPERSEN", BARTH_JESPERSEN)
MakePair("VAN_ALBADA_EDGE", VAN_ALBADA_EDGE)
MakePair("SHARP_EDGES", SHARP_EDGES)
MakePair("WALL_DISTANCE", WALL_DISTANCE)
MakePair("NONE", ENUM_LIMITER::NONE)
MakePair("VENKATAKRISHNAN", ENUM_LIMITER::VENKATAKRISHNAN)
MakePair("VENKATAKRISHNAN_WANG", ENUM_LIMITER::VENKATAKRISHNAN_WANG)
MakePair("BARTH_JESPERSEN", ENUM_LIMITER::BARTH_JESPERSEN)
MakePair("VAN_ALBADA_EDGE", ENUM_LIMITER::VAN_ALBADA_EDGE)
MakePair("SHARP_EDGES", ENUM_LIMITER::SHARP_EDGES)
MakePair("WALL_DISTANCE", ENUM_LIMITER::WALL_DISTANCE)
};

/*!
Expand Down
Loading