Skip to content
README.md 5.31 KiB
Newer Older
# Code_Saturne

Charles Moulinec's avatar
Charles Moulinec committed
Code_Saturne is an open-source multi-purpose CFD software, primarily developed by EDF R&D and maintained by them. It relies on the Finite Volume method and a collocated arrangement of unknowns to solve the Navier-Stokes equations, for incompressible or compressible flows, laminar or turbulent flows and non-Newtonian and Newtonian fluids. A new discretisation based on the Compatible Discrete Operator (CDO) approach can be used for some physics. A highly parallel coupling library (Parallel Locator Exchange - PLE) is also available in the distribution to couple other software with different physics, such as for conjugate heat transfer and structural mechanics. For the incompressible solver, the pressure is solved using an integrated Algebraic Multi-Grid algorithm and the scalars are computed by conjugate gradient methods or Gauss-Seidel/Jacobi.
Charles Moulinec's avatar
Charles Moulinec committed
The original version of the code is written in C for pre-/post-processing, IO handling, parallelisation handling, linear solvers and gradient computation, and Fortran 95 for some of the physics-related implementation. Python is used to manage the simulations. MPI is used on distributed memory machines and OpenMP pragmas have been added to the most costly parts of the code to be used on shared memory architecture. The version used in this work relies on external libraries (AMGx - PETSc) to take advantage of potential GPU acceleration.
Charles Moulinec's avatar
Charles Moulinec committed
The equations are solved iteratively using time-marching algorithms, and most of the time spent during a time step is due to the computation of the velocity-pressure coupling, for simple physics. For this reason, the two test cases chosen for the benchmark suite have been designed to assess the velocity-pressure coupling computation, and rely on the same configuration, the 3-D lid-driven cavity, using tetrahedral cell meshes. The first case mesh contains over 13 million cells. The second test case is modular in the sense that mesh multiplication can be used to on-the-fly increase the mesh size.
Charles Moulinec's avatar
Charles Moulinec committed
## Building Code_Saturne v7.0.0
Charles Moulinec's avatar
Charles Moulinec committed
The version 7.0.0 of Code_Saturne is to be found [here](https://www.code-saturne.org/cms/sites/default/files/releases/code_saturne-7.0.0.tar.gz).

Charles Moulinec's avatar
Charles Moulinec committed
A simple installer [_InstallHPC.sh_]() is made available for this version.

An example of the last lines of the installer (meant for the GNU compiler & MPI in this example) reads:\

$KERSRC/configure \\ \
--disable-shared \\ \
--enable-openmp \\ \
--without-modules \\ \
--disable-rpath \\ \
--disable-dlloader \\ \
--disable-gui \\ \
--disable-sockets \\ \
--enable-long-gnum \\ \
--disable-mei \\ \
--prefix=$KEROPT \\ \
CC=mpicc FC=gfortran CXX=mpicxx CFLAGS="-O3" FCFLAGS="-O3" CXXFLAGS="-O3" \
\# \
make -j 8 \
make install

CC, FC, CFLAGS, FCFLAGS, LDFLAGS and LIBS might have to be tailored for your machine, compilers, MPI installation, etc.
More information concerning the options can be found by typing: ./configure --help

To install the code, type, assuming that Y_P is the path where CS_7.0.0_PRACE_UEABS was copied:

cd Y_P/ CS_7.0.0_PRACE_UEABS \
./InstallHPC.sh

When the code is installed the command **code_saturne** should return, when typing:\
Y_P/CS_7.0.0_PRACE_UEABS/code_saturne-7.0.0/arch/Linux/bin/code_saturne

Usage: ./code_saturne <topic>

Topics: \
  help \
  studymanager \
  smgr \
  bdiff \
  bdump \
  compile \
  config \
  cplgui \
  create \
  gui \
  parametric \
  studymanagergui \
  smgrgui \
  trackcvg \
  update \
  up \
  info \
  run \
  submit \
  symbol2line

Options: \
  -h, --help  show this help message and exit


## Preparing a simulation. Example of CAVITY_13M
Two archives are used, namely **CS_7.0.0_PRACE_UEABS_CAVITY_13M.tar.gz** and **CS_7.0.0_PRACE_UEABS_CAVITY_XXXM.tar.gz** that contain the information required to run both test cases, with the mesh_input file (for the mesh) and the usersubroutines in _src_.

From the working directory WORKDIR (pick another one than CS_7.0.0_PRACE_UEABS), a ‘study’ has to be created (Cavity13M, for instance) as well as a ‘case’ (MACHINE, for instance) as:

Y_P/CS_7.0.0_PRACE_UEABS/code_saturne-7.0.0/arch/Linux/bin/code_saturne create --study Cavity13M MACHINE --copy-ref

The **Cavity13M** directory contains 3 directories, MACHINE, MESH and POST.

The directory **MACHINE** contains 3 directories, DATA, RESU and SRC.

The file mesh_input should be copied into the MESH directory.

The user subroutines (cs_user* files) contained in _src_ should be copied into SRC.

The file _cs_user_scripts.py_ is used to manage the simulation. It has to be copied to DATA as:
cd DATA
cp REFERENCE/cs_user_scripts.py .
At Line 87 of this file, you need to change from None to the local path of the mesh, i.e. "../MESH/mesh_input”

To finalise the preparation go to the folder MACHINE and type:
Y_P/CS_7.0.0_PRACE_UEABS/code_saturne-7.0.0/arch/Linux/bin/code_saturne run --initialize

This should create a folder RESU/YYYYMMDD-HHMM, which should contain the following flles:
- cs_user_scripts.py
- src
- cs_solver
- compile.log
- mesh_input
- summary
- run_solver

## Running Code_Saturne v7.0.0
The name of the executable is ./cs_solver and, the code should be run as mpirun/mpiexec/poe/aprun/... .......... ./cs_solver

## The test cases are to be found under:
https://repository.prace-ri.eu/ueabs/Code_Saturne/2.1/CS_5.3_PRACE_UEABS_CAVITY_111M.tar.gz  
https://repository.prace-ri.eu/ueabs/Code_Saturne/2.1/CS_5.3_PRACE_UEABS_CAVITY_13M.tar.gz