HOW can i do to run code_saturne on YACS

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Yvonne
Posts: 23
Joined: Sat Oct 02, 2021 7:53 am

HOW can i do to run code_saturne on YACS

Post by Yvonne »

Hello all!

Recently I study how to use the salome_yacs to run code_saturne.

I used the dump scripts to run, I find that the dump scripts maybe overwrite my settings and the GUI seems to become initialized.

but it was not my original intention. is it feasible to run cide_saturne on YACS? if it can work, can you tell me how to do that? thank you so so so much!

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

Re: HOW can i do to run code_saturne on YACS

Post by Yvan Fournier »

Hello,

This is a very broad question, so I do not know where to start.

I am not sure what you call the dump scripts.

When running code_saturne under OpenTURNS (par sensitivity analysis), I think YACS is used indirectly.
We also had an coupling mode with code_aster, where we used low-level features (CALCIUM library compatibility) which also used YACS, but this low-lvel interface has been removed.

At a high level, using Python scripts, yes, you can use YACS, but how you use it depends on what you need to do.
Using a finer integration (with YACS input/output ports) is not really handled, or you would need to manage all input/output ports as part of your scripts.

Also, if you want to run in parallel, I do not think the basic YACS features handled batch systems, though the associated YDEFX module does. Unfortunately, I do not have any code examples, so if other people on this forum do, they are welcome to share them.

Best regards,

Yvan
Yvonne
Posts: 23
Joined: Sat Oct 02, 2021 7:53 am

Re: HOW can i do to run code_saturne on YACS

Post by Yvonne »

Dear Yvan,
Thank you for your answer!
Sorry that I don't explain what dump scripts are. Here I attached the screenshot.

When I run the dump scripts in YACS, I find that the setting is overwritten.
Maybe it is wrong to link the code_saturne by dump scripts? :?

so how can I do or write what scripts that i can link the YACS and code_saturne, just like link the code_aster and YACS.
Many thanks

Best wish

Yvonne
Attachments
dump python.jpg
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: HOW can i do to run code_saturne on YACS

Post by Yvan Fournier »

Hello,

The utility of "dump scripts" is limited. These scripts allow modification of a case's XML setup, so they may be useful in the following workflow:

- set up a computation case.
- dump the Python script
- adapt commands from this script in cs_user_scripts.py or an external script called by studymanager for a parametric study.

None of that requires YACS. Using YACS, you could also set up a parametric study loop, but there are no current examples to my knowledge. I am not familiar with code_aster YACS scripts, so I cannot compare them..

In any case, the scripts that are dumped by the GUI only manage the xml values. They do not handle the full computation, so need to be included in some other script.

Best regards,

Yvan
Yvonne
Posts: 23
Joined: Sat Oct 02, 2021 7:53 am

Re: HOW can i do to run code_saturne on YACS

Post by Yvonne »

Dear Yvan

Thank you for your reply! it's helpful for me

Best wish
Yvonne
Posts: 23
Joined: Sat Oct 02, 2021 7:53 am

Re: HOW can i do to run code_saturne on YACS

Post by Yvonne »

Dear Yvan
recently I want to run the code_saturne in yacs, but I have tried most times that failed. (whatever in Salome or the Salome-CFD). The screenshot has attached.

I don't know if my code has wrong?
can you help me? (i just want to run the code_saturne in yacs)


here is my code:
import os
from subprocess import check_output

case_path = '/home/wfy/20210823.cas/CASE1'
xml_path = os.path.join(case_path, 'DATA/setup.xml')
os.chdir(case_path)
out = check_output(['code_saturne', 'run', '--param', xml_path).decode()
Attachments
screenshot.jpg
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: HOW can i do to run code_saturne on YACS

Post by Yvan Fournier »

Hello,

As a general rule, whenever you have an error message indicating a given process has failed, try to check if you have error messages matching the process in question. For code_saturne, that would be the usual error* messages in the RESU/<run_id> run directory, or if you find nothing useful there, in more detailed logs from YACS.

Without more detailed error messages, I can't help. With code_saturne alone, I could help you increase logging, but I am not familiar enough with YACS to indicate how to troubleshoot an error under YACS. You might find additional help on the salome-platform.org forum.

Best regards,

Yvan
Yvonne
Posts: 23
Joined: Sat Oct 02, 2021 7:53 am

Re: HOW can i do to run code_saturne on YACS

Post by Yvonne »

thank you very much~~
Post Reply