@@ -2357,12 +2357,11 @@ void CFVMFlowSolverBase<V, FlowRegime>::Friction_Forces(const CGeometry* geometr
23572357 const su2double *Coord = nullptr , *Coord_Normal = nullptr , *Normal = nullptr ;
23582358 const su2double minYPlus = config->GetwallModel_MinYPlus ();
23592359
2360- string Marker_Tag, Monitoring_Tag;
2361-
23622360 const su2double Alpha = config->GetAoA () * PI_NUMBER / 180.0 ;
23632361 const su2double Beta = config->GetAoS () * PI_NUMBER / 180.0 ;
23642362 const su2double RefLength = config->GetRefLength ();
23652363 const su2double RefHeatFlux = config->GetHeat_Flux_Ref ();
2364+ const su2double RefTemperature = config->GetTemperature_Ref ();
23662365 const su2double Gas_Constant = config->GetGas_ConstantND ();
23672366 auto Origin = config->GetRefOriginMoment (0 );
23682367
@@ -2393,15 +2392,17 @@ void CFVMFlowSolverBase<V, FlowRegime>::Friction_Forces(const CGeometry* geometr
23932392
23942393 for (iMarker = 0 ; iMarker < nMarker; iMarker++) {
23952394
2396- Marker_Tag = config->GetMarker_All_TagBound (iMarker);
23972395 if (!config->GetViscous_Wall (iMarker)) continue ;
2396+ const auto Marker_Tag = config->GetMarker_All_TagBound (iMarker);
2397+
2398+ const bool py_custom = config->GetMarker_All_PyCustom (iMarker);
23982399
23992400 /* --- Obtain the origin for the moment computation for a particular marker ---*/
24002401
24012402 const auto Monitoring = config->GetMarker_All_Monitoring (iMarker);
24022403 if (Monitoring == YES) {
24032404 for (iMarker_Monitoring = 0 ; iMarker_Monitoring < config->GetnMarker_Monitoring (); iMarker_Monitoring++) {
2404- Monitoring_Tag = config->GetMarker_Monitoring_TagBound (iMarker_Monitoring);
2405+ const auto Monitoring_Tag = config->GetMarker_Monitoring_TagBound (iMarker_Monitoring);
24052406 if (Marker_Tag == Monitoring_Tag) Origin = config->GetRefOriginMoment (iMarker_Monitoring);
24062407 }
24072408 }
@@ -2506,26 +2507,47 @@ void CFVMFlowSolverBase<V, FlowRegime>::Friction_Forces(const CGeometry* geometr
25062507
25072508 /* --- Compute total and maximum heat flux on the wall ---*/
25082509
2509- su2double dTdn = -GeometryToolbox::DotProduct (nDim, Grad_Temp, UnitNormal);
2510-
2511- if (!nemo){
2512-
2510+ if (!nemo) {
25132511 if (FlowRegime == ENUM_REGIME::COMPRESSIBLE) {
2514-
25152512 Cp = (Gamma / Gamma_Minus_One) * Gas_Constant;
25162513 thermal_conductivity = Cp * Viscosity / Prandtl_Lam;
25172514 }
25182515 if (FlowRegime == ENUM_REGIME::INCOMPRESSIBLE) {
2519- if (!energy) dTdn = 0.0 ;
25202516 thermal_conductivity = nodes->GetThermalConductivity (iPoint);
25212517 }
2522- HeatFlux[iMarker][iVertex] = -thermal_conductivity * dTdn * RefHeatFlux;
25232518
2519+ if (config->GetMarker_All_KindBC (iMarker) == BC_TYPE::HEAT_FLUX) {
2520+ if (py_custom) {
2521+ HeatFlux[iMarker][iVertex] = -geometry->GetCustomBoundaryHeatFlux (iMarker, iVertex);
2522+ } else {
2523+ HeatFlux[iMarker][iVertex] = -config->GetWall_HeatFlux (Marker_Tag);
2524+ if (config->GetIntegrated_HeatFlux ()) {
2525+ HeatFlux[iMarker][iVertex] /= geometry->GetSurfaceArea (config, iMarker);
2526+ }
2527+ }
2528+ } else if (config->GetMarker_All_KindBC (iMarker) == BC_TYPE::ISOTHERMAL) {
2529+ su2double Twall = 0.0 ;
2530+ if (py_custom) {
2531+ Twall = geometry->GetCustomBoundaryTemperature (iMarker, iVertex) / RefTemperature;
2532+ } else {
2533+ Twall = config->GetIsothermal_Temperature (Marker_Tag) / RefTemperature;
2534+ }
2535+ iPointNormal = geometry->vertex [iMarker][iVertex]->GetNormal_Neighbor ();
2536+ Coord_Normal = geometry->nodes ->GetCoord (iPointNormal);
2537+ const su2double dist_ij = GeometryToolbox::NormalDistance (nDim, UnitNormal, Coord, Coord_Normal);
2538+ const su2double There = nodes->GetTemperature (iPointNormal);
2539+ HeatFlux[iMarker][iVertex] = thermal_conductivity * (There - Twall) / dist_ij * RefHeatFlux;
2540+ } else {
2541+ su2double dTdn = GeometryToolbox::DotProduct (nDim, Grad_Temp, UnitNormal);
2542+ if (FlowRegime == ENUM_REGIME::INCOMPRESSIBLE && !energy) dTdn = 0.0 ;
2543+ HeatFlux[iMarker][iVertex] = thermal_conductivity * dTdn * RefHeatFlux;
2544+ }
25242545 } else {
25252546
25262547 const auto & thermal_conductivity_tr = nodes->GetThermalConductivity (iPoint);
25272548 const auto & thermal_conductivity_ve = nodes->GetThermalConductivity_ve (iPoint);
25282549
2550+ const su2double dTdn = -GeometryToolbox::DotProduct (nDim, Grad_Temp, UnitNormal);
25292551 const su2double dTvedn = -GeometryToolbox::DotProduct (nDim, Grad_Temp_ve, UnitNormal);
25302552
25312553 /* --- Surface energy balance: trans-rot heat flux, vib-el heat flux ---*/
@@ -2653,8 +2675,7 @@ void CFVMFlowSolverBase<V, FlowRegime>::Friction_Forces(const CGeometry* geometr
26532675 /* --- Compute the coefficients per surface ---*/
26542676
26552677 for (iMarker_Monitoring = 0 ; iMarker_Monitoring < config->GetnMarker_Monitoring (); iMarker_Monitoring++) {
2656- Monitoring_Tag = config->GetMarker_Monitoring_TagBound (iMarker_Monitoring);
2657- Marker_Tag = config->GetMarker_All_TagBound (iMarker);
2678+ const auto Monitoring_Tag = config->GetMarker_Monitoring_TagBound (iMarker_Monitoring);
26582679 if (Marker_Tag == Monitoring_Tag) {
26592680 SurfaceViscCoeff.CL [iMarker_Monitoring] += ViscCoeff.CL [iMarker];
26602681 SurfaceViscCoeff.CD [iMarker_Monitoring] += ViscCoeff.CD [iMarker];
0 commit comments