Skip to content

Commit

Permalink
Fixed build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
EvertBunschoten committed Nov 2, 2023
1 parent f48b338 commit a4de27f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Common/src/CConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion SU2_CFD/include/fluid/CFluidFlamelet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#define USE_MLPCPP
#endif
#include "CFluidModel.hpp"

#include <memory>
class CFluidFlamelet final : public CFluidModel {
private:
ENUM_DATADRIVEN_METHOD Kind_DataDriven_Method =
Expand Down Expand Up @@ -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. */
Expand Down
4 changes: 2 additions & 2 deletions SU2_CFD/src/fluid/CFluidFlamelet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* License along with SU2. If not, see <http://www.gnu.org/licenses/>.
*/

#include <memory>
#include "../include/fluid/CFluidFlamelet.hpp"
#include "../../../Common/include/containers/CLookUpTable.hpp"
#if defined(HAVE_MLPCPP)
Expand All @@ -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);
Expand Down Expand Up @@ -213,14 +213,14 @@ 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:
PreferentialDiffusion = look_up_table->CheckForVariables(varnames_PD);
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();
Expand Down
9 changes: 3 additions & 6 deletions SU2_CFD/src/solvers/CSpeciesFlameletSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,13 @@ 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<su2double> scalars_vector(nVar);
su2double spark_location[3];
su2double spark_radius;
unsigned long spark_iter_start, spark_duration;
bool ignition = false;
auto* flowNodes = su2staticcast_p<CFlowVariable*>(solver_container[FLOW_SOL]->GetNodes());

/*--- 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();
Expand All @@ -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]);
Expand Down

0 comments on commit a4de27f

Please sign in to comment.