From 4e69e2ef7541348980cbdf9cd8ce572cfaa31630 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sat, 25 Mar 2023 17:26:56 +0000 Subject: [PATCH] avoid mixing the important output groups --- SU2_CFD/include/output/CFlowOutput.hpp | 6 +++--- SU2_CFD/src/output/CFlowCompOutput.cpp | 6 +++--- SU2_CFD/src/output/CFlowIncOutput.cpp | 6 +++--- SU2_CFD/src/output/CFlowOutput.cpp | 30 ++++++++++++++++++++------ SU2_CFD/src/output/CNEMOCompOutput.cpp | 6 +++--- 5 files changed, 35 insertions(+), 19 deletions(-) diff --git a/SU2_CFD/include/output/CFlowOutput.hpp b/SU2_CFD/include/output/CFlowOutput.hpp index 9020076486e1..e18d04f82d46 100644 --- a/SU2_CFD/include/output/CFlowOutput.hpp +++ b/SU2_CFD/include/output/CFlowOutput.hpp @@ -115,20 +115,20 @@ class CFlowOutput : public CFVMOutput{ * \note The order of fields in restart files is fixed. Therefore the split-up. * \param[in] config - Definition of the particular problem. */ - void SetVolumeOutputFields_ScalarSolution(const CConfig* config); + void SetVolumeOutputFieldsScalarSolution(const CConfig* config); /*! * \brief Add scalar (turbulence/species) volume solution fields for a point (FVMComp, FVMInc, FVMNEMO). * \note The order of fields in restart files is fixed. Therefore the split-up. * \param[in] config - Definition of the particular problem. */ - void SetVolumeOutputFields_ScalarResidual(const CConfig* config); + void SetVolumeOutputFieldsScalarResidual(const CConfig* config); /*! * \brief Add scalar (turbulence/species) volume limiter fields (and more) for a point (FVMComp, FVMInc, FVMNEMO). * \param[in] config - Definition of the particular problem. */ - void SetVolumeOutputFields_ScalarLimiter(const CConfig* config); + void SetVolumeOutputFieldsScalarMisc(const CConfig* config); /*! * \brief Set all scalar (turbulence/species) volume field values for a point. diff --git a/SU2_CFD/src/output/CFlowCompOutput.cpp b/SU2_CFD/src/output/CFlowCompOutput.cpp index 953c1d9015fb..ed330053a78c 100644 --- a/SU2_CFD/src/output/CFlowCompOutput.cpp +++ b/SU2_CFD/src/output/CFlowCompOutput.cpp @@ -222,7 +222,7 @@ void CFlowCompOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("MOMENTUM-Z", "Momentum_z", "SOLUTION", "z-component of the momentum vector"); AddVolumeOutput("ENERGY", "Energy", "SOLUTION", "Energy"); - SetVolumeOutputFields_ScalarSolution(config); + SetVolumeOutputFieldsScalarSolution(config); // Grid velocity if (gridMovement){ @@ -258,7 +258,7 @@ void CFlowCompOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("RES_MOMENTUM-Z", "Residual_Momentum_z", "RESIDUAL", "Residual of the z-momentum component"); AddVolumeOutput("RES_ENERGY", "Residual_Energy", "RESIDUAL", "Residual of the energy"); - SetVolumeOutputFields_ScalarResidual(config); + SetVolumeOutputFieldsScalarResidual(config); if (config->GetKind_SlopeLimit_Flow() != LIMITER::NONE && config->GetKind_SlopeLimit_Flow() != LIMITER::VAN_ALBADA_EDGE) { AddVolumeOutput("LIMITER_VELOCITY-X", "Limiter_Velocity_x", "LIMITER", "Limiter value of the x-velocity"); @@ -271,7 +271,7 @@ void CFlowCompOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("LIMITER_ENTHALPY", "Limiter_Enthalpy", "LIMITER", "Limiter value of the enthalpy"); } - SetVolumeOutputFields_ScalarLimiter(config); + SetVolumeOutputFieldsScalarMisc(config); // Roe Low Dissipation if (config->GetKind_RoeLowDiss() != NO_ROELOWDISS) { diff --git a/SU2_CFD/src/output/CFlowIncOutput.cpp b/SU2_CFD/src/output/CFlowIncOutput.cpp index 29aeef9e0155..01d91eec96ab 100644 --- a/SU2_CFD/src/output/CFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CFlowIncOutput.cpp @@ -298,7 +298,7 @@ void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){ if (heat || weakly_coupled_heat) AddVolumeOutput("TEMPERATURE", "Temperature","SOLUTION", "Temperature"); - SetVolumeOutputFields_ScalarSolution(config); + SetVolumeOutputFieldsScalarSolution(config); // Radiation variables if (config->AddRadiation()) @@ -344,7 +344,7 @@ void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){ if (config->GetEnergy_Equation()) AddVolumeOutput("RES_TEMPERATURE", "Residual_Temperature", "RESIDUAL", "Residual of the temperature"); - SetVolumeOutputFields_ScalarResidual(config); + SetVolumeOutputFieldsScalarResidual(config); if (config->GetKind_SlopeLimit_Flow() != LIMITER::NONE && config->GetKind_SlopeLimit_Flow() != LIMITER::VAN_ALBADA_EDGE) { AddVolumeOutput("LIMITER_PRESSURE", "Limiter_Pressure", "LIMITER", "Limiter value of the pressure"); @@ -356,7 +356,7 @@ void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("LIMITER_TEMPERATURE", "Limiter_Temperature", "LIMITER", "Limiter value of the temperature"); } - SetVolumeOutputFields_ScalarLimiter(config); + SetVolumeOutputFieldsScalarMisc(config); // Streamwise Periodicity if(streamwisePeriodic) { diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index ed0fb0f3a163..1f746db55582 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -1130,7 +1130,9 @@ void CFlowOutput::LoadHistoryData_Scalar(const CConfig* config, const CSolver* c } } -void CFlowOutput::SetVolumeOutputFields_ScalarSolution(const CConfig* config){ +void CFlowOutput::SetVolumeOutputFieldsScalarSolution(const CConfig* config){ + /*--- Only place outputs of the "SOLUTION" group here. ---*/ + switch (TurbModelFamily(config->GetKind_Turb_Model())) { case TURB_FAMILY::SA: AddVolumeOutput("NU_TILDE", "Nu_Tilde", "SOLUTION", "Spalart-Allmaras variable"); @@ -1149,9 +1151,6 @@ void CFlowOutput::SetVolumeOutputFields_ScalarSolution(const CConfig* config){ case TURB_TRANS_MODEL::LM: AddVolumeOutput("INTERMITTENCY", "LM_gamma", "SOLUTION", "LM intermittency"); AddVolumeOutput("RE_THETA_T", "LM_Re_t", "SOLUTION", "LM RE_THETA_T"); - AddVolumeOutput("INTERMITTENCY_SEP", "LM_gamma_sep", "PRIMITIVE", "LM intermittency"); - AddVolumeOutput("INTERMITTENCY_EFF", "LM_gamma_eff", "PRIMITIVE", "LM RE_THETA_T"); - AddVolumeOutput("TURB_INDEX", "Turb_index", "PRIMITIVE", "Turbulence index"); break; case TURB_TRANS_MODEL::NONE: @@ -1165,7 +1164,9 @@ void CFlowOutput::SetVolumeOutputFields_ScalarSolution(const CConfig* config){ } } -void CFlowOutput::SetVolumeOutputFields_ScalarResidual(const CConfig* config) { +void CFlowOutput::SetVolumeOutputFieldsScalarResidual(const CConfig* config) { + /*--- Only place outputs of the "RESIDUAL" group here. ---*/ + switch (TurbModelFamily(config->GetKind_Turb_Model())){ case TURB_FAMILY::SA: AddVolumeOutput("RES_NU_TILDE", "Residual_Nu_Tilde", "RESIDUAL", "Residual of the Spalart-Allmaras variable"); @@ -1193,12 +1194,13 @@ void CFlowOutput::SetVolumeOutputFields_ScalarResidual(const CConfig* config) { if (config->GetKind_Species_Model() != SPECIES_MODEL::NONE) { for (unsigned short iVar = 0; iVar < config->GetnSpecies(); iVar++){ AddVolumeOutput("RES_SPECIES_" + std::to_string(iVar), "Residual_Species_" + std::to_string(iVar), "RESIDUAL", "Residual of the transported species " + std::to_string(iVar)); - AddVolumeOutput("DIFFUSIVITY_" + std::to_string(iVar), "Diffusivity_" + std::to_string(iVar), "PRIMITIVE", "Diffusivity of the transported species " + std::to_string(iVar)); } } } -void CFlowOutput::SetVolumeOutputFields_ScalarLimiter(const CConfig* config) { +void CFlowOutput::SetVolumeOutputFieldsScalarMisc(const CConfig* config) { + /*--- Place "PRIMITIVE", "LIMITER", and other groups here. ---*/ + if (config->GetKind_SlopeLimit_Turb() != LIMITER::NONE) { switch (TurbModelFamily(config->GetKind_Turb_Model())) { case TURB_FAMILY::SA: @@ -1220,6 +1222,20 @@ void CFlowOutput::SetVolumeOutputFields_ScalarLimiter(const CConfig* config) { for (unsigned short iVar = 0; iVar < config->GetnSpecies(); iVar++) AddVolumeOutput("LIMITER_SPECIES_" + std::to_string(iVar), "Limiter_Species_" + std::to_string(iVar), "LIMITER", "Limiter value of the transported species " + std::to_string(iVar)); } + for (unsigned short iVar = 0; iVar < config->GetnSpecies(); iVar++) { + AddVolumeOutput("DIFFUSIVITY_" + std::to_string(iVar), "Diffusivity_" + std::to_string(iVar), "PRIMITIVE", "Diffusivity of the transported species " + std::to_string(iVar)); + } + } + + switch (config->GetKind_Trans_Model()) { + case TURB_TRANS_MODEL::LM: + AddVolumeOutput("INTERMITTENCY_SEP", "LM_gamma_sep", "PRIMITIVE", "LM intermittency"); + AddVolumeOutput("INTERMITTENCY_EFF", "LM_gamma_eff", "PRIMITIVE", "LM RE_THETA_T"); + AddVolumeOutput("TURB_INDEX", "Turb_index", "PRIMITIVE", "Turbulence index"); + break; + + case TURB_TRANS_MODEL::NONE: + break; } if (config->GetKind_Turb_Model() != TURB_MODEL::NONE) { diff --git a/SU2_CFD/src/output/CNEMOCompOutput.cpp b/SU2_CFD/src/output/CNEMOCompOutput.cpp index e2c799e269fa..7ad99be195ed 100644 --- a/SU2_CFD/src/output/CNEMOCompOutput.cpp +++ b/SU2_CFD/src/output/CNEMOCompOutput.cpp @@ -224,7 +224,7 @@ void CNEMOCompOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("ENERGY", "Energy", "SOLUTION", "Energy"); AddVolumeOutput("ENERGY_VE", "Energy_ve", "SOLUTION", "Energy_ve"); - SetVolumeOutputFields_ScalarSolution(config); + SetVolumeOutputFieldsScalarSolution(config); //Auxiliary variables for post-processment for(iSpecies = 0; iSpecies < nSpecies; iSpecies++) @@ -271,7 +271,7 @@ void CNEMOCompOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("RES_ENERGY", "Residual_Energy", "RESIDUAL", "Residual of the energy"); AddVolumeOutput("RES_ENERGY_VE", "Residual_Energy_ve", "RESIDUAL", "Residual of the energy_ve"); - SetVolumeOutputFields_ScalarResidual(config); + SetVolumeOutputFieldsScalarResidual(config); if (config->GetKind_SlopeLimit_Flow() != LIMITER::NONE && config->GetKind_SlopeLimit_Flow() != LIMITER::VAN_ALBADA_EDGE) { // Limiter values @@ -283,7 +283,7 @@ void CNEMOCompOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("LIMITER_ENERGY", "Limiter_Energy", "LIMITER", "Limiter value of the energy"); } - SetVolumeOutputFields_ScalarLimiter(config); + SetVolumeOutputFieldsScalarMisc(config); AddCommonFVMOutputs(config);