@@ -2363,6 +2363,7 @@ void CFVMFlowSolverBase<V, FlowRegime>::Friction_Forces(const CGeometry* geometr
23632363 const su2double Beta = config->GetAoS () * PI_NUMBER / 180.0 ;
23642364 const su2double RefLength = config->GetRefLength ();
23652365 const su2double RefHeatFlux = config->GetHeat_Flux_Ref ();
2366+ const su2double RefTemperature = config->GetTemperature_Ref ();
23662367 const su2double Gas_Constant = config->GetGas_ConstantND ();
23672368 auto Origin = config->GetRefOriginMoment (0 );
23682369
@@ -2396,6 +2397,8 @@ void CFVMFlowSolverBase<V, FlowRegime>::Friction_Forces(const CGeometry* geometr
23962397 Marker_Tag = config->GetMarker_All_TagBound (iMarker);
23972398 if (!config->GetViscous_Wall (iMarker)) continue ;
23982399
2400+ const bool py_custom = config->GetMarker_All_PyCustom (iMarker);
2401+
23992402 /* --- Obtain the origin for the moment computation for a particular marker ---*/
24002403
24012404 const auto Monitoring = config->GetMarker_All_Monitoring (iMarker);
@@ -2506,26 +2509,55 @@ void CFVMFlowSolverBase<V, FlowRegime>::Friction_Forces(const CGeometry* geometr
25062509
25072510 /* --- Compute total and maximum heat flux on the wall ---*/
25082511
2509- su2double dTdn = -GeometryToolbox::DotProduct (nDim, Grad_Temp, UnitNormal);
2510-
2511- if (!nemo){
2512-
2512+ if (!nemo) {
25132513 if (FlowRegime == ENUM_REGIME::COMPRESSIBLE) {
2514-
25152514 Cp = (Gamma / Gamma_Minus_One) * Gas_Constant;
25162515 thermal_conductivity = Cp * Viscosity / Prandtl_Lam;
25172516 }
25182517 if (FlowRegime == ENUM_REGIME::INCOMPRESSIBLE) {
2519- if (!energy) dTdn = 0.0 ;
25202518 thermal_conductivity = nodes->GetThermalConductivity (iPoint);
25212519 }
2522- HeatFlux[iMarker][iVertex] = -thermal_conductivity * dTdn * RefHeatFlux;
25232520
2521+ if (config->GetMarker_All_KindBC (iMarker) == BC_TYPE::HEAT_FLUX) {
2522+ if (py_custom) {
2523+ HeatFlux[iMarker][iVertex] = geometry->GetCustomBoundaryHeatFlux (iMarker, iVertex);
2524+ } else {
2525+ HeatFlux[iMarker][iVertex] = config->GetWall_HeatFlux (Marker_Tag);
2526+ if (config->GetIntegrated_HeatFlux ()) {
2527+ HeatFlux[iMarker][iVertex] /= geometry->GetSurfaceArea (config, iMarker);
2528+ }
2529+ }
2530+ } else if (config->GetMarker_All_KindBC (iMarker) == BC_TYPE::ISOTHERMAL) {
2531+ su2double Twall = 0.0 ;
2532+ if (py_custom) {
2533+ Twall = geometry->GetCustomBoundaryTemperature (iMarker, iVertex) / RefTemperature;
2534+ } else {
2535+ Twall = config->GetIsothermal_Temperature (Marker_Tag) / RefTemperature;
2536+ }
2537+ iPointNormal = geometry->vertex [iMarker][iVertex]->GetNormal_Neighbor ();
2538+ Coord_Normal = geometry->nodes ->GetCoord (iPointNormal);
2539+ su2double Vec_ij[MAXNDIM] = {0.0 };
2540+ GeometryToolbox::Distance (nDim, Coord, Coord_Normal, Vec_ij);
2541+
2542+ /* --- Prevent divisions by 0 by limiting the normal projection. ---*/
2543+ const su2double dist_ij = fmax (
2544+ fabs (GeometryToolbox::DotProduct (int (MAXNDIM), Vec_ij, UnitNormal)),
2545+ fmax (0.05 * GeometryToolbox::Norm (int (MAXNDIM), Vec_ij), EPS));
2546+
2547+ const su2double There = nodes->GetTemperature (iPointNormal);
2548+
2549+ HeatFlux[iMarker][iVertex] = -thermal_conductivity * (There - Twall) / dist_ij * RefHeatFlux;
2550+ } else {
2551+ su2double dTdn = -GeometryToolbox::DotProduct (nDim, Grad_Temp, UnitNormal);
2552+ if (FlowRegime == ENUM_REGIME::INCOMPRESSIBLE && !energy) dTdn = 0.0 ;
2553+ HeatFlux[iMarker][iVertex] = -thermal_conductivity * dTdn * RefHeatFlux;
2554+ }
25242555 } else {
25252556
25262557 const auto & thermal_conductivity_tr = nodes->GetThermalConductivity (iPoint);
25272558 const auto & thermal_conductivity_ve = nodes->GetThermalConductivity_ve (iPoint);
25282559
2560+ const su2double dTdn = -GeometryToolbox::DotProduct (nDim, Grad_Temp, UnitNormal);
25292561 const su2double dTvedn = -GeometryToolbox::DotProduct (nDim, Grad_Temp_ve, UnitNormal);
25302562
25312563 /* --- Surface energy balance: trans-rot heat flux, vib-el heat flux ---*/
0 commit comments