diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index e5737ceebb1..f7026201d0d 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -7514,6 +7514,7 @@ void CEulerSolver::BC_Supersonic_Outlet(CGeometry *geometry, CSolver **solver_co su2double *V_outlet, *V_domain; bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); + bool viscous = config->GetViscous(); string Marker_Tag = config->GetMarker_All_TagBound(val_marker); auto *Normal = new su2double[nDim]; @@ -7578,44 +7579,45 @@ void CEulerSolver::BC_Supersonic_Outlet(CGeometry *geometry, CSolver **solver_co if (implicit) Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); -// /*--- Viscous contribution, commented out because serious convergence problems ---*/ -// -// if (viscous) { -// -// /*--- Set laminar and eddy viscosity at the infinity ---*/ -// -// V_outlet[nDim+5] = nodes->GetLaminarViscosity(iPoint); -// V_outlet[nDim+6] = nodes->GetEddyViscosity(iPoint); -// -// /*--- Set the normal vector and the coordinates ---*/ -// -// visc_numerics->SetNormal(Normal); -// su2double Coord_Reflected[MAXNDIM]; -// GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), -// geometry->nodes->GetCoord(iPoint), Coord_Reflected); -// visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); -// -// /*--- Primitive variables, and gradient ---*/ -// -// visc_numerics->SetPrimitive(V_domain, V_outlet); -// visc_numerics->SetPrimVarGradient(nodes->GetGradient_Primitive(iPoint), nodes->GetGradient_Primitive(iPoint)); -// -// /*--- Turbulent kinetic energy ---*/ -// -// if (config->GetKind_Turb_Model() == TURB_MODEL::SST) -// visc_numerics->SetTurbKineticEnergy(solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0), -// solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0)); -// -// /*--- Compute and update residual ---*/ -// -// auto residual = visc_numerics->ComputeResidual(config); -// LinSysRes.SubtractBlock(iPoint, residual); -// -// /*--- Jacobian contribution for implicit integration ---*/ -// -// if (implicit) -// Jacobian.SubtractBlock2Diag(iPoint, residual.jacobian_i); -// } + /*--- Viscous contribution, commented out because serious convergence problems ---*/ + + if (viscous) { + + /*--- Set laminar and eddy viscosity at the infinity ---*/ + + V_outlet[nDim+5] = nodes->GetLaminarViscosity(iPoint); + V_outlet[nDim+6] = nodes->GetEddyViscosity(iPoint); + + /*--- Set the normal vector and the coordinates ---*/ + + visc_numerics->SetNormal(Normal); + su2double Coord_Reflected[MAXNDIM]; + unsigned long Point_Normal = geometry->vertex[val_marker][iVertex]->GetNormal_Neighbor(); + GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), + geometry->nodes->GetCoord(iPoint), Coord_Reflected); + visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); + + /*--- Primitive variables, and gradient ---*/ + + visc_numerics->SetPrimitive(V_domain, V_domain); + visc_numerics->SetPrimVarGradient(nodes->GetGradient_Primitive(iPoint), nodes->GetGradient_Primitive(iPoint)); + + /*--- Turbulent kinetic energy ---*/ + + if (config->GetKind_Turb_Model() == TURB_MODEL::SST) + visc_numerics->SetTurbKineticEnergy(solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0), + solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0)); + + /*--- Compute and update residual ---*/ + + auto residual = visc_numerics->ComputeResidual(config); + LinSysRes.SubtractBlock(iPoint, residual); + + /*--- Jacobian contribution for implicit integration ---*/ + + if (implicit) + Jacobian.SubtractBlock2Diag(iPoint, residual.jacobian_i); + } } } diff --git a/TestCases/navierstokes/flatplate/flatplate_supersonic.cfg b/TestCases/navierstokes/flatplate/flatplate_supersonic.cfg new file mode 100644 index 00000000000..96d0198c144 --- /dev/null +++ b/TestCases/navierstokes/flatplate/flatplate_supersonic.cfg @@ -0,0 +1,77 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Supersonic flat plate flow % +% Author: Tan Yilun % +% Institution: University of Chinese Academy of Sciences % +% Date: 2026.05.22 % +% File Version 8.0.1 % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +SOLVER= NAVIER_STOKES % Governing eqs: compressible Navier-Stokes +KIND_TURB_MODEL= NONE % Laminar (no turbulence model) +MATH_PROBLEM= DIRECT % Direct (not adjoint) +RESTART_SOL= YES % Start from scratch, not a restart +SOLUTION_FILENAME= restart_flow-newc2.dat + +MESH_FILENAME= grid2.cgns +MESH_FORMAT= CGNS + +TABULAR_FORMAT= TECPLOT +CONV_FILENAME= history +RESTART_FILENAME= restart_flow-newc3 +VOLUME_FILENAME= volume_flow-newc3 +SURFACE_FILENAME= surface_flow-newc3 +OUTPUT_WRT_FREQ= 500000 % Write output every xxxx iters +WRT_RESTART_OVERWRITE= YES +WRT_SURFACE_OVERWRITE= NO % Append iter# to surface files +WRT_VOLUME_OVERWRITE= NO % Append iter# to volume files +OUTPUT_FILES= (RESTART, TECPLOT, SURFACE_CSV) +SCREEN_OUTPUT=(INNER_ITER, WALL_TIME, AVG_CFL, RMS_DENSITY, RMS_MOMENTUM-X,RMS_MOMENTUM-Y,RMS_ENERGY,DRAG) + +MACH_NUMBER= 4.0 % Freestream Mach number +AOA= 0.0 % Angle of attack (deg) +SIDESLIP_ANGLE= 0.0 % Side-slip angle (deg) +INIT_OPTION= TD_CONDITIONS % Initialize from P, T +FREESTREAM_TEMPERATURE= 300.0 +REYNOLDS_NUMBER= 12314 +FREESTREAM_PRESSURE= 70.47 % Pa +REYNOLDS_LENGTH= 0.2 % m + + +MARKER_ISOTHERMAL= ( WALL, 300.0 ) % No-slip isothermal wall at 300 K +MARKER_SYM= ( SYMMETRY ) % Symmetry plane +MARKER_FAR= ( INLET ) % Far-field inlet +MARKER_SUPERSONIC_OUTLET= ( OUTLET ) % Supersonic outlet +MARKER_PLOTTING= ( WALL ) % Surface output marker +MARKER_MONITORING= ( WALL ) % Force monitoring marker + +NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES + +LINEAR_SOLVER= BCGSTAB +LINEAR_SOLVER_PREC= LU_SGS +LINEAR_SOLVER_ERROR= 1E-10 +LINEAR_SOLVER_ITER= 10 + +MGLEVEL= 0 % No multigrid + +CONV_NUM_METHOD_FLOW= AUSM % Convective flux scheme +MUSCL_FLOW= YES % 2nd-order MUSCL reconstruction +SLOPE_LIMITER_FLOW= VENKATAKRISHNAN_WANG +VENKAT_LIMITER_COEFF= 0.05 +% RAMP_MUSCL= YES +% RAMP_MUSCL_COEFF= (1000.0, 10.0, 500.0) + + + +CFL_NUMBER= 0.1 % CFL number +CFL_ADAPT= NO % Adaptive CFL +CFL_ADAPT_PARAM= ( 0.3, 1.05, 0.01, 5) +ITER= 5000000.0 % Max iterations +TIME_DISCRE_FLOW= EULER_EXPLICIT + +CONV_FIELD= RMS_ENERGY +CONV_RESIDUAL_MINVAL= -5 +CONV_STARTITER= 10 + diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index a138b9c374a..b417efbf8e6 100755 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -330,6 +330,14 @@ def main(): flatplate.test_vals = [-6.397042, -0.919335, 0.001321, 0.025064, 2.361500, -2.336500, 0.000000, 0.000000] test_list.append(flatplate) + # Supersonic laminar flat plate + flatplate_supersonic = TestCase('flatplate_supersonic') + flatplate_supersonic.cfg_dir = "navierstokes/flatplate" + flatplate_supersonic.cfg_file = "flatplate_supersonic.cfg" + flatplate_supersonic.test_iter = 100 + flatplate_supersonic.test_vals = [-6.397042, -0.919335, 0.001321, 0.025064, 2.361500, -2.336500, 0.000000, 0.000000] + test_list.append(flatplate_supersonic) + # Custom objective function flatplate_udobj = TestCase('flatplate_udobj') flatplate_udobj.cfg_dir = "user_defined_functions"