FEATool Multiphysics
v1.17.1
Finite Element Analysis Toolbox
|
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.
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.
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
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.
The following solver parameters and settings can be modified and set through the SU2 dialog box and control panel.
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
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.
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.
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.
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.
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
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 about SU2 and its usage can be found on the official SU2 homepage and SU2 documentation.
[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.