Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix cht flamelet solver #2067

Merged
merged 6 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion .github/workflows/regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ jobs:
uses: docker://ghcr.io/su2code/su2/test-su2:230225-2136
with:
# -t <Tutorials-branch> -c <Testcases-branch>
args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}}
args: -b ${{github.ref}} -t develop -c bug_fix_cht_flamelet -s ${{matrix.testscript}}
pcarruscag marked this conversation as resolved.
Show resolved Hide resolved
pcarruscag marked this conversation as resolved.
Show resolved Hide resolved
- name: Cleanup
uses: docker://ghcr.io/su2code/su2/test-su2:230225-2136
with:
Expand Down
5 changes: 5 additions & 0 deletions Common/src/CConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3947,6 +3947,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);
EvertBunschoten marked this conversation as resolved.
Show resolved Hide resolved

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

Expand Down