Skip to content

Commit f679db1

Browse files
committed
fix the python case
1 parent fa70e1a commit f679db1

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ 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) &&
73+
const bool incompressible_flow = (donor_config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE) &&
7474
(donor_config->GetEnergy_Equation() || (donor_config->GetKind_FluidModel() == ENUM_FLUIDMODEL::FLUID_FLAMELET));
7575

7676
if (compressible_flow) {

SU2_CFD/src/solvers/CIncNSSolver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ void CIncNSSolver::GetStreamwise_Periodic_Properties(const CGeometry *geometry,
219219

220220
const su2double FaceArea = GeometryToolbox::Norm(nDim, AreaNormal);
221221

222-
HeatFlow_Local += FaceArea * (-1.0) * Wall_HeatFlux/config->GetHeat_Flux_Ref();;
222+
HeatFlow_Local += FaceArea * (-1.0) * Wall_HeatFlux/config->GetHeat_Flux_Ref();
223223
} // loop Vertices
224224
} // loop Heatflux marker
225225
} // loop AllMarker

TestCases/py_wrapper/custom_heat_flux/run_ad.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def ApplyHeatFlux(time, driver, marker_ids):
9292
for marker_id in marker_ids:
9393
if marker_id < 0:
9494
continue
95-
hf = (-1, 0)[time > 0.2]
95+
hf = (-1 * 2700 * 870, 0)[time > 0.2]
9696
for i_vertex in range(driver.GetNumberMarkerNodes(marker_id)):
9797
driver.SetMarkerCustomNormalHeatFlux(marker_id, i_vertex, hf)
9898

@@ -228,17 +228,17 @@ def main():
228228
comm = MPI.COMM_WORLD
229229
rank = comm.Get_rank()
230230

231-
obj_pert_size = RunPrimal(0.10002)
231+
obj_pert_size = RunPrimal(0.100005)
232232
obj = RunPrimal(0.1)
233-
sens_size_fd = (obj_pert_size - obj) / 0.00002
233+
sens_size_fd = (obj_pert_size - obj) / 0.000005
234234

235235
sens_size, sens_temp = RunAdjoint(0.1)
236236

237237
if rank == 0:
238238
print(" Finite Differences\tDiscrete Adjoint")
239239
print(f"Size {sens_size_fd}\t{sens_size}")
240240

241-
assert abs(sens_size / sens_size_fd - 1) < 1e-3, "Error in geometric derivatives."
241+
assert abs(sens_size / sens_size_fd - 1) < 1e-4, "Error in geometric derivatives."
242242
# We expect the final average temperature to be directly proportional to the initial
243243
# temperature since the applied heat flux is not a function of temperature.
244244
assert abs(sens_temp - 1) < 1e-5, "Error in initial condition derivatives."

0 commit comments

Comments
 (0)