Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 40 additions & 38 deletions SU2_CFD/src/solvers/CEulerSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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);
}

}
}
Expand Down
Binary file added TestCases/2d_plate/grid2.cgns
Binary file not shown.
102 changes: 102 additions & 0 deletions TestCases/2d_plate/lam_flatplate.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% 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 ------------%
SOLVER= NAVIER_STOKES % Governing eqs: compressible Navier-Stokes
KIND_TURB_MODEL= NONE % Laminar (no turbulence model)
MATH_PROBLEM= DIRECT % Direct (not adjoint)

% ------------- Time Integration ------------%
%TIME_DOMAIN= NO % Unsteady simulation
%TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER % Dual time stepping
%TIME_STEP= 1E-6 % Physical time step (s)
%INNER_ITER= 20 % Max inner iterations per physical time step
%TIME_ITER= 100000.0

CFL_NUMBER= 0.1 % CFL number
CFL_ADAPT= NO % Adaptive CFL
CFL_ADAPT_PARAM= ( 0.3, 1.05, 0.01, 5)
ITER= 100000 % Max iterations
TIME_DISCRE_FLOW= EULER_EXPLICIT
OUTPUT_WRT_FREQ= 100000 % Write output every xxxx iters

% ------------- In & Output ------------%
RESTART_SOL= NO % Start from scratch, not a restart
SOLUTION_FILENAME= restart_flow.dat

MESH_FILENAME= grid2.cgns
MESH_FORMAT= CGNS

TABULAR_FORMAT= TECPLOT
CONV_FILENAME= history
RESTART_FILENAME= restart_flow
VOLUME_FILENAME= volume_flow
SURFACE_FILENAME= surface_flow
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,LIFT)

% ------------- Freestream Conditions ------------%
MACH_NUMBER= 4.0 % Freestream Mach number
AOA= 0.0
SIDESLIP_ANGLE= 0.0
INIT_OPTION= TD_CONDITIONS % Initialize from P, T
% FREESTREAM_OPTION= TEMPERATURE_FS
FREESTREAM_TEMPERATURE= 300.0
REYNOLDS_NUMBER= 12314
FREESTREAM_PRESSURE= 70.47
REYNOLDS_LENGTH= 0.2

% ------------- Transport properties ------------%
%FLUID_MODEL= IDEAL_GAS % Ideal gas law
%GAMMA_VALUE= 1.4
%GAS_CONSTANT= 287.058

%VISCOSITY_MODEL= SUTHERLAND
%MU_REF= 1.716E-5
%MU_T_REF= 273.15
%SUTHERLAND_CONSTANT= 110.4

%CONDUCTIVITY_MODEL= CONSTANT_PRANDTL
%PRANDTL_LAM= 0.72

% ------------- Boundary Conditions ------------%
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_INLET = (INLET, 300.0,70.47,1388.755,0,0)
MARKER_SUPERSONIC_OUTLET= ( OUTLET ) % Supersonic outlet
MARKER_PLOTTING= ( WALL ) % Surface output marker
MARKER_MONITORING= ( WALL ) % Force monitoring marker

% ------------- Numerical Methods ------------%
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)

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

% ------------- Convergence criteria ------------%
CONV_FIELD= RMS_ENERGY
CONV_RESIDUAL_MINVAL= -5
CONV_STARTITER= 10