Skip to content

Commit a24c731

Browse files
authored
Merge pull request #2067 from su2code/bug_fix_cht_flamelet_solver
Bug fix cht flamelet solver
2 parents 2a0fd69 + 96baee2 commit a24c731

4 files changed

Lines changed: 10 additions & 17 deletions

File tree

Common/src/CConfig.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3955,6 +3955,11 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
39553955
SU2_MPI::Error("The use of FLUID_FLAMELET requires the VISCOSITY_MODEL option to be FLAMELET",
39563956
CURRENT_FUNCTION);
39573957
}
3958+
3959+
if (Weakly_Coupled_Heat) {
3960+
SU2_MPI::Error("The use of FLUID_FLAMELET is incompatible with WEAKLY_COUPLED_HEAT in the same zone.",
3961+
CURRENT_FUNCTION);
3962+
}
39583963
}
39593964

39603965
/*--- Check for Measurement System ---*/

SU2_CFD/src/drivers/CDriver.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2497,7 +2497,8 @@ void CDriver::InitializeInterface(CConfig **config, CSolver***** solver, CGeomet
24972497

24982498
const auto fluidZone = heat_target? donor : target;
24992499

2500-
if (config[fluidZone]->GetEnergy_Equation() || (config[fluidZone]->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE))
2500+
if (config[fluidZone]->GetEnergy_Equation() || (config[fluidZone]->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE)
2501+
|| (config[fluidZone]->GetKind_FluidModel() == ENUM_FLUIDMODEL::FLUID_FLAMELET))
25012502
interface_type = heat_target? CONJUGATE_HEAT_FS : CONJUGATE_HEAT_SF;
25022503
else if (config[fluidZone]->GetWeakly_Coupled_Heat())
25032504
interface_type = heat_target? CONJUGATE_HEAT_WEAKLY_FS : CONJUGATE_HEAT_WEAKLY_SF;

SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ void CConjugateHeatInterface::GetDonor_Variable(CSolver *donor_solution, CGeomet
7070
su2double conductivity_over_dist = 0.0;
7171

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

7576
if (compressible_flow) {
7677

SU2_CFD/src/solvers/CSpeciesFlameletSolver.cpp

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,6 @@ CSpeciesFlameletSolver::CSpeciesFlameletSolver(CGeometry* geometry, CConfig* con
5858
Max_CFL_Local = CFL;
5959
Avg_CFL_Local = CFL;
6060

61-
/*--- Allocates a 3D array with variable "middle" sizes and init to 0. ---*/
62-
63-
auto Alloc3D = [](unsigned long M, const vector<unsigned long>& N, unsigned long P, vector<su2activematrix>& X) {
64-
X.resize(M);
65-
for (unsigned long i = 0; i < M; ++i) X[i].resize(N[i], P) = su2double(0.0);
66-
};
67-
68-
/*--- Store the values of the temperature and the heat flux density at the boundaries,
69-
used for coupling with a solid donor cell. ---*/
70-
constexpr auto n_conjugate_var = 4u;
71-
72-
Alloc3D(nMarker, nVertex, n_conjugate_var, conjugate_var);
73-
for (auto& x : conjugate_var) x = config->GetTemperature_FreeStreamND();
74-
7561
/*--- Add the solver name. ---*/
7662
SolverName = "FLAMELET";
7763
}
@@ -427,7 +413,7 @@ void CSpeciesFlameletSolver::BC_Isothermal_Wall_Generic(CGeometry* geometry, CSo
427413
for (unsigned long iVertex = 0; iVertex < geometry->nVertex[val_marker]; iVertex++) {
428414
unsigned long iPoint = geometry->vertex[val_marker][iVertex]->GetNode();
429415

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

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

0 commit comments

Comments
 (0)