Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
16 changes: 16 additions & 0 deletions Common/src/CConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5707,6 +5707,22 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
SU2_MPI::Error("Number of initial species incompatible with number of controlling variables and user scalars.", CURRENT_FUNCTION);
/*--- We can have additional user defined transported scalars ---*/
flamelet_ParsedOptions.n_scalars = flamelet_ParsedOptions.n_control_vars + flamelet_ParsedOptions.n_user_scalars;

/*--- Check that spark ignition has required parameters defined ---*/
if (flamelet_ParsedOptions.ignition_method == FLAMELET_INIT_TYPE::SPARK) {
/*--- Check if SPARK_INIT was explicitly set in config file ---*/
if (all_options.find("SPARK_INIT") != all_options.end()) {
SU2_MPI::Error("FLAME_INIT_METHOD= SPARK requires SPARK_INIT to be defined in the config file.", CURRENT_FUNCTION);
}
/*--- Check if SPARK_REACTION_RATES was explicitly set in config file ---*/
if (all_options.find("SPARK_REACTION_RATES") != all_options.end()) {
SU2_MPI::Error("FLAME_INIT_METHOD= SPARK requires SPARK_REACTION_RATES to be defined in the config file.", CURRENT_FUNCTION);
}
if (flamelet_ParsedOptions.nspark < flamelet_ParsedOptions.n_scalars) {
SU2_MPI::Error("SPARK_REACTION_RATES must have at least " + to_string(flamelet_ParsedOptions.n_scalars) +
" values (one for each scalar variable), but only " + to_string(flamelet_ParsedOptions.nspark) + " were provided.", CURRENT_FUNCTION);
}
}
}

if (Kind_Regime == ENUM_REGIME::COMPRESSIBLE && GetBounded_Scalar()) {
Expand Down
12 changes: 8 additions & 4 deletions SU2_CFD/src/solvers/CSpeciesFlameletSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,11 @@ void CSpeciesFlameletSolver::Preprocessing(CGeometry* geometry, CSolver** solver
spark_radius = flamelet_config_options.spark_init[3];
dist_from_center = GeometryToolbox::SquaredDistance(nDim, geometry->nodes->GetCoord(i_point), flamelet_config_options.spark_init.data());
if (dist_from_center < pow(spark_radius,2)) {
for (auto iVar = 0u; iVar < nVar; iVar++)
nodes->SetScalarSource(i_point, iVar, nodes->GetScalarSources(i_point)[iVar] + flamelet_config_options.spark_reaction_rates[iVar]);
/*--- Add spark reaction rates to the sources that were just set by SetScalarSources ---*/
const su2double* current_sources = nodes->GetScalarSources(i_point);
for (auto iVar = 0u; iVar < nVar; iVar++) {
nodes->SetScalarSource(i_point, iVar, current_sources[iVar] + flamelet_config_options.spark_reaction_rates[iVar]);
}
}
}

Expand Down Expand Up @@ -194,10 +197,11 @@ void CSpeciesFlameletSolver::SetInitialCondition(CGeometry** geometry, CSolver**
cout << "Ignition with a straight flame front" << endl;
break;
case FLAMELET_INIT_TYPE::SPARK:
cout << "Ignition with an artificial spark" << endl;
cout << "Ignition with an artificial spark at iteration "<< flamelet_config_options.spark_init[4]
<< " for a duration of " << flamelet_config_options.spark_init[5] << " iterations." << endl;
break;
case FLAMELET_INIT_TYPE::NONE:
cout << "No solution ignition (cold flow)" << endl;
cout << "No solution ignition (cold flow or restart)" << endl;
break;
default:
break;
Expand Down
2 changes: 1 addition & 1 deletion subprojects/CoolProp
Submodule CoolProp updated 398 files
Loading