Skip to content

Commit 0490bdb

Browse files
remove frictional wall heating from incompressible wall function model (#1741)
* remove frictional wall heating from incompressible wall function model * update regression test for incompressible wall functions Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
1 parent 51fc091 commit 0490bdb

3 files changed

Lines changed: 24 additions & 65 deletions

File tree

SU2_CFD/src/solvers/CIncNSSolver.cpp

Lines changed: 13 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -619,15 +619,9 @@ void CIncNSSolver::SetTau_Wall_WF(CGeometry *geometry, CSolver **solver_containe
619619
unsigned long notConvergedCounter = 0; /*--- Counts the number of wall cells that are not converged ---*/
620620
unsigned long smallYPlusCounter = 0; /*--- Counts the number of wall cells where y+ < 5 ---*/
621621

622-
const su2double Gas_Constant = config->GetGas_ConstantND();
623-
const su2double Cp = (Gamma / Gamma_Minus_One) * Gas_Constant;
624622
const auto max_iter = config->GetwallModel_MaxIter();
625623
const su2double relax = config->GetwallModel_RelFac();
626624

627-
/*--- Compute the recovery factor use Molecular (Laminar) Prandtl number (see Nichols & Nelson, nomenclature ) ---*/
628-
629-
const su2double Recovery = pow(config->GetPrandtl_Lam(), (1.0/3.0));
630-
631625
/*--- Typical constants from boundary layer theory ---*/
632626

633627
const su2double kappa = config->GetwallModel_Kappa();
@@ -698,34 +692,7 @@ void CIncNSSolver::SetTau_Wall_WF(CGeometry *geometry, CSolver **solver_containe
698692

699693
su2double WallDistMod = GeometryToolbox::Norm(int(MAXNDIM), WallDist);
700694

701-
/*--- Compute the wall temperature using the Crocco-Buseman equation.
702-
* In incompressible flows, we can assume that there is no velocity-related
703-
* temperature change Prandtl: T+ = Pr*y+ ---*/
704-
su2double T_Wall = nodes->GetTemperature(iPoint);
705-
const su2double Conductivity_Wall = nodes->GetThermalConductivity(iPoint);
706-
707-
/*--- If a wall temperature was given, we compute the local heat flux using k*dT/dn ---*/
708-
709-
su2double q_w = 0.0;
710-
711-
if (config->GetMarker_All_KindBC(iMarker) == ISOTHERMAL) {
712-
const su2double T_n = nodes->GetTemperature(Point_Normal);
713-
q_w = Conductivity_Wall * (T_Wall - T_n) / (WallDistMod);
714-
}
715-
else if (config->GetMarker_All_KindBC(iMarker) == HEAT_FLUX) {
716-
q_w = config->GetWall_HeatFlux(Marker_Tag) / config->GetHeat_Flux_Ref();
717-
}
718-
else if (config->GetMarker_All_KindBC(iMarker) == HEAT_TRANSFER) {
719-
const su2double Transfer_Coefficient = config->GetWall_HeatTransfer_Coefficient(Marker_Tag) *
720-
config->GetTemperature_Ref()/config->GetHeat_Flux_Ref();
721-
const su2double Tinfinity = config->GetWall_HeatTransfer_Temperature(Marker_Tag) / config->GetTemperature_Ref();
722-
q_w = Transfer_Coefficient * (Tinfinity - T_Wall);
723-
}
724-
725-
/*--- Incompressible formulation ---*/
726-
727695
su2double Density_Wall = nodes->GetDensity(iPoint);
728-
const su2double Lam_Visc_Normal = nodes->GetLaminarViscosity(Point_Normal);
729696

730697
/*--- Compute the shear stress at the wall in the regular fashion
731698
* by using the stress tensor on the surface ---*/
@@ -766,41 +733,33 @@ void CIncNSSolver::SetTau_Wall_WF(CGeometry *geometry, CSolver **solver_containe
766733

767734
/*--- Friction velocity and u+ ---*/
768735

769-
const su2double U_Plus = VelTangMod/U_Tau;
770-
771-
/*--- Gamma, Beta, Q, and Phi, defined by Nichols & Nelson (2004) page 1110 ---*/
772-
773-
const su2double Gam = Recovery*U_Tau*U_Tau/(2.0*Cp*T_Wall);
774-
const su2double Beta = q_w*Lam_Visc_Wall/(Density_Wall*T_Wall*Conductivity_Wall*U_Tau);
775-
const su2double Q = sqrt(Beta*Beta + 4.0*Gam);
776-
const su2double Phi = asin(-1.0*Beta/Q);
736+
const su2double U_Plus = VelTangMod / U_Tau;
777737

778-
/*--- Y+ defined by White & Christoph (compressibility and heat transfer) negative value for (2.0*Gam*U_Plus - Beta)/Q ---*/
738+
/*--- Y+ defined by White & Christoph ---*/
739+
740+
const su2double kUp = kappa * U_Plus;
779741

780-
const su2double Y_Plus_White = exp((kappa/sqrt(Gam))*(asin((2.0*Gam*U_Plus - Beta)/Q) - Phi))*exp(-1.0*kappa*B);
742+
// incompressible adiabatic result
743+
const su2double Y_Plus_White = exp(kUp) * exp(-kappa * B);
781744

782745
/*--- Spalding's universal form for the BL velocity with the
783746
* outer velocity form of White & Christoph above. ---*/
784-
const su2double kUp = kappa*U_Plus;
785-
Y_Plus = U_Plus + Y_Plus_White - (exp(-1.0*kappa*B)* (1.0 + kUp + 0.5*kUp*kUp + kUp*kUp*kUp/6.0));
747+
Y_Plus = U_Plus + Y_Plus_White + (exp(-kappa * B)* (1.0 - kUp - 0.5 * kUp * kUp - kUp * kUp * kUp / 6.0));
786748

787-
const su2double dypw_dyp = 2.0*Y_Plus_White*(kappa*sqrt(Gam)/Q)*sqrt(1.0 - pow(2.0*Gam*U_Plus - Beta,2.0)/(Q*Q));
749+
/*--- incompressible formulation ---*/
750+
Eddy_Visc_Wall = Lam_Visc_Wall * kappa*exp(-kappa*B) * (exp(kUp) -1.0 - kUp - kUp * kUp / 2.0);
788751

789-
Eddy_Visc_Wall = Lam_Visc_Wall*(1.0 + dypw_dyp - kappa*exp(-1.0*kappa*B)*
790-
(1.0 + kappa*U_Plus + kappa*kappa*U_Plus*U_Plus/2.0)
791-
- Lam_Visc_Normal/Lam_Visc_Wall);
792752
Eddy_Visc_Wall = max(1.0e-6, Eddy_Visc_Wall);
793753

794754
/* --- Define function for Newton method to zero --- */
795755

796756
diff = (Density_Wall * U_Tau * WallDistMod / Lam_Visc_Wall) - Y_Plus;
797757

798-
/* --- Gradient of function defined above --- */
758+
/* --- Gradient of function defined above wrt U_Tau --- */
799759

800-
const su2double grad_diff = Density_Wall * WallDistMod / Lam_Visc_Wall + VelTangMod / (U_Tau * U_Tau) +
801-
kappa /(U_Tau * sqrt(Gam)) * asin(U_Plus * sqrt(Gam)) * Y_Plus_White -
802-
exp(-1.0 * B * kappa) * (0.5 * pow(VelTangMod * kappa / U_Tau, 3) +
803-
pow(VelTangMod * kappa / U_Tau, 2) + VelTangMod * kappa / U_Tau) / U_Tau;
760+
const su2double dyp_dup = 1.0 + exp(-kappa * B) * (kappa * exp(kUp) - kappa - kUp - 0.5 * kUp * kUp);
761+
const su2double dup_dutau = - U_Plus / U_Tau;
762+
const su2double grad_diff = Density_Wall * WallDistMod / Lam_Visc_Wall - dyp_dup * dup_dutau;
804763

805764
/* --- Newton Step --- */
806765

SU2_CFD/src/solvers/CNSSolver.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -857,9 +857,6 @@ void CNSSolver::SetTau_Wall_WF(CGeometry *geometry, CSolver **solver_container,
857857
for (auto iDim = 0u; iDim < nDim; iDim++)
858858
Vel[iDim] = nodes->GetVelocity(Point_Normal,iDim);
859859

860-
const su2double P_Normal = nodes->GetPressure(Point_Normal);
861-
const su2double T_Normal = nodes->GetTemperature(Point_Normal);
862-
863860
/*--- Compute the wall-parallel velocity at first point off the wall ---*/
864861

865862
const su2double VelNormal = GeometryToolbox::DotProduct(int(MAXNDIM), Vel, UnitNormal);
@@ -877,7 +874,10 @@ void CNSSolver::SetTau_Wall_WF(CGeometry *geometry, CSolver **solver_container,
877874

878875
const su2double WallDistMod = GeometryToolbox::Norm(int(MAXNDIM), WallDist);
879876

880-
/*--- Initial value for wall temperature ---*/
877+
su2double T_Wall = nodes->GetTemperature(iPoint);
878+
const su2double Conductivity_Wall = nodes->GetThermalConductivity(iPoint);
879+
880+
/*--- If a wall temperature was given, we compute the local heat flux using k*dT/dn ---*/
881881

882882
su2double q_w = 0.0;
883883

@@ -888,14 +888,14 @@ void CNSSolver::SetTau_Wall_WF(CGeometry *geometry, CSolver **solver_container,
888888
/*--- Extrapolate the pressure from the interior & compute the
889889
wall density using the equation of state ---*/
890890

891+
const su2double P_Normal = nodes->GetPressure(Point_Normal);
892+
const su2double T_Normal = nodes->GetTemperature(Point_Normal);
893+
const su2double P_Wall = P_Normal;
894+
891895
/*--- Compressible formulation ---*/
892896

893-
su2double T_Wall = nodes->GetTemperature(iPoint);
894-
const su2double P_Wall = P_Normal;
895897
su2double Density_Wall = P_Wall / (Gas_Constant * T_Wall);
896898
const su2double Lam_Visc_Normal = nodes->GetLaminarViscosity(Point_Normal);
897-
const su2double Conductivity_Wall = nodes->GetThermalConductivity(iPoint);
898-
899899

900900
/*--- Compute the shear stress at the wall in the regular fashion
901901
* by using the stress tensor on the surface ---*/
@@ -938,7 +938,7 @@ void CNSSolver::SetTau_Wall_WF(CGeometry *geometry, CSolver **solver_container,
938938

939939
const su2double U_Plus = VelTangMod/U_Tau;
940940

941-
/*--- Gamma, Beta, Q, and Phi, defined by Nichols & Nelson (2004) page 1110 ---*/
941+
/*--- Gamma, Beta, Q, and Phi, defined by Nichols & Nelson (2004) page 1108 ---*/
942942

943943
const su2double Gam = Recovery*U_Tau*U_Tau/(2.0*Cp*T_Wall);
944944
const su2double Beta = q_w*Lam_Visc_Wall/(Density_Wall*T_Wall*Conductivity_Wall*U_Tau);

TestCases/serial_regression.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ def main():
592592
inc_turb_wallfunction_flatplate_sst.cfg_dir = "wallfunctions/flatplate/incompressible_SST"
593593
inc_turb_wallfunction_flatplate_sst.cfg_file = "turb_SST_flatplate.cfg"
594594
inc_turb_wallfunction_flatplate_sst.test_iter = 10
595-
inc_turb_wallfunction_flatplate_sst.test_vals = [-6.561293, -5.730190, -6.305916, -4.230297, -7.164083, -2.047256, 10, -2.941818, 0.000974, 0.003195, 0.205750]
595+
inc_turb_wallfunction_flatplate_sst.test_vals = [-6.561370, -5.730257, -6.305996, -4.230300, -7.164395, -2.047273, 10, -2.941859, 0.000974, 0.003195, 0.205820]
596596
inc_turb_wallfunction_flatplate_sst.su2_exec = "SU2_CFD"
597597
inc_turb_wallfunction_flatplate_sst.timeout = 1600
598598
inc_turb_wallfunction_flatplate_sst.tol = 0.00001
@@ -603,7 +603,7 @@ def main():
603603
inc_turb_wallfunction_flatplate_sa.cfg_dir = "wallfunctions/flatplate/incompressible_SA"
604604
inc_turb_wallfunction_flatplate_sa.cfg_file = "turb_SA_flatplate.cfg"
605605
inc_turb_wallfunction_flatplate_sa.test_iter = 10
606-
inc_turb_wallfunction_flatplate_sa.test_vals = [-6.561221, -5.718427, -6.306321, -4.230222, -9.586624, 10, -2.927239, 0.000858, 0.003794 ] #last 9 columns
606+
inc_turb_wallfunction_flatplate_sa.test_vals = [-6.561303, -5.718581, -6.306403, -4.230225, -9.586904, 10, -2.927392, 0.000858, 0.003792 ] #last 9 columns
607607
inc_turb_wallfunction_flatplate_sa.su2_exec = "SU2_CFD"
608608
inc_turb_wallfunction_flatplate_sa.timeout = 1600
609609
inc_turb_wallfunction_flatplate_sa.tol = 0.00001

0 commit comments

Comments
 (0)