diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index eb253978ed7..f5bf03ec6dc 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -9177,7 +9177,7 @@ su2double CConfig::GetIsothermal_Temperature(const string& val_marker) const { if (Marker_Isothermal[iMarker_Isothermal] == val_marker) return Isothermal_Temperature[iMarker_Isothermal]; - return Temperature_FreeStream;// Isothermal_Temperature[0]; + return Temperature_FreeStream; } su2double CConfig::GetWall_HeatFlux(const string& val_marker) const { diff --git a/SU2_CFD/include/fluid/CFluidFlamelet.hpp b/SU2_CFD/include/fluid/CFluidFlamelet.hpp index 24bf5715b92..075ea6bfef2 100644 --- a/SU2_CFD/include/fluid/CFluidFlamelet.hpp +++ b/SU2_CFD/include/fluid/CFluidFlamelet.hpp @@ -34,7 +34,7 @@ #define USE_MLPCPP #endif #include "CFluidModel.hpp" - +#include class CFluidFlamelet final : public CFluidModel { private: ENUM_DATADRIVEN_METHOD Kind_DataDriven_Method = @@ -64,6 +64,7 @@ class CFluidFlamelet final : public CFluidModel { /*--- Class variables for the multi-layer perceptron method ---*/ #ifdef USE_MLPCPP + size_t n_betas; MLPToolbox::CLookUp_ANN* lookup_mlp; /*!< \brief Multi-layer perceptron collection. */ MLPToolbox::CIOMap* iomap_TD; /*!< \brief Input-output map for thermochemical properties. */ MLPToolbox::CIOMap* iomap_PD; /*!< \brief Input-output map for the preferential diffusion scalars. */ diff --git a/SU2_CFD/src/fluid/CFluidFlamelet.cpp b/SU2_CFD/src/fluid/CFluidFlamelet.cpp index 377e3e236c0..6721f79292c 100644 --- a/SU2_CFD/src/fluid/CFluidFlamelet.cpp +++ b/SU2_CFD/src/fluid/CFluidFlamelet.cpp @@ -25,6 +25,7 @@ * License along with SU2. If not, see . */ +#include #include "../include/fluid/CFluidFlamelet.hpp" #include "../../../Common/include/containers/CLookUpTable.hpp" #if defined(HAVE_MLPCPP) @@ -47,7 +48,6 @@ CFluidFlamelet::CFluidFlamelet(CConfig* config, su2double value_pressure_operati cout << "Number of user scalars: " << n_user_scalars << endl; cout << "Number of control variables: " << n_control_vars << endl; } - scalars_vector.resize(n_scalars); table_scalar_names.resize(n_scalars); @@ -213,7 +213,6 @@ void CFluidFlamelet::PreprocessLookUp(CConfig* config) { val_vars_PD[FLAMELET_PREF_DIFF_SCALARS::I_BETA_ENTH] = beta_enth; val_vars_PD[FLAMELET_PREF_DIFF_SCALARS::I_BETA_MIXFRAC] = beta_mixfrac; - size_t n_betas{0}; PreferentialDiffusion = false; switch (Kind_DataDriven_Method) { case ENUM_DATADRIVEN_METHOD::LUT: @@ -221,6 +220,7 @@ void CFluidFlamelet::PreprocessLookUp(CConfig* config) { break; case ENUM_DATADRIVEN_METHOD::MLP: #ifdef USE_MLPCPP + n_betas = 0; for (auto iMLP = 0u; iMLP < config->GetNDataDriven_Files(); iMLP++) { auto outputMap = lookup_mlp->FindVariableIndices(iMLP, varnames_PD, false); n_betas += outputMap.size(); diff --git a/SU2_CFD/src/solvers/CSpeciesFlameletSolver.cpp b/SU2_CFD/src/solvers/CSpeciesFlameletSolver.cpp index 5609a0e140e..d7ef5e9a363 100644 --- a/SU2_CFD/src/solvers/CSpeciesFlameletSolver.cpp +++ b/SU2_CFD/src/solvers/CSpeciesFlameletSolver.cpp @@ -68,8 +68,6 @@ void CSpeciesFlameletSolver::Preprocessing(CGeometry* geometry, CSolver** solver unsigned short RunTime_EqSystem, bool Output) { unsigned long n_not_in_domain_local = 0, n_not_in_domain_global = 0; vector scalars_vector(nVar); - su2double spark_location[3]; - su2double spark_radius; unsigned long spark_iter_start, spark_duration; bool ignition = false; auto* flowNodes = su2staticcast_p(solver_container[FLOW_SOL]->GetNodes()); @@ -77,8 +75,6 @@ void CSpeciesFlameletSolver::Preprocessing(CGeometry* geometry, CSolver** solver /*--- Retrieve spark ignition parameters for spark-type ignition. ---*/ if ((config->GetFlameletInitType() == FLAMELET_INIT_TYPE::SPARK) && !config->GetRestart()) { auto spark_init = config->GetFlameInit(); - for (auto iDim = 0u; iDim < 3; ++iDim) spark_location[iDim] = spark_init[iDim]; - spark_radius = spark_init[3]; spark_iter_start = ceil(spark_init[4]); spark_duration = ceil(spark_init[5]); unsigned long iter = config->GetMultizone_Problem() ? config->GetOuterIter() : config->GetInnerIter(); @@ -98,9 +94,10 @@ void CSpeciesFlameletSolver::Preprocessing(CGeometry* geometry, CSolver** solver if (ignition) { /*--- Apply source terms within spark radius. ---*/ - su2double dist_from_center = 0; + su2double dist_from_center = 0, + spark_radius = config->GetFlameInit()[3]; for (auto iDim = 0u; iDim < nDim; ++iDim) - dist_from_center += pow(geometry->nodes->GetCoord(i_point, iDim) - spark_location[iDim], 2); + dist_from_center += pow(geometry->nodes->GetCoord(i_point, iDim) - config->GetFlameInit()[iDim], 2); if (sqrt(dist_from_center) < spark_radius) { for (auto iVar = 0u; iVar < nVar; iVar++) nodes->SetScalarSource(i_point, iVar, nodes->GetScalarSources(i_point)[iVar] + config->GetSpark()[iVar]);