diff --git a/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp b/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp index a1400ad0799..ea9dd7134f7 100644 --- a/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp +++ b/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp @@ -70,7 +70,7 @@ 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) && + 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) { diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index ea9fc7a1bdb..061c8ee02ec 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -219,7 +219,7 @@ void CIncNSSolver::GetStreamwise_Periodic_Properties(const CGeometry *geometry, const su2double FaceArea = GeometryToolbox::Norm(nDim, AreaNormal); - HeatFlow_Local += FaceArea * (-1.0) * Wall_HeatFlux/config->GetHeat_Flux_Ref();; + HeatFlow_Local += FaceArea * (-1.0) * Wall_HeatFlux/config->GetHeat_Flux_Ref(); } // loop Vertices } // loop Heatflux marker } // loop AllMarker @@ -336,13 +336,13 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); const bool energy = config->GetEnergy_Equation(); + const bool py_custom = config->GetMarker_All_PyCustom(val_marker); /*--- Variables for streamwise periodicity ---*/ const bool streamwise_periodic = (config->GetKind_Streamwise_Periodic() != ENUM_STREAMWISE_PERIODIC::NONE); const bool streamwise_periodic_temperature = config->GetStreamwise_Periodic_Temperature(); su2double Cp, thermal_conductivity, dot_product, scalar_factor; - /*--- Identify the boundary by string name ---*/ const auto Marker_Tag = config->GetMarker_All_TagBound(val_marker); @@ -426,6 +426,9 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con /*--- Apply a weak boundary condition for the energy equation. Compute the residual due to the prescribed heat flux. ---*/ + if (py_custom) { + Wall_HeatFlux = geometry->GetCustomBoundaryHeatFlux(val_marker, iVertex) / config->GetHeat_Flux_Ref(); + } LinSysRes(iPoint, nDim+1) -= Wall_HeatFlux*Area; /*--- With streamwise periodic flow and heatflux walls an additional term is introduced in the boundary formulation ---*/ @@ -460,7 +463,9 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con break; case ISOTHERMAL: - + if (py_custom) { + Twall = geometry->GetCustomBoundaryTemperature(val_marker, iVertex) / config->GetTemperature_Ref(); + } const auto Point_Normal = geometry->vertex[val_marker][iVertex]->GetNormal_Neighbor(); /*--- Get coordinates of i & nearest normal and compute distance ---*/ diff --git a/TestCases/py_wrapper/custom_heat_flux/run_ad.py b/TestCases/py_wrapper/custom_heat_flux/run_ad.py index 91695b4e6b2..8fa54a0a891 100644 --- a/TestCases/py_wrapper/custom_heat_flux/run_ad.py +++ b/TestCases/py_wrapper/custom_heat_flux/run_ad.py @@ -92,7 +92,7 @@ def ApplyHeatFlux(time, driver, marker_ids): for marker_id in marker_ids: if marker_id < 0: continue - hf = (-1, 0)[time > 0.2] + hf = (-1 * 2700 * 870, 0)[time > 0.2] for i_vertex in range(driver.GetNumberMarkerNodes(marker_id)): driver.SetMarkerCustomNormalHeatFlux(marker_id, i_vertex, hf)