This is the 2D version. For 3D, click here.
This is the Matlab version. For Julia, click here.
-
MATLAB is required, but no specific toolboxes. The code has been tested succesfully under Octave in the past (no guarantees).
-
Run one of the existing case files by typing
main('casename')
, e.g.main('LDC')
to run the lid-driven cavity test case -
In general, in order to run simulations: create a folder in the case_files directory, preferably by copying an existing folder. The files present in this folder should be at least
- parameters
- IC (initial conditions)
- BCtype (type of boundary conditions)
- uBC and vBC (boundary condition values)
- mesh
and optionally:
- pp (postprocessing)
- rtp (real time plot)
- force (body force)
- duBCdt and dvBCdt (time-derivative of boundary conditions)
- energy-conserving convection
- second order and fourth order spatial discretization, paper
- staggered cartesian grid (uniform or non-uniform)
- general boundary conditions, including wall, inflow, periodic, outflow, symmetry
- body forces: actuator methods and immersed boundary method (also: moving actuators and adapted RK time integration)
- turbulence with RANS-like models, e.g. algebraic eddy viscosity model and k-epsilon model
- turbulence with regularization modeling
- time integration methods:
- pressure solver: direct (LU), preconditioned CG, or fast Fourier.
- steady solver solves the entire non-linear saddlepoint system with mixed Picard / Newton for RANS solution of fully coupled system (u,v,p,k,e) this is in general slow and convergence is not guaranteed; better to use unsteady time-stepping to steady state
- energy-conserving reduced order modeling (ROM) in POD-Galerkin framework, paper
- pressure-free
- precomputation of operators including projection of boundary vectors
There are different ways to get results out of the code.
- use the syntax
[V,p,options]=main('testcase');
to get the velocity and pressure at the end of the simulation. Useful when the code is called several times from another script, but returns only velocity and pressure (plus code settings given inoptions
). - use the
save_
options in the parameter file to determine output writing; in this way a new folder in the results folder is created for each run, for example with all time-dependent data and convergence information. Useful for detailed analysis of a testcase with different parameter settings. - use the realtimeplotting (rtp) file (executed after each time step). Useful for example to make movies.
- use the postprocessing file (executed at the end of the simulation). Useful to generate paper-ready plots for a given testcase.
To compare with previously obtained benchmark data, use:
run_testsuite('case_name')
orrun_testsuite({'case_name1','case_name2'})