How to couple Code_saturne and Salome

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: How to couple Code_saturne and Salome

Post by Yvan Fournier »

Hello,

We're getting there. The disconnect is not clean, but that is probably OK, though ugly.

The code_aster log indicates that the total memory allocated to the code_aster job is 30 Mb, and at least 990 or so Mb are required. I think I had that message at a time, and the parametrization for that is in the fsi.export file. I am no sure it is the "mem aster "or "memjeveux" which is important, but by the error message I would guess at the second one. Is the fsi.export referenced correctly in the coupling_parameters.py ? Might it have changed between code_aster versions ? Or do you simply need to increase it ? I might have forgotten to updte it in the reference case after changing it in a local run directory..

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 »

Hi Yvan,

Yes, we are almost there.

I increased the memjob to 1537000 and this was enough to avoid disconnect problems. However, now I am having a problem with
Execution problem: Salome Exception occurredTraceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/salome/FSI_ASTER_module.py", line 140, in op0117
raise ExecutionError("Error in initial execution")
FSI_ASTER_module.ExecutionError: Error in initial execution
The fsi.export is correctly referenced in coupling_parameters.py

I am sending you the log files and my case as it is now. I think we are getting there.

Thank you.

Cordially,

Doug
Attachments
127738_FSI_SATURNE_0x5642531de3f0_localhost_dfontes_127700.log
(1.7 MiB) Downloaded 181 times
127738_FSI_ASTER_0x5642531d0cc0_localhost_dfontes_127700.log
(200.08 KiB) Downloaded 174 times
test.zip
(2.77 MiB) Downloaded 164 times
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: How to couple Code_saturne and Salome

Post by Yvan Fournier »

Hello,

The code_aster log (solid.mess) seems to indicate some error interpreting the CALC_IFS_DNL command, which is the code_aster command specific to the FSI coupling:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Erreur dans la macro CALC_IFS_DNL !
! Traceback (most recent call last): !
! File "/home/user/salome_meca/V2019.0.3_universal/tools/ !
! Code_aster_stable-v144_smeca/lib/aster/Build/B_MACRO_ETAPE.py", line 114, in !
! _Build !
! ier = self.definition.proc(*(self,), **d) !
! File "/home/user/salome_meca/V2019.0.3_universal/tools/ !
! Code_aster_stable-v144_smeca/lib/aster/Noyau/N_OPS.py", line 35, in __call__ !
! return func(*args, **kwargs) !
! File "/home/user/salome_meca/V2019.0.3_universal/tools/ !
! Code_aster_stable-v144_smeca/lib/aster/Macro/calc_ifs_dnl_ops.py", line 374, in !
! calc_ifs_dnl_ops !
! **poidsMocle) !
! File "/home/user/salome_meca/V2019.0.3_universal/tools/ !
! Code_aster_stable-v144_smeca/lib/aster/Noyau/N_OPER.py", line 134, in __call__ !
! return etape.Build_sd(nomsd) !
! File "/home/user/salome_meca/V2019.0.3_universal/tools/ !
! Code_aster_stable-v144_smeca/lib/aster/Noyau/N_ETAPE.py", line 157, in Build_sd !
! self.Execute() !
! File "/home/user/salome_meca/V2019.0.3_universal/tools/ !
! Code_aster_stable-v144_smeca/lib/aster/Execution/E_ETAPE.py", line 249, in !
! Execute !
! cr = self.report() !
! File "/home/user/salome_meca/V2019.0.3_universal/tools/ !
! Code_aster_stable-v144_smeca/lib/aster/Validation/V_ETAPE.py", line 290, in !
! report !
! self.isvalid(cr='oui') !
! File "/home/user/salome_meca/V2019.0.3_universal/tools/ !
! Code_aster_stable-v144_smeca/lib/aster/Validation/V_ETAPE.py", line 162, in !
! isvalid !
! valid = self.update_sdprod(cr) !
! File "/home/user/salome_meca/V2019.0.3_universal/tools/ !
! Code_aster_stable-v144_smeca/lib/aster/Validation/V_ETAPE.py", line 219, in !
! update_sdprod !
! for k in orig[0].split("|"): !
! IndexError: list index out of range
While the code_saturne computation seems OK at first, and messages seem exchanged, except the number of values read seems incorrect starting from the first read of DEPAST(a hugely negative value, looking line an overflow, uninitialized value, or pointer to a wrong variable). When checking in the YACS logs, we have, starting for DEPAST (displacements computed by code_aster):
DSC_Exception : CP_ARRET directive interrupts all further data reading
From there on, the displacements fluid keeps running where it should stop, but values are unusable.
I guess this is related to the error on the code_aster side.

I do not know how to fix the error on the code_aster side. Adding a few print statements in code_aster Python code based on the CALC_IFS_DNL backtrace may help, but this is the first time I see this error. Perhaps it is a simple Python 2 to 3 conversion issue (as this code is outside the scope of the code_aster validation), or some deeper issue, but this operator seemed to work in code_aster 12. If it is just a Python 2 to 3 issue, it should probably not be too difficult to fix (so I would start with a few simple print statements there to check what is going on). Otherwise, it may be necessary to ask for help on the code_aster side.

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,

First of all, thank you so much for your support so far.

I really tried to debug and find a solution for the coupling, however, I could not go further. I uploaded the log files as well as my test case again. I would appreciate it if you (or anyone else) could take one more look at this case for me. If not, I understand. We did not receive fast feedback from the guys of Salome-Meca.

Thanks,

Doug
Attachments
testCase.zip
(2.85 MiB) Downloaded 165 times
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: How to couple Code_saturne and Salome

Post by Yvan Fournier »

Hello,

I'ill try to test this this week.

Best regards,

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

Re: How to couple Code_saturne and Salome

Post by Yvan Fournier »

Hello,

I've spent some time trying to improve things a bit, regenerating some of the coupling files so as to avoid Python 2/3 issues, but I basically hit the same issue as you do.

I'll try a few more things, but at this point, it would probably be more useful to spend time working on the new (unfinished) form of the coupling with code_aster. I could help with some elements of the initialization/communication setup, but occasional general technical discussions with members of the code_aster dev team and a 2 day intro course to code_aster 2 years ago does not make me familiar enough with code_aster to efficiently work on applying forces from code_saturne as code_aster boundary conditions, and extracting mesh deformations to send back to code_saturne (using code_aster's Python API). If this is something you feel up to, I could help you with the aforementioned aspects, and we could probably get a coupling going with on and off "background" work on this over a few weeks. Depends on your timeframe...

Also, if all else fails and you do not absolutely need a version of code_aster more recent than salome_meca 2017, then the current coupling does work with salome_meca 2017.

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,

Thank you so much for your efforts with this.

You mentioned that this coupling case is working with salome-meca 2017, right? Are you using the latest version of code_saturne (6.0.2) to couple with salome-meca 2017? If so, I think is better to downgrade to salome-meca 2017. In this case, how do you overcome the problems with python versions, since salome-meca uses python2 and code_saturne uses python3?

Again, Thank you.

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

Re: How to couple Code_saturne and Salome

Post by Yvan Fournier »

Hello,

Yes, I tested this on a version of code_saturne v6.0 between 6.0.1 and 6.0.2 with salome_meca 2017 last December.

As for the Python version, the answer is an easy one: code_saturne 6.0 is compatible with both Python 2 and Python 3, so it can simply use whatever version Salome uses.

Best regards,

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

Re: How to couple Code_saturne and Salome

Post by Yvan Fournier »

Hello,

Also, if you use a Salome_meca 2017 universal binary, it may be built using an older compiler and C++ ABI. In case of issues loading a dynamic library (error message in fluid/run_solver.log in test case), using the latest 6.0 branch update (from the Git tree), you can add:
SALOME_KERNEL_CXXFLAGS="-std=c++03 -D_GLIBCXX_USE_CXX11_ABI=0"
To the install's "configure" command.
In 6.0.2, this can be done using CXXFLAGS instead, but may conflict with other C++ libraries requiring C++11 (ParaView Catalyst, MEDCoupling) if used also.

Best regards,

Yvan
pici1251
Posts: 9
Joined: Wed May 20, 2020 11:11 am

Re: How to couple Code_saturne and Salome

Post by pici1251 »

Yvan Fournier wrote: Tue Feb 25, 2020 9:13 pm Hello,

Ok,.

We usually install code_saturne in a user or project directory ($HOME/Code_Saturne/6.0, $HOME/opt/code-saturne-6.0, /opt/code_saturne-6.0, or whatewer similar path we choose).
Which makes it easier to see what originates from the code_saturne install and what does not.

In your case, if you have no Python files under /usr except the ones installed by code_saturne, I gues the first (and simplest) thing to try is to reinstall code_saturne adding:

PYTHON=/home/user/anaconda3/bin/python3

to the "configure" line (then make && make install;; you do not need to redo the post-install, as it is not overwritten).

If you still have issues with that, then you need to see if there is a Python binary in the salome build and then use that one instead of the anaconda one.

Best regards,

Yvan
sorry for my intrusion, can I use Ubuntu18 standard Python installation (rel. 2.7, 3, 3.7 and 3.8) or is it mandatory to install Anaconda?
Thank you very much
Piero
Piero
hw: AMD Ryzen Threadripper 1900X 8-Core Processor × 8 - 64GB Ram
OS: Ubuntu-Mate 18.04 (preferred) + Windows 10Pro (needed)
Post Reply