@@ -443,8 +443,8 @@ void CFVMFlowSolverBase<V, R>::Viscous_Residual_impl(unsigned long iEdge, CGeome
443443
444444 /* --- Wall shear stress values (wall functions) ---*/
445445
446- numerics->SetTauWall (nodes->GetTauWall (iPoint),
447- nodes->GetTauWall (jPoint));
446+ numerics->SetTau_Wall (nodes->GetTau_Wall (iPoint),
447+ nodes->GetTau_Wall (jPoint));
448448
449449 /* --- Compute and update residual ---*/
450450
@@ -2393,10 +2393,11 @@ void CFVMFlowSolverBase<V, FlowRegime>::Friction_Forces(const CGeometry* geometr
23932393 unsigned long iVertex, iPoint, iPointNormal;
23942394 unsigned short iMarker, iMarker_Monitoring, iDim, jDim;
23952395 unsigned short T_INDEX = 0 , TVE_INDEX = 0 , VEL_INDEX = 0 ;
2396- su2double Viscosity = 0.0 , WallDist[ 3 ] = { 0.0 }, Area, Density = 0.0 , GradTemperature = 0.0 ,
2397- UnitNormal[3 ] = {0.0 }, TauElem[3 ] = {0.0 }, TauTangent[ 3 ] = { 0.0 }, Tau[3 ][3 ] = {{0.0 }}, Cp,
2396+ su2double Viscosity = 0.0 , Area, Density = 0.0 , GradTemperature = 0.0 , WallDistMod, FrictionVel ,
2397+ UnitNormal[3 ] = {0.0 }, TauElem[3 ] = {0.0 }, Tau[3 ][3 ] = {{0.0 }}, Cp,
23982398 thermal_conductivity, MaxNorm = 8.0 , Grad_Vel[3 ][3 ] = {{0.0 }}, Grad_Temp[3 ] = {0.0 }, AxiFactor;
23992399 const su2double *Coord = nullptr , *Coord_Normal = nullptr , *Normal = nullptr ;
2400+ const su2double minYPlus = config->GetwallModel_MinYPlus ();
24002401
24012402 string Marker_Tag, Monitoring_Tag;
24022403
@@ -2526,30 +2527,37 @@ void CFVMFlowSolverBase<V, FlowRegime>::Friction_Forces(const CGeometry* geometr
25262527 /* --- Compute wall shear stress (using the stress tensor). Compute wall skin friction coefficient, and heat flux
25272528 * on the wall ---*/
25282529
2529- su2double TauNormal = GeometryToolbox::DotProduct (nDim, TauElem, UnitNormal);
2530+ su2double TauTangent[MAXNDIM] = {0.0 };
2531+ GeometryToolbox::TangentProjection (nDim, Tau, UnitNormal, TauTangent);
25302532
2531- for (iDim = 0 ; iDim < nDim; iDim++) {
2532- TauTangent[iDim] = TauElem[iDim] - TauNormal * UnitNormal[iDim];
2533- /* --- in case of wall functions, we have computed the skin friction in the turbulence solver --- */
2534- /* --- Note that in the wall model, we switch off the computation when the computed y+ < 5 --- */
2535- /* --- We put YPlus to 1.0 so we have to compute skinfriction and the actual y+ in that case as well --- */
2536- if (!wallfunctions || (wallfunctions && YPlus[iMarker][iVertex] < 5.0 ))
2537- CSkinFriction[iMarker](iVertex,iDim) = TauTangent[iDim] * factorFric;
2533+ WallShearStress[iMarker][iVertex] = GeometryToolbox::Norm (int (MAXNDIM), TauTangent);
2534+
2535+ /* --- For wall functions, the wall stresses need to be scaled by the wallfunction stress Tau_Wall---*/
2536+ su2double Tau_Wall, scale;
2537+ if (wallfunctions && (YPlus[iMarker][iVertex] > minYPlus)){
2538+ Tau_Wall = nodes->GetTau_Wall (iPoint);
2539+ scale = Tau_Wall / WallShearStress[iMarker][iVertex];
2540+ for (iDim = 0 ; iDim < nDim; iDim++) {
2541+ TauTangent[iDim] *= scale;
2542+ TauElem[iDim] *= scale;
2543+ }
2544+
2545+ WallShearStress[iMarker][iVertex] = Tau_Wall;
25382546 }
2539- WallShearStress[iMarker][iVertex] = GeometryToolbox::Norm (nDim, TauTangent);
25402547
2541- for (iDim = 0 ; iDim < nDim; iDim++) WallDist[iDim] = (Coord[iDim] - Coord_Normal[iDim]);
2542-
2543- su2double WallDistMod = GeometryToolbox::Norm (nDim, WallDist);
2548+ for (iDim = 0 ; iDim < nDim; iDim++) {
2549+ CSkinFriction[iMarker](iVertex,iDim) = TauTangent[iDim] * factorFric;
2550+ }
25442551
2545- /* --- Compute y+ and non-dimensional velocity --- */
2552+ WallDistMod = GeometryToolbox::Distance (nDim, Coord, Coord_Normal);
25462553
2547- su2double FrictionVel = sqrt ( fabs (WallShearStress[iMarker][iVertex]) / Density);
2554+ /* --- Compute non-dimensional velocity and y+ --- */
25482555
2549- /* --- in case of wall functions, we have computed YPlus in the turbulence class --- */
2550- /* --- Note that we do not recompute y+ when y+<5 because y+ can become > 5 again --- */
2551- if (!wallfunctions)
2556+ FrictionVel = sqrt ( fabs (WallShearStress[iMarker][iVertex]) / Density);
2557+
2558+ if (!wallfunctions) {
25522559 YPlus[iMarker][iVertex] = WallDistMod * FrictionVel / (Viscosity / Density);
2560+ }
25532561
25542562 /* --- Compute total and maximum heat flux on the wall ---*/
25552563
0 commit comments