How to couple Code_saturne and Salome

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Doug
Posts: 14
Joined: Fri Nov 15, 2019 10:07 pm

How to couple Code_saturne and Salome

Post by Doug »

Dear all,

I am trying to run a fluid-structure interaction of a flow over a cylinder using Code_Saturne, 6.0.0, and Aster, 2019. I would like to know how to configure the coupling using GUI. If it is not possible using GUI, how should I set the case?

I am attaching my case.

Thank you.

Cordially,

Douglas Fontes
Attachments
case.zip
(689.34 KiB) Downloaded 202 times
Yvan Fournier
Posts: 4077
Joined: Mon Feb 20, 2012 3:25 pm

Re: How to couple Code_saturne and Salome

Post by Yvan Fournier »

Hello,

I recently posted an example test case for this coupling here: viewtopic.php?f=12&p=14126#p14126.

I have only tested with Salome_Meca 2017, not the 2018 or 2019 version.

In any case, you need to build code_saturne using the --with-salome=<path_to_salome_meca> option, than setup a post-install option to indicate the path to the code_aster install directory.

Part of the setup (boundary conditions) can be done with the GUI, but launching the case is one directory higher.

In any case, this coupling is not validated, and coupling using YACS means we cannot start both codes in the same MPI command, but start them independently. That is fine for a workstation, but does not allow to define how the jobs are placed on a cluster. So basically this coupling is useless on a cluster.

A few users have managed to get it running, but it may be tricky...

In the development version (v6.1, soon to be released), I have replaced this coupling with a more lightweight system which should be able to use MPI correctly on clusters, and be simpler to set up, but on the code_aster side, there is still some Python wrapper/utility functions code which needs to be written either by a developer or an advanced user for this to work (volunteers with good knowledge of code_aster are welcome, and I can assist on the code_saturne side; the code_aster team will look into it but I do not know in which time frame).

Regards,

Yvan
Doug
Posts: 14
Joined: Fri Nov 15, 2019 10:07 pm

Re: How to couple Code_saturne and Salome

Post by Doug »

Hello Yvan,

Thank you so much for your response. I downloaded the test case, and I will try to obtain the first results on it.

When I have more news, I will post here.

Best regards,

Doug
Doug
Posts: 14
Joined: Fri Nov 15, 2019 10:07 pm

Re: How to couple Code_saturne and Salome

Post by Doug »

Hello Yvan,

I tried to run the test case you sent me. I was able to create the case folders, but there is a problem of different versions of hdf5. Could you please tell me how I can linked only one version of HDF5?

Thank you.
Attachments
preprocessor.log
(3.76 KiB) Downloaded 202 times
Yvan Fournier
Posts: 4077
Joined: Mon Feb 20, 2012 3:25 pm

Re: How to couple Code_saturne and Salome

Post by Yvan Fournier »

Hello,

To avoid issues, if installing code_saturne with salome_meca, use the HDF5 and MED libraries from salome_meca when configuring/installing code_saturne.

Best regards,

Yvan
Doug
Posts: 14
Joined: Fri Nov 15, 2019 10:07 pm

Re: How to couple Code_saturne and Salome

Post by Doug »

Hello,

Since you have released a new version (6.02) of code_saturne, I am installing this new version and using the libraries from salome_meca. However, when I try to launch an FSI case (code_sature create -c fluid --aster solid). Code_saturne is not finding Aster "Cannot locate Code_Aster installation". I tried to specify Aster path in the file code_saturne.cfg.template, but it seems this new version does not use this file.

This is the line command I used to configure code_saturne before make and make install:

../code_saturne-6.0.2/configure --with-salome=/home/user/salome_meca/V2019_univ --with-salome-gui=/home/user/salome_meca/V2019_univ/modules/GUI_V9_3_0 --with-salome-kernel=/home/user/salome_meca/V2019_univ/modules/KERNEL_V9_3_0 --with-hdf5=/home/user/salome_meca/V2019_univ/prerequisites/Hdf5-1103 --with-cgns=/home/user/salome_meca/V2019_univ/prerequisites/Cgnslib-331 --with-med=/home/user/salome_meca/V2019_univ/prerequisites/Medfichier-400 --with-metis=/home/user/salome_meca/V2019_univ/prerequisites/Metis-510 --with-scotch=/home/user/salome_meca/V2019_univ/prerequisites/Scotch-604

Again, thank you for your help.

Doug
Yvan Fournier
Posts: 4077
Joined: Mon Feb 20, 2012 3:25 pm

Re: How to couple Code_saturne and Salome

Post by Yvan Fournier »

Hello,

With Salome_MECA 2017, on my install, I used (in code_saturne.cfg, replacing <my_home> with your own path) :

aster = /home/<my_home>/salome_meca/V2017.0.2/tools/Code_aster_oldstable-1280

The file we tracked might have changed, but since you need to add the correct sub-path, you might simply be off by one directory.

The file that is searched for in the detection (see code_saturne's bin/cs_case_domain.py, line 1603) is the path you give in the code_saturne.cfg, plus 'share/aster/config.txt'.

If that has changed in code_aster, we may need to update that detection (sorry, I did not have the time to check yet with a more recent Salome_Meca version). Otherwise, that is the path you need to find in Salome_Meca to set the correct value.

Best regards,

Yvan
Doug
Posts: 14
Joined: Fri Nov 15, 2019 10:07 pm

Re: How to couple Code_saturne and Salome

Post by Doug »

Hello Yvan,

This was of great help! I inserted the Aster path in the code_saturne.cfg file. Now, I am able to create an FSI case.

However, when I tried to run the test case you published in the forum, "externecylindresconcentriques", some directories required to run do not exist:
Python directory /usr/local/lib/python3.6/site-packages/salome does not exist
share/salome directory /usr/local/share/salome does not exist

Do I need to specify something on Salome-meca as well?

Thank you.

Best regards,

Doug
Yvan Fournier
Posts: 4077
Joined: Mon Feb 20, 2012 3:25 pm

Re: How to couple Code_saturne and Salome

Post by Yvan Fournier »

Hello,

Normally, the code should source the detected Salome environment automatically, but the Python part might be a bit more subtle.

When installing code_saturne with Salome_Meca, a solution for this may be to:

- configure/make/make install code_saturne from within a "salome shell" session, adding "--with-shell-env to the code_saturne configure command as an added precaution.

- otherwise, when configuring code_saturne, add PYTHON=<path_to_salome_python> for finer-grained control; in this case, you must still have the Python libraries path in your LD_LIBRARY_PATH. Basically, this is a more fine-grained selection variant of the first solution.

Best regards,

Yvan
Doug
Posts: 14
Joined: Fri Nov 15, 2019 10:07 pm

Re: How to couple Code_saturne and Salome

Post by Doug »

Hello Yvan,

I configure code_saturne using "--with-shell-env", according to my config.log file. However, even doing so I had the same problem to run the runcase file from the externecylindresconcentriques case.

dfontes@cfal00:~/postDoc/Simulations/saturne/externecylindresconcentriques$ ./runcase
Coupling execution between:
o Code_Saturne [1 domain(s)];
o Code_Aster [1 domain(s)];


Code_Saturne
************

Version: 6.0
Path: /usr/local

Result directory:
/home/dfontes/postDoc/Simulations/saturne/externecylindresconcentriques/RESU_COUPLING/dbg


Parallel code_saturne on 2 processes.
Single processor Code_Aster simulation.


***************************
Preprocessing calculation
***************************

Creating YACS coupling scheme.
Configure parser: processing /usr/local/etc/salome/fsi_appli_config.xml ...
--- add module KERNEL /home/user/salome_meca/V2019.0.3_universal/modules/KERNEL_V9_3_0
link /home/dfontes/postDoc/Simulations/saturne/externecylindresconcentriques/RESU_COUPLING/dbg/appli/bin/salome/test/KERNEL --> /home/user/salome_meca/V2019.0.3_universal/modules/KERNEL_V9_3_0/bin/salome/test
--- add module GUI /home/user/salome_meca/V2019.0.3_universal/modules/GUI_smeca_gui
--- add module YACS /home/user/salome_meca/V2019.0.3_universal/modules/YACS_V9_3_0
link /home/dfontes/postDoc/Simulations/saturne/externecylindresconcentriques/RESU_COUPLING/dbg/appli/bin/salome/test/YACS --> /home/user/salome_meca/V2019.0.3_universal/modules/YACS_V9_3_0/bin/salome/test
--- add module FSI /usr/local
Python directory /usr/local/lib/python3.6/site-packages/salome does not exist
share/salome directory /usr/local/share/salome does not exist
WARNING: context file does not exist
WARNING: sha1 collections file does not exist

I really appreciate your help with this.

Thank you.
Attachments
config.log
(247.71 KiB) Downloaded 176 times
Post Reply