@@ -405,11 +405,10 @@ void CTurbSSTSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_cont
405405
406406 const bool implicit = (config->GetKind_TimeIntScheme () == EULER_IMPLICIT);
407407
408- bool rough_wall = false ;
409408 string Marker_Tag = config->GetMarker_All_TagBound (val_marker);
410409 WALL_TYPE WallType; su2double Roughness_Height;
411410 tie (WallType, Roughness_Height) = config->GetWallRoughnessProperties (Marker_Tag);
412- if ( WallType == WALL_TYPE::ROUGH) rough_wall = true ;
411+ const bool rough_wall = WallType == WALL_TYPE::ROUGH && Roughness_Height > 0 ;
413412
414413 /* --- Evaluate nu tilde at the closest point to the surface using the wall functions. ---*/
415414
@@ -424,94 +423,90 @@ void CTurbSSTSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_cont
424423 const auto iPoint = geometry->vertex [val_marker][iVertex]->GetNode ();
425424
426425 /* --- Check if the node belongs to the domain (i.e, not a halo node) ---*/
427- if (geometry->nodes ->GetDomain (iPoint)) {
428- const auto options = config->GetROUGHSSTParsedOptions ();
426+ if (!geometry->nodes ->GetDomain (iPoint)) continue ;
427+
428+ /* --- distance to closest neighbor ---*/
429+ su2double wall_dist = geometry->vertex [val_marker][iVertex]->GetNearestNeighborDistance ();
429430
430- /* --- distance to closest neighbor ---*/
431- su2double wall_dist = geometry->vertex [val_marker][iVertex]->GetNearestNeighborDistance ();
431+ su2double solution[MAXNVAR];
432432
433- if (rough_wall) {
434- /* --- Set wall values ---*/
435- su2double density = solver_container[FLOW_SOL]->GetNodes ()->GetDensity (iPoint);
436- su2double laminar_viscosity = solver_container[FLOW_SOL]->GetNodes ()->GetLaminarViscosity (iPoint);
437- su2double WallShearStress = solver_container[FLOW_SOL]->GetWallShearStress (val_marker, iVertex);
433+ if (rough_wall) {
434+ /* --- Set wall values ---*/
435+ su2double density = solver_container[FLOW_SOL]->GetNodes ()->GetDensity (iPoint);
436+ su2double laminar_viscosity = solver_container[FLOW_SOL]->GetNodes ()->GetLaminarViscosity (iPoint);
437+ su2double WallShearStress = solver_container[FLOW_SOL]->GetWallShearStress (val_marker, iVertex);
438438
439- /* --- Compute non-dimensional velocity ---*/
440- su2double FrictionVel = sqrt (fabs (WallShearStress)/density);
439+ /* --- Compute non-dimensional velocity ---*/
440+ su2double FrictionVel = sqrt (fabs (WallShearStress)/density);
441441
442- /* --- Compute roughness in wall units. ---*/
443- // su2double Roughness_Height = config->GetWall_RoughnessHeight(Marker_Tag);
444- su2double kPlus = FrictionVel*Roughness_Height*density/laminar_viscosity;
442+ /* --- Compute roughness in wall units. ---*/
443+ su2double kPlus = FrictionVel*Roughness_Height*density/laminar_viscosity;
445444
446- su2double S_R= 0.0 ;
447- su2double solution[2 ] = {};
448- /* --- Modify the omega and k to account for a rough wall. ---*/
445+ /* --- Modify the omega and k to account for a rough wall. ---*/
449446
450- /* --- Reference 1 original Wilcox (1998) ---*/
451- if (options.wilcox1998 ) {
447+ switch (config->GetKindRoughSSTModel ()) {
448+ /* --- Reference 1 original Wilcox (1998). ---*/
449+ case ROUGHSST_MODEL::WILCOX1998: {
450+ su2double S_R = 0.0 ;
452451 if (kPlus <= 25 )
453- S_R = (50 /(kPlus +EPS))*( 50 /( kPlus +EPS) );
452+ S_R = pow (50 /(kPlus +EPS), 2 );
454453 else
455- S_R = 100 /(kPlus +EPS);
456-
454+ S_R = 100 /(kPlus +EPS);
455+
457456 solution[0 ] = 0.0 ;
458- solution[1 ] = FrictionVel*FrictionVel*S_R/(laminar_viscosity/density);
459- }
460- else if (options.wilcox2006 ) {
457+ solution[1 ] = FrictionVel*FrictionVel*S_R/(laminar_viscosity/density);
458+ } break ;
461459 /* --- Reference 2 from D.C. Wilcox Turbulence Modeling for CFD (2006) ---*/
460+ case ROUGHSST_MODEL::WILCOX2006: {
461+ su2double S_R = 0.0 ;
462462 if (kPlus <= 5 )
463463 S_R = pow (200 /(kPlus +EPS),2 );
464464 else
465465 S_R = 100 /(kPlus +EPS) + (pow (200 /(kPlus +EPS),2 ) - 100 /(kPlus +EPS))*exp (5 -kPlus );
466-
466+
467467 solution[0 ] = 0.0 ;
468468 solution[1 ] = FrictionVel*FrictionVel*S_R/(laminar_viscosity/density);
469- }
469+ } break ;
470470 /* --- Knopp eddy viscosity limiter ---*/
471- else if (options. limiter_knopp ) {
471+ case ROUGHSST_MODEL::LIMITER_KNOPP: {
472472 su2double d0 = 0.03 *Roughness_Height*min (1.0 , pow ((kPlus + EPS )/30.0 , 2.0 /3.0 ))*min (1.0 , pow ((kPlus + EPS)/45.0 , 0.25 ))*min (1.0 , pow ((kPlus + EPS) /60 , 0.25 ));
473473 solution[0 ] = (FrictionVel*FrictionVel / sqrt (constants[6 ]))*min (1.0 , kPlus / 90.0 );
474474
475475 const su2double kappa = config->GetwallModel_Kappa ();
476476 su2double beta_1 = constants[4 ];
477- solution[1 ] = min ( FrictionVel/(sqrt (constants[6 ])*d0*kappa), 60.0 *laminar_viscosity/(density*beta_1*pow (wall_dist,2 )));
478- }
479- /* --- Aupoix eddy viscosity limiter ---*/
480- else if (options. limiter_aupoix ) {
477+ solution[1 ] = min ( FrictionVel/(sqrt (constants[6 ])*d0*kappa), 60.0 *laminar_viscosity/(density*beta_1*pow (wall_dist,2 )));
478+ } break ;
479+ /* --- Aupoix eddy viscosity limiter ---*/
480+ case (ROUGHSST_MODEL::LIMITER_AUPOIX): {
481481 su2double k0Plus = ( 1.0 /sqrt ( constants[6 ])) * tanh ((log10 ((kPlus +EPS ) / 30.0 ) + 1.0 - 1.0 *tanh ( (kPlus + EPS) / 125.0 ))*tanh ((kPlus + EPS) / 125.0 ));
482482 su2double kwallPlus = max (0.0 , k0Plus);
483483 su2double kwall = kwallPlus*FrictionVel*FrictionVel;
484-
484+
485485 su2double omegawallPlus = (300.0 / pow (kPlus + EPS, 2.0 )) * pow (tanh (15.0 / (4.0 *kPlus )), -1.0 ) + (191.0 / (kPlus + EPS))*(1.0 - exp (-kPlus / 250.0 ));
486486
487487 solution[0 ] = kwall;
488488 solution[1 ] = omegawallPlus*FrictionVel*FrictionVel*density/laminar_viscosity;
489- }
490- /* --- Set the solution values and zero the residual ---*/
491- nodes->SetSolution_Old (iPoint,solution);
492- nodes->SetSolution (iPoint,solution);
493- LinSysRes.SetBlock_Zero (iPoint);
494- } else { // smooth wall
495- /* --- Set wall values ---*/
496- su2double density = solver_container[FLOW_SOL]->GetNodes ()->GetDensity (iPoint);
497- su2double laminar_viscosity = solver_container[FLOW_SOL]->GetNodes ()->GetLaminarViscosity (iPoint);
498-
499- su2double beta_1 = constants[4 ];
500- su2double solution[MAXNVAR];
501- solution[0 ] = 0.0 ;
502- solution[1 ] = 60.0 *laminar_viscosity/(density*beta_1*pow (wall_dist,2 ));
503-
504- /* --- Set the solution values and zero the residual ---*/
505- nodes->SetSolution_Old (iPoint,solution);
506- nodes->SetSolution (iPoint,solution);
507- LinSysRes.SetBlock_Zero (iPoint);
489+ } break ;
508490 }
491+ } else { // smooth wall
492+ /* --- Set wall values ---*/
493+ su2double density = solver_container[FLOW_SOL]->GetNodes ()->GetDensity (iPoint);
494+ su2double laminar_viscosity = solver_container[FLOW_SOL]->GetNodes ()->GetLaminarViscosity (iPoint);
495+
496+ su2double beta_1 = constants[4 ];
497+ solution[0 ] = 0.0 ;
498+ solution[1 ] = 60.0 *laminar_viscosity/(density*beta_1*pow (wall_dist,2 ));
499+ }
509500
510- if (implicit) {
511- /* --- Change rows of the Jacobian (includes 1 in the diagonal) ---*/
512- Jacobian.DeleteValsRowi (iPoint*nVar);
513- Jacobian.DeleteValsRowi (iPoint*nVar+1 );
514- }
501+ /* --- Set the solution values and zero the residual ---*/
502+ nodes->SetSolution_Old (iPoint, solution);
503+ nodes->SetSolution (iPoint, solution);
504+ LinSysRes.SetBlock_Zero (iPoint);
505+
506+ if (implicit) {
507+ /* --- Change rows of the Jacobian (includes 1 in the diagonal) ---*/
508+ Jacobian.DeleteValsRowi (iPoint*nVar);
509+ Jacobian.DeleteValsRowi (iPoint*nVar+1 );
515510 }
516511 }
517512 END_SU2_OMP_FOR
0 commit comments