Skip to content

Commit

Permalink
Merge pull request #2067 from su2code/bug_fix_cht_flamelet_solver
Browse files Browse the repository at this point in the history
Bug fix cht flamelet solver
  • Loading branch information
pcarruscag committed Jul 6, 2023
2 parents 2a0fd69 + 96baee2 commit a24c731
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 17 deletions.
5 changes: 5 additions & 0 deletions Common/src/CConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3955,6 +3955,11 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
SU2_MPI::Error("The use of FLUID_FLAMELET requires the VISCOSITY_MODEL option to be FLAMELET",
CURRENT_FUNCTION);
}

if (Weakly_Coupled_Heat) {
SU2_MPI::Error("The use of FLUID_FLAMELET is incompatible with WEAKLY_COUPLED_HEAT in the same zone.",
CURRENT_FUNCTION);
}
}

/*--- Check for Measurement System ---*/
Expand Down
3 changes: 2 additions & 1 deletion SU2_CFD/src/drivers/CDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2497,7 +2497,8 @@ void CDriver::InitializeInterface(CConfig **config, CSolver***** solver, CGeomet

const auto fluidZone = heat_target? donor : target;

if (config[fluidZone]->GetEnergy_Equation() || (config[fluidZone]->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE))
if (config[fluidZone]->GetEnergy_Equation() || (config[fluidZone]->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE)
|| (config[fluidZone]->GetKind_FluidModel() == ENUM_FLUIDMODEL::FLUID_FLAMELET))
interface_type = heat_target? CONJUGATE_HEAT_FS : CONJUGATE_HEAT_SF;
else if (config[fluidZone]->GetWeakly_Coupled_Heat())
interface_type = heat_target? CONJUGATE_HEAT_WEAKLY_FS : CONJUGATE_HEAT_WEAKLY_SF;
Expand Down
3 changes: 2 additions & 1 deletion SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ void CConjugateHeatInterface::GetDonor_Variable(CSolver *donor_solution, CGeomet
su2double conductivity_over_dist = 0.0;

const bool compressible_flow = (donor_config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE);
const bool incompressible_flow = (donor_config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE) && donor_config->GetEnergy_Equation();
const bool incompressible_flow = (donor_config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE) &&
(donor_config->GetEnergy_Equation() || (donor_config->GetKind_FluidModel() == ENUM_FLUIDMODEL::FLUID_FLAMELET));

if (compressible_flow) {

Expand Down
16 changes: 1 addition & 15 deletions SU2_CFD/src/solvers/CSpeciesFlameletSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,6 @@ CSpeciesFlameletSolver::CSpeciesFlameletSolver(CGeometry* geometry, CConfig* con
Max_CFL_Local = CFL;
Avg_CFL_Local = CFL;

/*--- Allocates a 3D array with variable "middle" sizes and init to 0. ---*/

auto Alloc3D = [](unsigned long M, const vector<unsigned long>& N, unsigned long P, vector<su2activematrix>& X) {
X.resize(M);
for (unsigned long i = 0; i < M; ++i) X[i].resize(N[i], P) = su2double(0.0);
};

/*--- Store the values of the temperature and the heat flux density at the boundaries,
used for coupling with a solid donor cell. ---*/
constexpr auto n_conjugate_var = 4u;

Alloc3D(nMarker, nVertex, n_conjugate_var, conjugate_var);
for (auto& x : conjugate_var) x = config->GetTemperature_FreeStreamND();

/*--- Add the solver name. ---*/
SolverName = "FLAMELET";
}
Expand Down Expand Up @@ -427,7 +413,7 @@ void CSpeciesFlameletSolver::BC_Isothermal_Wall_Generic(CGeometry* geometry, CSo
for (unsigned long iVertex = 0; iVertex < geometry->nVertex[val_marker]; iVertex++) {
unsigned long iPoint = geometry->vertex[val_marker][iVertex]->GetNode();

if (cht_mode) temp_wall = GetConjugateHeatVariable(val_marker, iVertex, 0);
if (cht_mode) temp_wall = solver_container[FLOW_SOL]->GetConjugateHeatVariable(val_marker, iVertex, 0);

/*--- Check if the node belongs to the domain (i.e., not a halo node). ---*/

Expand Down

0 comments on commit a24c731

Please sign in to comment.