SU2 icon indicating copy to clipboard operation
SU2 copied to clipboard

Assistance with Langtry-Menter Transition Model (LM) Error in SU2

Open EngJamal2023 opened this issue 1 year ago • 9 comments

I am currently working on airfoil shape optimization using SU2, and I have encountered an issue when trying to use the Langtry-Menter (LM) transition model with the SST turbulence model in my simulation. The configuration I am using includes the following setup:

% -------------------- MAIN SOLVER AND PHYSICS DEFINITION --------------------%
% Solver for incompressible RANS equations
SOLVER= INC_RANS   
% Use Menter's SST turbulence model                   
KIND_TURB_MODEL= SST  
% Activate Langtry-Menter transition model                
KIND_TRANS_MODEL= LM  
% Use the 2015 correlation for the LM model just for 3D
LM_OPTIONS= SULUKSNA
% [DIRECT, CONTINUOUS_ADJOINT, DISCRETE_ADJOINT]                  
MATH_PROBLEM= DIRECT                   
% Set to CONTINUOUS_ADJOINT for gradient computation
RESTART_SOL= YES
...

However, when I attempt to run the simulation, I encounter the following error:

RuntimeError: Path = /home/user/SU2_Project/design/FFA_W3/FFA_W3_211/incompressible/opj_efficiency/FFD/Thickness_method/DV20/DESIGNS/DSN_001/ADJOINT_EFFICIENCY/,
Command = mpirun -n 8 /usr/local/bin/SU2_CFD_AD config_CFD_AD.cfg
SU2 process returned error '139'
[ubuntu:330017] *** Process received signal ***
[ubuntu:330017] Signal: Segmentation fault (11)
...

It appears that when I enable the Langtry-Menter (LM) transition model, the simulation crashes, and I get a segmentation fault. I have ensured that the transition model is correctly configured, but I am still facing this issue.

Could you please help me identify the problem? Specifically:

  1. Why am I unable to use the Langtry-Menter model with the SST turbulence model?
  2. Are there any known issues or additional configurations that need to be applied for the transition model to work in this setup?
  3. How can I resolve the segmentation fault when using this configuration?

I would appreciate any guidance or suggestions you may have to fix this issue.

Thank you in advance for your help!

EngJamal2023 avatar Nov 01 '25 09:11 EngJamal2023

Can you try running SU2_CFD (primal) and SU2_CFD_AD (discrete adjoint) manually for the initial geometry? If you can share a simple way of reproducing the problem, it will make it easier to debug and fix.

pcarruscag avatar Nov 01 '25 19:11 pcarruscag

I am not sure that the LM model works with the Adjoint solver. One should check that it has been implemented correctly for differentiation. I tried following the turbulence model implementation as closely as possible, but there might be stuff missing.

rois1995 avatar Nov 03 '25 07:11 rois1995

Can you try running SU2_CFD (primal) and SU2_CFD_AD (discrete adjoint) manually for the initial geometry? If you can share a simple way of reproducing the problem, it will make it easier to debug and fix. I have been working on a CFD problem using SU2 for the past two weeks and have encountered an issue that I need your help with. The error occurs when I try to run the adjoint solver after completing the CFD solver.

Issue Description:

I successfully run the direct (CFD) solver using the code below and obtain results. However, when I attempt to run the adjoint solver, I encounter the following error:

Unable to open SU2 restart file solution_flow.dat

The error causes the adjoint solver to terminate, as it cannot read the solution_flow.dat file that should contain the flow solution from the CFD run.

Workflow and Configuration:

  • I first run the direct solver using the configuration file (SST_FFA_W3_comp.cfg) without any issues, with MATH_PROBLEM=DISCRETE_ADJOINT set in the adjoint configuration.
  • However, when I use the adjoint solver (SU2_CFD_AD) with the same configuration, the process fails due to the missing restart file.

I have set the configuration as follows:

RESTART_SOL= YES
SOLUTION_FILENAME= solution_flow
MATH_PROBLEM= DISCRETE_ADJOINT

Despite this, the adjoint solver cannot find the required solution_flow.dat file. I’ve noticed that if I change the configuration to not use the adjoint solver, the simulation runs without any issues.

The Error:

When I enable the adjoint problem (MATH_PROBLEM=DISCRETE_ADJOINT), I receive the following message in the output:

Unable to open SU2 restart file solution_flow.dat

This error indicates that the flow solution file, solution_flow.dat, cannot be found, and this is causing the process to terminate.

What I've Tried:

  • Running the CFD simulation first, then using the resulting restart file (solution_flow.dat).
  • Setting RESTART_SOL= YES and ensuring the adjoint solver is reading from the correct location.
  • Ensuring the file solution_flow.dat exists and is properly placed.

Question:

  • Why does the adjoint solver fail to read the restart file?
  • I’ve been unable to resolve the problem for the past two weeks, and I would greatly appreciate any guidance on how to fix this.

Additional Observations:

  • When I remove the adjoint problem from the configuration, the simulation completes without error.
  • If I make changes like adjusting the NUM_METHOD_GRAD_RECON or setting RESTART_SOL= NO, it impacts the solution’s accuracy but does not resolve the error when attempting to run the adjoint.

I would like to ensure that I can use the adjoint solver correctly after completing the CFD run. Can you suggest any adjustments to my configuration or any changes that might resolve this issue?

Your Help:

I would really appreciate any assistance or insights you can provide. This problem has been quite challenging, and I hope with your help, I can resolve it.

Looking forward to your response.

Thank you in advance!

Best regards,

SST_FFA_W3_comp.txt cfd result as following

cfd result output.txt

EngJamal2023 avatar Nov 05 '25 13:11 EngJamal2023

the error output from airfoil shape optimization

airfoil shape optimization output.txt

EngJamal2023 avatar Nov 05 '25 13:11 EngJamal2023

To run SU2_CFD_AD you use RESTART_SOL=NO, if you set it to YES it will try to restart the adjoint, which you have not run yet. The adjoint will looks for the primal solution file, regardless of what you put in RESTART_SOL

pcarruscag avatar Nov 07 '25 16:11 pcarruscag

Set it to NO, if it doesn't find the primal file see if the name is correct, renaming the file should be the quickest way if you don't know the SU2 option to set the flow file name

pcarruscag avatar Nov 07 '25 16:11 pcarruscag

I am using SU2 (v8.2 "Harrier") to compute lift and drag coefficients for an airfoil in both compressible and incompressible flow conditions using the RANS solver.

I understand that there are many parameters in the SU2 configuration file that can influence the accuracy of the lift and drag predictions (free-stream conditions, turbulence and transition models, numerical schemes, etc.). I would like to better understand:

Which parameters primarily affect the physical lift and drag values (for example, those related to Mach number, angle of attack, Reynolds number, turbulence/transition, etc.).

Which parameters are mainly numerical/stability controls (CFL, multigrid, slope limiters, linear solver settings) and should not significantly change the “true” physical lift and drag once the solution is converged.

How to systematically decide which parameters I am allowed to change when I see unexpected lift/drag results in the SU2 output, and which parameters should generally be left at default values.

Below is my current configuration file for a 2D airfoil at Mach 0.3, AoA 7.104°, using the RANS solver with SST turbulence and LM transition:

`%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % SU2 configuration file % % Case description: Shape design (RANS) % % Author: Francisco Palacios % % Institution: Stanford University % % File Version 8.2.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% SOLVER= RANS KIND_TURB_MODEL= SST SST_OPTIONS= NONE KIND_TRANS_MODEL= LM FREESTREAM_TURBULENCEINTENSITY= 0.0015 % was 0.001 FREESTREAM_TURB2LAMVISCRATIO= 10.0 %initial value for the intermittency equation. Used only with transition models (e.g., LM). 1.0 means fully turbulent flow, which is the standard initial condition. % Value for freestream intermittency FREESTREAM_INTERMITTENCY= 0.1 MATH_PROBLEM= DIRECT RESTART_SOL= NO

% ---- NONEQUILIBRIUM GAS, IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% % % Fluid model (STANDARD_AIR, IDEAL_GAS, VW_GAS, PR_GAS, % CONSTANT_DENSITY, INC_IDEAL_GAS, INC_IDEAL_GAS_POLY, MUTATIONPP, SU2_NONEQ, FLUID_MIXTURE) FLUID_MODEL= STANDARD_AIR % % Ratio of specific heats (1.4 default and the value is hardcoded % for the model STANDARD_AIR, compressible only) GAMMA_VALUE= 1.4 % % Specific gas constant (287.058 J/kgK default and this value is hardcoded % for the model STANDARD_AIR, compressible only) GAS_CONSTANT= 287.87 % % Acentri factor (0.035 (air)) ACENTRIC_FACTOR= 0.035 % % Specific heat at constant pressure, Cp (1004.703 J/kgK (air)). % Incompressible fluids with energy eqn. (CONSTANT_DENSITY, INC_IDEAL_GAS) and the heat equation. SPECIFIC_HEAT_CP= 1004.649 % % Molecular Weights of species for an incompressible ideal gas (28.96 g/mol (air) default), % For multispecies, we have N Molecular weights: W_1, W_2,...., W_N MOLECULAR_WEIGHT= 28.966 % % --------------------------- VISCOSITY MODEL ---------------------------------% % % Viscosity model (SUTHERLAND, CONSTANT_VISCOSITY, POLYNOMIAL_VISCOSITY). VISCOSITY_MODEL= SUTHERLAND % % Sutherland Viscosity Ref (1.716E-5 default value for AIR SI) MU_REF= 1.716E-5 % % Sutherland Temperature Ref (273.15 K default value for AIR SI) MU_T_REF= 273.15 % % Sutherland constant (110.4 default value for AIR SI) SUTHERLAND_CONSTANT= 110.4 % % ------------------------ THERMAL CONDUCTIVITY MODEL -------------------------% % % Laminar Conductivity model (CONSTANT_CONDUCTIVITY, CONSTANT_PRANDTL, % POLYNOMIAL_CONDUCTIVITY). CONDUCTIVITY_MODEL= CONSTANT_PRANDTL % % Laminar Prandtl number (0.72 (air), only for CONSTANT_PRANDTL) PRANDTL_LAM= 0.72 % % Definition of the turbulent thermal conductivity model for RANS % (CONSTANT_PRANDTL_TURB by default, NONE). TURBULENT_CONDUCTIVITY_MODEL= CONSTANT_PRANDTL_TURB % % Turbulent Prandtl number (0.9 (air) by default) For air, the Prandtl number is about 0.72 in laminar flow, and for turbulent flow, it's about 0.9. PRANDTL_TURB= 0.9 % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% MACH_NUMBER= 0.3 AOA= 7.104 FREESTREAM_TEMPERATURE= 288.15 FREESTREAM_PRESSURE= 101325.0 REYNOLDS_NUMBER= 6.0E06 REYNOLDS_LENGTH= 1.0 % ---------------------- REFERENCE VALUE DEFINITION ---------------------------% REF_ORIGIN_MOMENT_X = 0.25 REF_ORIGIN_MOMENT_Y = 0.00 REF_ORIGIN_MOMENT_Z = 0.00 REF_LENGTH= 1.0 REF_AREA= 1.0

% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% MARKER_HEATFLUX= ( AIRFOIL, 0.0 ) MARKER_FAR= ( FARFIELD )

% Remove far-field and use explicit inlet/outlet for compressible flow %MARKER_FAR= ( NONE )

% Inlet: TOTAL CONDITIONS (Tt[K], Pt[Pa], nx, ny, nz) %INLET_TYPE= TOTAL_CONDITIONS %MARKER_INLET= ( INLET, 293.3367, 107853.3987, 0.992323, 0.123671, 0.000000 )

% Outlet: static thermodynamic pressure (Pa) %MARKER_OUTLET= ( OUTLET, 101325.0 )

% Turbulence BC at inlet (SST): (marker, turbulence intensity, mu_t/mu_l) %MARKER_INLET_TURBULENT= ( INLET, 0.0005, 10.0 )

% Keep your plotting/monitoring markers MARKER_PLOTTING= ( AIRFOIL ) MARKER_MONITORING= ( AIRFOIL ) MARKER_DESIGNING = ( AIRFOIL ) MARKER_ANALYZE = ( AIRFOIL )

% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES

% --- CFL control (fixed + adaptive) --- CFL_NUMBER= 10.0 CFL_ADAPT= YES % Parameters of the adaptive CFL number (factor down, factor up, CFL min value, % CFL max value ) CFL_ADAPT_PARAM= (0.5, 1.5, 1.0, 30.0) ITER= 50000

% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% LINEAR_SOLVER= FGMRES LINEAR_SOLVER_PREC= LU_SGS LINEAR_SOLVER_ERROR= 1E-6 LINEAR_SOLVER_ITER= 50 % -------------------------- MULTIGRID PARAMETERS -----------------------------% MGLEVEL= 0 MGCYCLE= V_CYCLE MG_PRE_SMOOTH= ( 3, 3, 3, 3 ) MG_POST_SMOOTH= ( 1, 1, 1, 1 ) MG_CORRECTION_SMOOTH= ( 0, 0, 0, 0 ) MG_DAMP_RESTRICTION= 0.8 MG_DAMP_PROLONGATION= 0.8

% ----------- SLOPE LIMITER AND DISSIPATION SENSOR DEFINITION -----------------%

MUSCL_FLOW= NO SLOPE_LIMITER_FLOW= VENKATAKRISHNAN MUSCL_TURB= NO SLOPE_LIMITER_TURB= VENKATAKRISHNAN MUSCL_ADJFLOW= NO SLOPE_LIMITER_ADJFLOW= VENKATAKRISHNAN MUSCL_ADJTURB= NO SLOPE_LIMITER_ADJTURB= VENKATAKRISHNAN VENKAT_LIMITER_COEFF= 0.05 ADJ_SHARP_LIMITER_COEFF= 3.0 LIMITER_ITER= 999999 LAX_SENSOR_COEFF= 0.15 JST_SENSOR_COEFF= ( 0.5, 0.02 ) ADJ_LAX_SENSOR_COEFF= 0.15 ADJ_JST_SENSOR_COEFF= ( 0.5, 0.02 )

% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % Convective numerical method (JST, JST_KE, JST_MAT, LAX-FRIEDRICH, CUSP, ROE, AUSM, % AUSMPLUSUP, AUSMPLUSUP2, AUSMPWPLUS, HLLC, TURKEL_PREC, % SW, MSW, FDS, SLAU, SLAU2, L2ROE, LMROE) CONV_NUM_METHOD_FLOW= LMROE

TIME_DISCRE_FLOW= EULER_IMPLICIT

% -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% CONV_NUM_METHOD_TURB= SCALAR_UPWIND TIME_DISCRE_TURB= EULER_IMPLICIT CFL_REDUCTION_TURB= 1.0

% ---------------- ADJOINT-FLOW NUMERICAL METHOD DEFINITION -------------------%

CONV_NUM_METHOD_ADJFLOW= JST TIME_DISCRE_ADJFLOW= EULER_IMPLICIT RELAXATION_FACTOR_ADJOINT= 1.0 CFL_REDUCTION_ADJFLOW= 0.8 LIMIT_ADJFLOW= 1E6

% --------------------------- CONVERGENCE PARAMETERS --------------------------% CONV_RESIDUAL_MINVAL= -10 CONV_STARTITER= 10 %CONV_FIELD= DRAG ,LIFT CONV_CAUCHY_ELEMS= 300 CONV_CAUCHY_EPS= 1E-5

% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% MESH_FILENAME= otype_mesh.su2 MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 SOLUTION_FILENAME= solution_flow SOLUTION_ADJ_FILENAME= solution_adj TABULAR_FORMAT= CSV CONV_FILENAME= history RESTART_FILENAME= restart_flow RESTART_ADJ_FILENAME= restart_adj VOLUME_FILENAME= flow VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad SURFACE_FILENAME= surface_flow SURFACE_ADJ_FILENAME= surface_adjoint OUTPUT_FILES= (RESTART, PARAVIEW, SURFACE_PARAVIEW) VOLUME_OUTPUT= (COORDINATES, SOLUTION, PRIMITIVE, RESIDUAL) HISTORY_OUTPUT= (ITER, LINSOL, RMS_RES, MAX_RES, AERO_COEFF, CFL_NUMBER) WRT_FORCES_BREAKDOWN= YES WRT_PERFORMANCE = YES SCREEN_WRT_FREQ_INNER= 10 OUTPUT_WRT_FREQ= 500 SCREEN_OUTPUT= (INNER_ITER, WALL_TIME, RMS_DENSITY, RMS_INTERMITTENCY, RMS_NU_TILDE, RMS_RE_THETA_T, RMS_TKE, RMS_DISSIPATION, LIFT, DRAG, LINSOL_ITER_TRANS, LINSOL_RESIDUAL_TRANS , RMS_MOMENTUM-X, RMS_MOMENTUM-Y, RMS_ENERGY) WRT_RESTART_COMPACT= NO `

Could you please point out:

The key parameters that most strongly influence the lift coefficient (CL) and drag coefficient (CD).

Which parameters are most sensitive for reducing or increasing drag, and which ones strongly influence lift (e.g. AOA, transition/turbulence, Reynolds number).

Any recommendations on which parameters I should not change unless I really know what I am doing (e.g. Sutherland constants, gas constants, etc.).

EngJamal2023 avatar Nov 14 '25 07:11 EngJamal2023

Hi @EngJamal2023 i am new here is it fine if i have a look onto this issue?

ShreyasN707 avatar Dec 01 '25 18:12 ShreyasN707

I came across this while looking into the LM transition model in SU2. The restart/adjoint interaction here is quite interesting, especially since the failure ultimately appears to be tied to the LM restart handling rather than the SST + LM configuration itself.

I also noticed the fix for the buffer overflow in LoadRestart and the follow-up regression test. This is really useful context for anyone trying to use LM in an optimization/adjoint workflow. Use opencode to solve this easily if anyone wants to work with su2 bugs

SiddDart avatar Aug 28 '26 16:08 SiddDart