FEATool Multiphysics  v1.17.1
Finite Element Analysis Toolbox
SU2 CFD Solver

Along with OpenFOAM, the SU2 (Stanford University Unstructured) code is one of the more popular academic research and open-source Computational Fluid Dynamics (CFD) solvers. SU2 was initially developed for compressible flows and aerodynamic shape optimization but has since been extended to handle a wide range of flow problems [1]. The FEATool Multiphysics distribution includes the SU2 CFD solver with easy and convenient GUI and CLI interfaces allowing it to be used for simulation of laminar, turbulent, incompressible, and compressible types of flow problems.

Basic Use

The FEATool-SU2 external solver integration supports single physics models created with either the incompressible Navier-Stokes Equations or compressible inviscid Euler Equations.

To use SU2 for a model with one of these physics modes, press the toolbar button in Solve Mode, instead of the default solve button. This opens the SU2 solver settings and control dialog box.

Note that SU2 currently does not support models with multiple subdomains, or non-constant material parameters such as for example temperature dependent density and viscosity, the built-in and FEniCS multiphysics solvers can be used for these types of problems instead.

Control Panel

The SU2 solver settings dialog box and control panel allows one to automatically use SU2 to solve CFD problems.

In the lower control button panel the Solve button will start the automatic solution process with the chosen settings. This means that the following steps are performed in sequence

  1. Export - converts and exports the defined FEATool model and mesh to compatible SU2 mesh and configuration files
  2. Solve - performs a system/subprocess call to the selected SU2 solver and starts a monitoring process
  3. Import - interpolates and imports the computed solution back into FEATool for postprocessing and visualization

While the solution process is running the Stop button will halt/pause the solver and plot the current solution state, while the Cancel button terminates the solution process and discards the current solution (note that it can take some time for the solver register a halt event and to stop). If the Close automatically checkbox is marked, the SU2 control panel will be automatically closed after the solution process has finished, and FEATool will switch to Postprocessing Mode.

During the solution process one can also switch between the Log and Convergence tabs to see and monitor the solver output log and convergence plots in real-time. In the Convergence tab the error norm for the solution variables such as velocities, pressure, and turbulence quantities are plotted after each iteration and time step.

Export allows for exporting the SU2 configuration .cfg and mesh .su2 files for external manual processing and editing.

Solver Settings

The following solver parameters and settings can be modified and set through the SU2 dialog box and control panel.

Solver Type

Firstly, the Time discretization scheme and main solver type can be selected according to the given problem in the drop-down box. The following time schemes are available

  • Steady State
  • Time Stepping
  • Dual Time Stepping (1st order)
  • Dual Time Stepping (2nd order)

Initial Condition

Initial conditions can be specified as either constant or subdomain expressions for the solution variables using the Expression dialog box (equivalent to specifying the corresponding fields in the Subdomain Settings dialog box). Alternatively, if a previously computed Solution exists it can be used instead.

Simulation Settings

  • Iterations - specifies the maximum number of iterations (or time steps for time dependent simulations).
  • Time step - specifies the time step size.
  • End time - prescribes maximum time of the simulation.
  • Stopping criteria - specifies the stopping criteria for steady state simulations (log10).
  • Discretization - select finite volume (FVM) discretization scheme for convective fluxes.
  • Number of processors - selects the number of concurrent processes when running computations in parallel (defaults to the number of CPU cores/2)

Turbulence Settings

The Turbulence model drop-down box allow for selecting between the Spalart-Allmaras one-equation, k-Omega (SST) two-equation RANS turbulence models, as well as the default Laminar flow model. Note that SU2 currently do not include nor support wall functions or prescribing turbulence levels, if this is required the OpenFOAM solver can be used instead.

Command Line Use

The su2 function can be used instead of solvestat and solvetime to solve CFD problems with SU2 on the MATLAB command line (CLI). The following is an example of laminar steady flow in a channel solved with SU2

fea.sdim = {'x','y'};
fea.grid = rectgrid(50,10,[0,2.5;0,0.5]);
fea = addphys(fea,@navierstokes);
fea.phys.ns.eqn.coef{1,end} = { 1 };
fea.phys.ns.eqn.coef{2,end} = { 1e-3 };
fea.phys.ns.bdr.sel(4) = 2;
fea.phys.ns.bdr.coef{2,end}{1,4} = '2/3*0.3';
fea.phys.ns.bdr.sel(2) = 4;
fea = parsephys(fea);
fea = parseprob(fea);

% Alternative to calling: fea.sol.u = solvestat( fea );

fea.sol.u = su2( fea );

postplot(fea,'surfexpr','sqrt(u^2+v^2)')

The model parameters used here are taken from the ex_navierstokes1 example script model. The m-script examples listed in the SU2 tutorials section similarly allow for using the SU2 solver instead of the default solver. Furthermore, the su2 function can also be embedded in user-defined custom m-scripts, which can use all other MATLAB functions and toolboxes.

Advanced Use

The SU2 solver is capable of performing large scale parallel simulations on HPC clusters, and although technically possible to use FEATool Multiphysics to do this, for memory and stability reasons it is not advised to do this from within MATLAB.

For larger simulations it is recommended to export CFD models with the su2 export command or Export button in the SU2 Settings dialog box. This will generate SU2 configuration .cfg and mesh .su2 files. Then one can manually launch the SU2 solver the system command line, and import the solution back into the FEATool GUI when the solution has finished.

Tutorials

The majority of the fluid dynamics tutorials available in the File > Model Examples and Tutorials... > Fluid Dynamics menu also allow for using SU2 instead of the default CFD solver.

The following m-script models, found in the in the examples directory of the FEATool installation folder, feature a 'solver', su2' input parameter which can be used to directly enable the SU2 solver

Installation

The SU2 solver binaries are included with the FEATool multiphysics distribution. However, for parallel computations one must install the Message Passing Interface (MPI) separately. It is recommended to use Microsoft MPI for Windows systems, and MPICH for Linux and MacOS systems.

Further Information

Further information about SU2 and its usage can be found on the official SU2 homepage and SU2 documentation.

References

[1] SU2: An Open-Source Suite for Multiphysics Simulation and Design, AIAA Journal, 54(3):828-846, 2016.

[2] SU2 Official Source Code Repository, GitHub, 2020.