From 9129ac0fc8973dfac9a2ef79158ca7942344ea88 Mon Sep 17 00:00:00 2001 From: CatarinaGarbacz Date: Mon, 17 Jan 2022 13:41:32 +0000 Subject: [PATCH 1/2] protection for viscous flow with ionization --- SU2_CFD/src/fluid/CMutationTCLib.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/SU2_CFD/src/fluid/CMutationTCLib.cpp b/SU2_CFD/src/fluid/CMutationTCLib.cpp index 32c80f8151ac..57300d7659f5 100644 --- a/SU2_CFD/src/fluid/CMutationTCLib.cpp +++ b/SU2_CFD/src/fluid/CMutationTCLib.cpp @@ -59,8 +59,12 @@ CMutationTCLib::CMutationTCLib(const CConfig* config, unsigned short val_nDim): for(iSpecies = 0; iSpecies < nSpecies; iSpecies++) MolarMass[iSpecies] = 1000* mix->speciesMw(iSpecies); // x1000 to have Molar Mass in kg/kmol - if (mix->hasElectrons()) { nHeavy = nSpecies-1; nEl = 1; } - else { nHeavy = nSpecies; nEl = 0; } + if (mix->hasElectrons()) { + if(config->GetViscous()) { + SU2_MPI::Error(string("Ionization is not yet operational for a viscous flow in the NEMO solver."), + CURRENT_FUNCTION);} + else { nHeavy = nSpecies-1; nEl = 1;}} + else { nHeavy = nSpecies; nEl = 0; } } From 280e3709e7ca65527794e7aff8f8a32189ff01dc Mon Sep 17 00:00:00 2001 From: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> Date: Mon, 17 Jan 2022 19:16:09 +0000 Subject: [PATCH 2/2] Update SU2_CFD/src/fluid/CMutationTCLib.cpp --- SU2_CFD/src/fluid/CMutationTCLib.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/SU2_CFD/src/fluid/CMutationTCLib.cpp b/SU2_CFD/src/fluid/CMutationTCLib.cpp index 57300d7659f5..132363eeaa5a 100644 --- a/SU2_CFD/src/fluid/CMutationTCLib.cpp +++ b/SU2_CFD/src/fluid/CMutationTCLib.cpp @@ -60,10 +60,13 @@ CMutationTCLib::CMutationTCLib(const CConfig* config, unsigned short val_nDim): for(iSpecies = 0; iSpecies < nSpecies; iSpecies++) MolarMass[iSpecies] = 1000* mix->speciesMw(iSpecies); // x1000 to have Molar Mass in kg/kmol if (mix->hasElectrons()) { - if(config->GetViscous()) { - SU2_MPI::Error(string("Ionization is not yet operational for a viscous flow in the NEMO solver."), - CURRENT_FUNCTION);} - else { nHeavy = nSpecies-1; nEl = 1;}} + if (config->GetViscous()) { + SU2_MPI::Error("Ionization is not yet operational for a viscous flow in the NEMO solver.", CURRENT_FUNCTION); + } else { + nHeavy = nSpecies-1; + nEl = 1; + } + } else { nHeavy = nSpecies; nEl = 0; } }