Guide to couple Saturne & SYRTHES
Posted: Mon Mar 17, 2014 4:28 pm
Saturne 3.2 coupled with syrthes 4.1.1 under Ubuntu 12.04 LTS
Preparing your Ubuntu distro:
Install Ubuntu 12.04
run updates, remember to activate the option "not supported updates (precise-backports)" and reboot
from Software Center install : Synaptic package manager
from Synaptic package manager install : nautilus-open-terminal
Restart Nautilus : open a terminal (ctrl+alt+t) = killall nautilus
Now if you right-click on a folder you can launch the terminal directly into the folder (avoiding the boring part of typing cd /...)
Saturne and Syrthes libraries
from synaptic install in order (including subpackets required)
[NB: this list may be outdated due the subsequenting version and some files may be old/unuseful, if you have problem compiling saturne or syrthes be sure to have all of this libraries with their upgraded version installed]
g++
gfortran
libqwt5-qt4
libqwt5-qt4-dev
pyqt4-dev-tools
python-qt4-dev
zlib1g
zlib1g-dev
mpi-default-bin
mpi-default-dev
libblas-dev
libxml2-dev
libscotchparmetis-dev
ptscotch
libscotch-dev
libptscotch-dev
libhdf5-openmpi-dev
h5utils
hdf5-tools
libcgns-dev (ver 3.1 or superior)
cgns-convert
libmed-dev
libmedc-dev
libmedimport-dev
cmake
make
flex
libicu-dev
lib32icu48
libcppunit
Libxml++2.6-dev
libglibmm-2.4-dev
libglib2.0-dev
libglib2.0-bin
libglib2.0-0
automake
automake1.10
autotools-dev
pkg-config
If you have a problem with libcgns-dev from synaptic you have to add the followers repository:
deb http://it.archive.ubuntu.com/ubuntu/ quantal main universe restricted multiverse
deb http://security.ubuntu.com/ubuntu quantal-security main universe restricted multiverse
deb http://it.archive.ubuntu.com/ubuntu/ quantal-updates main universe restricted multiverse
deb http://it.archive.ubuntu.com/ubuntu quantal-backports main restricted universe multiverse
deb http://archive.canonical.com/ubuntu quantal partner
Preparing Saturne 3.2 Environment
Download Code_Saturne 3.2 extract the content in your home folder (/home/user/) where user is your ubuntu username.
create a folder in /home/user/CS3.2 , we will compile saturne here. It’s always nice to have saturne compiled in a different directory than the extracted one.
Install Syrthes
Download 4 syrthes4.1.1 packages from the EDF site http://chercheurs.edf.com/logiciels/syr ... 80982.html
download the files for Ubuntu and put them in a folder.
you should have 4 file named:
sytrhes4.1.1-ubuntu.tgz.part00.zip
sytrhes4.1.1-ubuntu.tgz.part01.zip
sytrhes4.1.1-ubuntu.tgz.part02.zip
sytrhes4.1.1-ubuntu.tgz.part03.zip
now open a terminal in that folder and enter (check on the edf site the right commands/version)
gunzip -S .zip syrthes4.1.1-ubuntu.tgz.part*.zip
cat syrthes4.1.1-ubuntu.tgz.part* >> syrthes4.1.1-ubuntu.tgz
tar xvfz syrthes4.1.1-ubuntu.tgz
At the end you should have a folder “syrthes4.1.1-ubuntu”. Put it in your /home/user
edit the file setup.ini that is placed in /home/user/syrthes4.1.1-ubuntu/src/syrthes-install/
SYRTHES will compile all the needed libraries in his folder.
You have to change the setup.ini for ple and the blas at the end of the file (needed later for coupling):
blas USE=yes PATH=/usr
ple USE=yes PATH=/home/user/CS3.2/libple
syrthescfd INSTALL=yes
Now open a terminal in /home/user/syrthes4.1.1-ubuntu/src/syrthes-install/ and type:
python syrthes_install.py
At the end you have succesfully installed syrthes4.1.1.
ATTENTION
If you have problem telling the “ple” part you can compile Syrthes the first time without ple THEN after installing code_saturne RECOMPILE Syrthes with the ple option as explained before
ATTENTION
If you have problem/errors with the MED libraries compiling change the setup.ini to use the med in the SALOME directory (SALOME is a pre-post processor, very adviced to work with these softwares)
med USE=yes PATH=/home/user/salome_7.3.0/med-3.0.7
Compile Saturne3.2
You have to set the main libreries (cgns, hdf5,med,mpi) synched with SYRTHES. The best way is to reuse the libraries that SYRTHES uses.
Open a terminal in /home/user/CS3.2 and write
/home/user/ code_saturne-3.2.2 /configure + instructions on where to find libraries
EXAMPLES
Tell to saturne where SYRTHES is.
configure --with-mpi=/home/user/syrthes4.1.1-ubuntu/extern-libraries/opt/openmpi-1.4.3/arch/Linux_x86_64
Other libraries useful to link between the 2 softwares.
--with-metis=PATH --with-scotch=PATH --with-hdf5=PATH --with-cgns=PATH --with-med=PATH --with-med=PATH
You need hdf5-1.8.10 !! A good way is to find most of the librariers except for mpi inside the SALOME folder ( SALOME is the multiplatform preprocessor)
configure --with-mpi=/home/user/syrthes4.1.1-ubuntu/extern-libraries/opt/openmpi-1.4.3/arch/Linux_x86_64 --with-metis=/home/user/syrthes4.1.1-ubuntu/extern-libraries/opt/metis-5.0.2/arch/Linux_x86_64 --with-scotch=/home/user/syrthes4.1.1-ubuntu/extern-libraries/opt/scotch_5.1.12b/arch/Linux_x86_64 --with-hdf5=/home/user/salome_7.3.0/hdf5-1.8.10 --with-med=/home/user/salome_7.3.0/med-3.0.7
if your ending lines are like these ( or similar depending on what you need) :
Zlib (gzipped file) support: yes
MPI (Message Passing Interface) support: yes
MPI I/O support: yes
MPI2 one-sided communication support: yes
OpenMP support: no
BLAS (Basic Linear Algebra Subprograms) support: yes
Libxml2 (XML Reader) support: yes
ParMETIS (Parallel Graph Partitioning) support: no
PT-SCOTCH (Parallel Graph Partitioning) support: yes
ADF support: no
CCM support: no
HDF (Hierarchical Data Format) support: yes
CGNS (CFD General Notation System) support: yes
MED (Model for Exchange of Data) support: yes
MED MPI I/O support: no
MEDCoupling support: no
SALOME GUI support: yes
SALOME Kernel support: no
Dynamic loader support (for YACS): yesSYRTHES 3 coupling support: no
Warning: CGNS version used is 2.5, which is deprecated.
in future versions, CGNS >= 3.1 will be required.
you can now enter (it may take long) :
make
and next, remember to be su (sudo) :
sudo make install
Congratulations you succesfully installed Code_Saturne3.2
LINK TOGETHER SYRTHES AND CODE_SATURNE
Go to /usr/local/etc and open a terminal
sudo gedit code_saturne.cfg
now you simply put these 3 lines in your file:
[install]
syrthes = /home/user/syrthes4.1.1-ubuntu/arch/Linux_x86_64
[run]
save and exit.
How to create a coupled case
Open a terminal (ctrl+alt+t) and digit:
code_saturne create -s studyname -c fluid --syrthes=solid
now in your home directory you can find the directory studyname.
Put your meshes in the MESH folder, then you can edit by gui both your CFD domain opening a
terminal in /home/user/studyname/fluid/DATA/ and running:
./SaturneGUI
create a new file and setup your CFD case.
Than for the SYRTHES part open a terminal (ctrl+alt+t) and source :
source /home/user/syrthes4.1.1-ubuntu/arch/Linux_x86_64/bin/syrthes.profile
then:
syrthes.gui
create a new data file (.syd) inside the “solid” folder of your study folder
After setting both fluid and solid domain launch the case running from
./runcase_coupling
from a terminal in /home/user/studyname/
REMEMBER
You have to edit the runcase_coupling telling the name of the .syd file, the number of cpus for each domain (fluid/solid) and the total number of cpu’s. By default the simulation will run with 1-1 cpu.
MPI BUG FIX (optional)
Now the last step, you have to edit :
/home/user/syrthes4.1.1-ubuntu/arch/Linux_x86_64/share/syrthes/syrthes.py
at the line 1391 we have to define manually s4bin and s4home, change line 1391 and 1392 as it follows :
s4bin = '/home/user/syrthes4.1.1-ubuntu/arch/Linux_x86_64/bin'
s4home = '/home/user/syrthes4.1.1-ubuntu/arch/Linux_x86_64'
save and exit
ATTENTION
It may happen that a simulation won’t start due to :
syrthes: syr_cfd_coupling.c:1183: _interpolation_init: Assertion `ple_locator_get_n_exterior(ip->locator) == 0' failed.
You can however by-pass the problem using a saturne c routine which is called cs_user_coupling.c
then specify the coupling between Code_Saturne and SYRTHES there, and then you activate
the option
bool allow_non_matching = true;
This should cope with meshes that are not fully coincident between solid and fluid (bringing you some flexibility) !
Warning: if you specify the coupling through the c code, make sure you do not specify it through the GUI any more (otherwise you would specify two coupling at the same location and this would induce not very pleasant behaviour)
This tutorial has been written by Andrea “pisolino” (andrea.pisa@polito.it) and Andrea “biko86” (andrea.colosimo@polito.it) fellowship researchers for Politecnico di Torino Italy, collecting all the tips and helps inside the forum http://code-saturne.org/forum.
A special thank to Yvan Fournier and Christophe Peniguel for all the support, without them this guide wouldn’t have been written.
Feel free to improve this step by step guide and sorry for our poor english.
Preparing your Ubuntu distro:
Install Ubuntu 12.04
run updates, remember to activate the option "not supported updates (precise-backports)" and reboot
from Software Center install : Synaptic package manager
from Synaptic package manager install : nautilus-open-terminal
Restart Nautilus : open a terminal (ctrl+alt+t) = killall nautilus
Now if you right-click on a folder you can launch the terminal directly into the folder (avoiding the boring part of typing cd /...)
Saturne and Syrthes libraries
from synaptic install in order (including subpackets required)
[NB: this list may be outdated due the subsequenting version and some files may be old/unuseful, if you have problem compiling saturne or syrthes be sure to have all of this libraries with their upgraded version installed]
g++
gfortran
libqwt5-qt4
libqwt5-qt4-dev
pyqt4-dev-tools
python-qt4-dev
zlib1g
zlib1g-dev
mpi-default-bin
mpi-default-dev
libblas-dev
libxml2-dev
libscotchparmetis-dev
ptscotch
libscotch-dev
libptscotch-dev
libhdf5-openmpi-dev
h5utils
hdf5-tools
libcgns-dev (ver 3.1 or superior)
cgns-convert
libmed-dev
libmedc-dev
libmedimport-dev
cmake
make
flex
libicu-dev
lib32icu48
libcppunit
Libxml++2.6-dev
libglibmm-2.4-dev
libglib2.0-dev
libglib2.0-bin
libglib2.0-0
automake
automake1.10
autotools-dev
pkg-config
If you have a problem with libcgns-dev from synaptic you have to add the followers repository:
deb http://it.archive.ubuntu.com/ubuntu/ quantal main universe restricted multiverse
deb http://security.ubuntu.com/ubuntu quantal-security main universe restricted multiverse
deb http://it.archive.ubuntu.com/ubuntu/ quantal-updates main universe restricted multiverse
deb http://it.archive.ubuntu.com/ubuntu quantal-backports main restricted universe multiverse
deb http://archive.canonical.com/ubuntu quantal partner
Preparing Saturne 3.2 Environment
Download Code_Saturne 3.2 extract the content in your home folder (/home/user/) where user is your ubuntu username.
create a folder in /home/user/CS3.2 , we will compile saturne here. It’s always nice to have saturne compiled in a different directory than the extracted one.
Install Syrthes
Download 4 syrthes4.1.1 packages from the EDF site http://chercheurs.edf.com/logiciels/syr ... 80982.html
download the files for Ubuntu and put them in a folder.
you should have 4 file named:
sytrhes4.1.1-ubuntu.tgz.part00.zip
sytrhes4.1.1-ubuntu.tgz.part01.zip
sytrhes4.1.1-ubuntu.tgz.part02.zip
sytrhes4.1.1-ubuntu.tgz.part03.zip
now open a terminal in that folder and enter (check on the edf site the right commands/version)
gunzip -S .zip syrthes4.1.1-ubuntu.tgz.part*.zip
cat syrthes4.1.1-ubuntu.tgz.part* >> syrthes4.1.1-ubuntu.tgz
tar xvfz syrthes4.1.1-ubuntu.tgz
At the end you should have a folder “syrthes4.1.1-ubuntu”. Put it in your /home/user
edit the file setup.ini that is placed in /home/user/syrthes4.1.1-ubuntu/src/syrthes-install/
SYRTHES will compile all the needed libraries in his folder.
You have to change the setup.ini for ple and the blas at the end of the file (needed later for coupling):
blas USE=yes PATH=/usr
ple USE=yes PATH=/home/user/CS3.2/libple
syrthescfd INSTALL=yes
Now open a terminal in /home/user/syrthes4.1.1-ubuntu/src/syrthes-install/ and type:
python syrthes_install.py
At the end you have succesfully installed syrthes4.1.1.
ATTENTION
If you have problem telling the “ple” part you can compile Syrthes the first time without ple THEN after installing code_saturne RECOMPILE Syrthes with the ple option as explained before
ATTENTION
If you have problem/errors with the MED libraries compiling change the setup.ini to use the med in the SALOME directory (SALOME is a pre-post processor, very adviced to work with these softwares)
med USE=yes PATH=/home/user/salome_7.3.0/med-3.0.7
Compile Saturne3.2
You have to set the main libreries (cgns, hdf5,med,mpi) synched with SYRTHES. The best way is to reuse the libraries that SYRTHES uses.
Open a terminal in /home/user/CS3.2 and write
/home/user/ code_saturne-3.2.2 /configure + instructions on where to find libraries
EXAMPLES
Tell to saturne where SYRTHES is.
configure --with-mpi=/home/user/syrthes4.1.1-ubuntu/extern-libraries/opt/openmpi-1.4.3/arch/Linux_x86_64
Other libraries useful to link between the 2 softwares.
--with-metis=PATH --with-scotch=PATH --with-hdf5=PATH --with-cgns=PATH --with-med=PATH --with-med=PATH
You need hdf5-1.8.10 !! A good way is to find most of the librariers except for mpi inside the SALOME folder ( SALOME is the multiplatform preprocessor)
configure --with-mpi=/home/user/syrthes4.1.1-ubuntu/extern-libraries/opt/openmpi-1.4.3/arch/Linux_x86_64 --with-metis=/home/user/syrthes4.1.1-ubuntu/extern-libraries/opt/metis-5.0.2/arch/Linux_x86_64 --with-scotch=/home/user/syrthes4.1.1-ubuntu/extern-libraries/opt/scotch_5.1.12b/arch/Linux_x86_64 --with-hdf5=/home/user/salome_7.3.0/hdf5-1.8.10 --with-med=/home/user/salome_7.3.0/med-3.0.7
if your ending lines are like these ( or similar depending on what you need) :
Zlib (gzipped file) support: yes
MPI (Message Passing Interface) support: yes
MPI I/O support: yes
MPI2 one-sided communication support: yes
OpenMP support: no
BLAS (Basic Linear Algebra Subprograms) support: yes
Libxml2 (XML Reader) support: yes
ParMETIS (Parallel Graph Partitioning) support: no
PT-SCOTCH (Parallel Graph Partitioning) support: yes
ADF support: no
CCM support: no
HDF (Hierarchical Data Format) support: yes
CGNS (CFD General Notation System) support: yes
MED (Model for Exchange of Data) support: yes
MED MPI I/O support: no
MEDCoupling support: no
SALOME GUI support: yes
SALOME Kernel support: no
Dynamic loader support (for YACS): yesSYRTHES 3 coupling support: no
Warning: CGNS version used is 2.5, which is deprecated.
in future versions, CGNS >= 3.1 will be required.
you can now enter (it may take long) :
make
and next, remember to be su (sudo) :
sudo make install
Congratulations you succesfully installed Code_Saturne3.2
LINK TOGETHER SYRTHES AND CODE_SATURNE
Go to /usr/local/etc and open a terminal
sudo gedit code_saturne.cfg
now you simply put these 3 lines in your file:
[install]
syrthes = /home/user/syrthes4.1.1-ubuntu/arch/Linux_x86_64
[run]
save and exit.
How to create a coupled case
Open a terminal (ctrl+alt+t) and digit:
code_saturne create -s studyname -c fluid --syrthes=solid
now in your home directory you can find the directory studyname.
Put your meshes in the MESH folder, then you can edit by gui both your CFD domain opening a
terminal in /home/user/studyname/fluid/DATA/ and running:
./SaturneGUI
create a new file and setup your CFD case.
Than for the SYRTHES part open a terminal (ctrl+alt+t) and source :
source /home/user/syrthes4.1.1-ubuntu/arch/Linux_x86_64/bin/syrthes.profile
then:
syrthes.gui
create a new data file (.syd) inside the “solid” folder of your study folder
After setting both fluid and solid domain launch the case running from
./runcase_coupling
from a terminal in /home/user/studyname/
REMEMBER
You have to edit the runcase_coupling telling the name of the .syd file, the number of cpus for each domain (fluid/solid) and the total number of cpu’s. By default the simulation will run with 1-1 cpu.
MPI BUG FIX (optional)
Now the last step, you have to edit :
/home/user/syrthes4.1.1-ubuntu/arch/Linux_x86_64/share/syrthes/syrthes.py
at the line 1391 we have to define manually s4bin and s4home, change line 1391 and 1392 as it follows :
s4bin = '/home/user/syrthes4.1.1-ubuntu/arch/Linux_x86_64/bin'
s4home = '/home/user/syrthes4.1.1-ubuntu/arch/Linux_x86_64'
save and exit
ATTENTION
It may happen that a simulation won’t start due to :
syrthes: syr_cfd_coupling.c:1183: _interpolation_init: Assertion `ple_locator_get_n_exterior(ip->locator) == 0' failed.
You can however by-pass the problem using a saturne c routine which is called cs_user_coupling.c
then specify the coupling between Code_Saturne and SYRTHES there, and then you activate
the option
bool allow_non_matching = true;
This should cope with meshes that are not fully coincident between solid and fluid (bringing you some flexibility) !
Warning: if you specify the coupling through the c code, make sure you do not specify it through the GUI any more (otherwise you would specify two coupling at the same location and this would induce not very pleasant behaviour)
This tutorial has been written by Andrea “pisolino” (andrea.pisa@polito.it) and Andrea “biko86” (andrea.colosimo@polito.it) fellowship researchers for Politecnico di Torino Italy, collecting all the tips and helps inside the forum http://code-saturne.org/forum.
A special thank to Yvan Fournier and Christophe Peniguel for all the support, without them this guide wouldn’t have been written.
Feel free to improve this step by step guide and sorry for our poor english.