How to run a coupled calculation with Syrthes ?
Forum rules
Please read the forum usage recommendations before posting.
Please read the forum usage recommendations before posting.
How to run a coupled calculation with Syrthes ?
Hi everyone,
I'm trying to run a coupled calculation using Code_Saturne 1.4 and Syrthes 3.4.2, and I'm experiencing some trouble !
For what I understood, I have to specify the calculation in the Code_Saturne's GUI as well as in syrthes.data & syrthes.env. In the Saturne's GUI, in the tab "syrthes coupling", I checked the option syrthes coupling on, and selected the groups of faces for the coupling. In syrthes.data, I gave the references of the coupled faces. I put the fluid mesh and the solid mesh (which are different) in the directory MESH of my saturne study. I created a directory DATA_SYR in the CASE directory, in which I pasted syrthes.data and syrthes.env. Then I click on "Code Saturne batch running" in Saturne's GUI.
The stage before the calculation (compilation, preparing calculation) is going ok, but then once the message Calculation starting appears, nothing happens anymore...
At the very beginning of the calculation (before the message "Code Saturne is ruuning appears), I get this message :
/home/caelinux/TENSYL/Stage/5-Modelisation/2-Benchmark/Autoclave/1-Calcul/100617/AUTOCLAVE/SCRIPTS/runcase: 370: nproc_kernel: not found
When looking in the runcase file, the number of processors is correctly defined, as well as the variable nproc_kernel.
I attach here my listing and runcase files, and the syrthes.data and case file for saturne, so maybe you can help me finding what is wrong.
The calculation with the fluid only in one hand and the solid only in the other hand are running fine.
I'm trying to run a coupled calculation using Code_Saturne 1.4 and Syrthes 3.4.2, and I'm experiencing some trouble !
For what I understood, I have to specify the calculation in the Code_Saturne's GUI as well as in syrthes.data & syrthes.env. In the Saturne's GUI, in the tab "syrthes coupling", I checked the option syrthes coupling on, and selected the groups of faces for the coupling. In syrthes.data, I gave the references of the coupled faces. I put the fluid mesh and the solid mesh (which are different) in the directory MESH of my saturne study. I created a directory DATA_SYR in the CASE directory, in which I pasted syrthes.data and syrthes.env. Then I click on "Code Saturne batch running" in Saturne's GUI.
The stage before the calculation (compilation, preparing calculation) is going ok, but then once the message Calculation starting appears, nothing happens anymore...
At the very beginning of the calculation (before the message "Code Saturne is ruuning appears), I get this message :
/home/caelinux/TENSYL/Stage/5-Modelisation/2-Benchmark/Autoclave/1-Calcul/100617/AUTOCLAVE/SCRIPTS/runcase: 370: nproc_kernel: not found
When looking in the runcase file, the number of processors is correctly defined, as well as the variable nproc_kernel.
I attach here my listing and runcase files, and the syrthes.data and case file for saturne, so maybe you can help me finding what is wrong.
The calculation with the fluid only in one hand and the solid only in the other hand are running fine.
- Attachments
-
- coupling_setup.tar.gz
- (11.49 KiB) Downloaded 297 times
Re: How to run a coupled calculation with Syrthes ?
Here is the saturne's xml file.
- Attachments
-
- 100617_autoclave_couplage.xml
- (8.98 KiB) Downloaded 351 times
Re: How to run a coupled calculation with Syrthes ?
Another quick question : how should I specify the boundary conditions for the coupled faces ? should they appear in the 'defintion of boundary condition' ? I really don't have any idea and don't seem to find something on the internet... what bothers me is that some people obviously managed to run some coupled calculations, and I can't find any information, tutorial, explanation, anywhere... not even in the saturne or syrthes documentation !
As soon as I have correct results for basic calculations, I will try to post something with the all process, I think it might help for other users like me, who are kind of lost !!
As soon as I have correct results for basic calculations, I will try to post something with the all process, I think it might help for other users like me, who are kind of lost !!
Re: How to run a coupled calculation with Syrthes ?
Hello,
On the Syrthes side, you need to tell the code which vertex or face references (i.e. colors) are coupled in the syrthes.data file, for example, to couple faces of colors 3 and 4 with Code_Saturne:
'REFERENCES NOEUDS OU FACES SOLIDES COUPLE(E)S' 3 4
On the Code_Saturne side, define your boundary values normally (using a wall BC for coupled faces, the easiest is to use a homogeneous Neumann boundary condition for temperature or enthalpy as if the wall were adiabatic), and then define which faces (colors or groups) are coupled with Syrthes using selection criteria similar to those used for BC's in the "Conjugate heat transfer" page in the GUI (or the ussyrc user subroutine if you are not using the GUI).
Also, when you generate you coupled case, add to "--nsyr=1" option to the "code_saturne create" command, so that a DATA_SYR and a RESU_SYR directory are added to your case directory structure and the runcase script handles the coupling (multiple Code_Saturne and Syrthes sections are possible, but in this case, the runcase script must be edited by hand and not using the GUI).
Best regards,
Yvan
On the Syrthes side, you need to tell the code which vertex or face references (i.e. colors) are coupled in the syrthes.data file, for example, to couple faces of colors 3 and 4 with Code_Saturne:
'REFERENCES NOEUDS OU FACES SOLIDES COUPLE(E)S' 3 4
On the Code_Saturne side, define your boundary values normally (using a wall BC for coupled faces, the easiest is to use a homogeneous Neumann boundary condition for temperature or enthalpy as if the wall were adiabatic), and then define which faces (colors or groups) are coupled with Syrthes using selection criteria similar to those used for BC's in the "Conjugate heat transfer" page in the GUI (or the ussyrc user subroutine if you are not using the GUI).
Also, when you generate you coupled case, add to "--nsyr=1" option to the "code_saturne create" command, so that a DATA_SYR and a RESU_SYR directory are added to your case directory structure and the runcase script handles the coupling (multiple Code_Saturne and Syrthes sections are possible, but in this case, the runcase script must be edited by hand and not using the GUI).
Best regards,
Yvan
Re: How to run a coupled calculation with Syrthes ?
Hi,
I tried running my coupled calculation with the advice you gave me, but it still doesn't work !
On the syrthes side, the coupled faces are correctly defined (the references to specify are the one from the solid mesh ?). The solid mesh I'm using is in a .med format, I convert it with the convert2syrthes tool so I have a .syr mesh as well as a .syr.desc giving me the correspondance between the groups created in my .med mesh and the reference in the .syr mesh. The references for the coupled faces I gave in the .data file are the ones given in the .syr.desc file. Is it correct ?
On the saturne side, I'm using an .unv mesh, with the boundary faces defined by groups. For the definition of the boundary faces, I use the groups and specifiy an adiabatic wall condition for the coupled faces (which are all the groups as all the fluid domain is surrounded by the solid domain). For the definition of the coupled faces, I don't have a 'conjugate heat transfer' page as you mentioned (I'm using Code Saturne 1.4.b), but a 'Syrthes coupling' page, in which I have to type the names of the groups for the coupled faces. I use here the names I gave to the groups when I created my mesh.
I wasn't able to find the ussyrc subroutine, but I don't think it's a problem as I'm using the GUI.
The command to create a study and a case is in my case cs_create -study STUDY_NAME CASE_NAME, and when I add --nsyr=1 to this command, it's like --nsyr=1 is the name of a case which should be created (I have the message 'generating case --nsyr=1, and then some error messages, at the end the case --nsyr=1 is not created, but I have a case CASE_NAME as usual, without the directories DATA_SYR and RESU_SYR). So I created myself these 2 directories and put the .data and .env files in DATA_SYR.
In the runcase file, everything seems fine. The coupling with Syrthes is on, the groups of coupled faces are specified, the paths are correct.
When I start the calculation in the Saturne's GUI with the 'Code Saturne batch running' button, ths steps of preparation and compilation are running fine, and just after the message 'Calculation starting', nothing happens anymore, but the computer is still busy and uses all the CPU. I have to kill the process myself to stop it from running.
I really don't know what to test next to know exactly what is going wrong. The only idea I have is on the coupling faces : should I use the same format for the solid and fluid meshes ? should I use references or colors instead of groups for the definition of the coupled face on the fluid side ? should I define the coupled faces in the solid AND fluid meshes in both Syrthes and Saturne (in my opinion just the coupled faces of the fluid mesh should appear in the Saturne side, and just the coupled faces of the solid mesh in the Syrthes side) ?
The files are quite the same as the ones I attached in my precedent post, but if you need to see one in particular just tell me and I will post it.
Did someone already had these kind of problems ?? I'm asking because it seems from what I read everywhere that the coupling Saturne/Syrthes is easy to set up... and I don't understand why I'm not able to run a coupled calculation... !!!
Thanks again for your help !
Alicia
I tried running my coupled calculation with the advice you gave me, but it still doesn't work !
On the syrthes side, the coupled faces are correctly defined (the references to specify are the one from the solid mesh ?). The solid mesh I'm using is in a .med format, I convert it with the convert2syrthes tool so I have a .syr mesh as well as a .syr.desc giving me the correspondance between the groups created in my .med mesh and the reference in the .syr mesh. The references for the coupled faces I gave in the .data file are the ones given in the .syr.desc file. Is it correct ?
On the saturne side, I'm using an .unv mesh, with the boundary faces defined by groups. For the definition of the boundary faces, I use the groups and specifiy an adiabatic wall condition for the coupled faces (which are all the groups as all the fluid domain is surrounded by the solid domain). For the definition of the coupled faces, I don't have a 'conjugate heat transfer' page as you mentioned (I'm using Code Saturne 1.4.b), but a 'Syrthes coupling' page, in which I have to type the names of the groups for the coupled faces. I use here the names I gave to the groups when I created my mesh.
I wasn't able to find the ussyrc subroutine, but I don't think it's a problem as I'm using the GUI.
The command to create a study and a case is in my case cs_create -study STUDY_NAME CASE_NAME, and when I add --nsyr=1 to this command, it's like --nsyr=1 is the name of a case which should be created (I have the message 'generating case --nsyr=1, and then some error messages, at the end the case --nsyr=1 is not created, but I have a case CASE_NAME as usual, without the directories DATA_SYR and RESU_SYR). So I created myself these 2 directories and put the .data and .env files in DATA_SYR.
In the runcase file, everything seems fine. The coupling with Syrthes is on, the groups of coupled faces are specified, the paths are correct.
When I start the calculation in the Saturne's GUI with the 'Code Saturne batch running' button, ths steps of preparation and compilation are running fine, and just after the message 'Calculation starting', nothing happens anymore, but the computer is still busy and uses all the CPU. I have to kill the process myself to stop it from running.
I really don't know what to test next to know exactly what is going wrong. The only idea I have is on the coupling faces : should I use the same format for the solid and fluid meshes ? should I use references or colors instead of groups for the definition of the coupled face on the fluid side ? should I define the coupled faces in the solid AND fluid meshes in both Syrthes and Saturne (in my opinion just the coupled faces of the fluid mesh should appear in the Saturne side, and just the coupled faces of the solid mesh in the Syrthes side) ?
The files are quite the same as the ones I attached in my precedent post, but if you need to see one in particular just tell me and I will post it.
Did someone already had these kind of problems ?? I'm asking because it seems from what I read everywhere that the coupling Saturne/Syrthes is easy to set up... and I don't understand why I'm not able to run a coupled calculation... !!!
Thanks again for your help !
Alicia
Re: How to run a coupled calculation with Syrthes ?
Hello,
USSYRC only exists in versions 2.x, but as you are using the GUI, you don't need it.
There is nothing "obviously wrong" in the files you posted, but the error may be either in Code_Saturne or in Syrthes, so you may find explanations or hints in the listsyr, listing, or error* files.
If the error is not self-explanatory, please post those files so that I can take a look at them.
Also, if the error seems to be MPI-related, you may try "COUPLING_MODE=sockets" in the runcase script, or you may need an update to the "bin/mpi_rank.sh" file if you are using OpenMPI 1.3 or above:
replace
# For Open MPI (it also provides the mpiexec command)
elif [ "$OMPI_MCA_ns_nds_vpid" != "" ] ; then
MPI_RANK="$OMPI_MCA_ns_nds_vpid"
with:
# For Open MPI (it also provides the mpiexec command)
elif [ "$OMPI_MCA_ns_nds_vpid" != "" ] ; then # Open MPI 1.2
MPI_RANK="$OMPI_MCA_ns_nds_vpid"
elif [ "$OMPI_COMM_WORLD_RANK" != "" ] ; then # Open MPI 1.3
MPI_RANK="$OMPI_COMM_WORLD_RANK"
USSYRC only exists in versions 2.x, but as you are using the GUI, you don't need it.
There is nothing "obviously wrong" in the files you posted, but the error may be either in Code_Saturne or in Syrthes, so you may find explanations or hints in the listsyr, listing, or error* files.
If the error is not self-explanatory, please post those files so that I can take a look at them.
Also, if the error seems to be MPI-related, you may try "COUPLING_MODE=sockets" in the runcase script, or you may need an update to the "bin/mpi_rank.sh" file if you are using OpenMPI 1.3 or above:
replace
# For Open MPI (it also provides the mpiexec command)
elif [ "$OMPI_MCA_ns_nds_vpid" != "" ] ; then
MPI_RANK="$OMPI_MCA_ns_nds_vpid"
with:
# For Open MPI (it also provides the mpiexec command)
elif [ "$OMPI_MCA_ns_nds_vpid" != "" ] ; then # Open MPI 1.2
MPI_RANK="$OMPI_MCA_ns_nds_vpid"
elif [ "$OMPI_COMM_WORLD_RANK" != "" ] ; then # Open MPI 1.3
MPI_RANK="$OMPI_COMM_WORLD_RANK"
Re: How to run a coupled calculation with Syrthes ?
Indeed I think it's a problem with OpenMPI. A hint I didn't take into account is that when I try to run the calculation with only 1 processor the calculation stops by itself with an error message, and when I run the calculation with 2 processors, I have to stop it by killing the process because it keeps running without doing anything.
The version of OpenMPI installed in my CAELinux distribution is 1.2.5, so the modification to the mpi_rank.sh file doesn't change anything.
As you suggested, I ran the calculation with COUPLING_MODE=sockets instead of MPI, and now I have another kind of problem : the calculation seems to reach the end, I got the message "Normal simulation finish", but without any detail on the iterations or anything else. Having a look at the listsyr file, I have this error message : "erreur lors de la lecture de la ligne de commande". I tried with 1 and 2 processors (in the GUI), the outcome is the same.
Another remark, on the listing file, with COUPLING_MODE=MPI, I got the warning message : "/home/caelinux/TENSYL/Stage/5-Modelisation/2-Benchmark/Autoclave/1-Calcul/100617/AUTOCLAVE/SCRIPTS/runcase:
370: nproc_kernel: not found "
I don't have it with COUPLING_MODE=sockets.
I attach the listing files (batch and listsyr with COUPLING_MODE=sockets, I don't have any error file).
The version of OpenMPI installed in my CAELinux distribution is 1.2.5, so the modification to the mpi_rank.sh file doesn't change anything.
As you suggested, I ran the calculation with COUPLING_MODE=sockets instead of MPI, and now I have another kind of problem : the calculation seems to reach the end, I got the message "Normal simulation finish", but without any detail on the iterations or anything else. Having a look at the listsyr file, I have this error message : "erreur lors de la lecture de la ligne de commande". I tried with 1 and 2 processors (in the GUI), the outcome is the same.
Another remark, on the listing file, with COUPLING_MODE=MPI, I got the warning message : "/home/caelinux/TENSYL/Stage/5-Modelisation/2-Benchmark/Autoclave/1-Calcul/100617/AUTOCLAVE/SCRIPTS/runcase:
370: nproc_kernel: not found "
I don't have it with COUPLING_MODE=sockets.
I attach the listing files (batch and listsyr with COUPLING_MODE=sockets, I don't have any error file).
- Attachments
-
- listsyr-06211432.txt
- (485 Bytes) Downloaded 285 times
-
- batch_06211432.txt
- (6.88 KiB) Downloaded 314 times
Re: How to run a coupled calculation with Syrthes ?
Hello,
The problem with COUPLING_MODE=sockets might be due to a bug in the script. CAELinux's version 1.4.b is a pre-release of an unsupported developpement version, meaning it is based on the code in a state in which not everything was tested/debugged (the physics and numerics are almost identical to those of production version 1.3, with the addition of the multigrid and a new preprocessor output and restart file format, so there is no danger there, but the scripts were translated to English and modified in other ways, so there may be a bug here).
As you seem to be planning to install 2.0-rc1 or rc2 on a new machine soon, I would suggest installing 2.0-rc1 on your current machine, and updating your data to that version (this should not be a loss of time as long as you avoid trying to install METIS, as 2.0-rc2 will use almost the same installation procedure, albeit slightly more streamlined).
With 2.0-rc's, SYRTHES coupling is better tested, so it should work better, and if you still have a a bug, we prefer spending our limited time on the current (1.3) or better, imminent (2.0) stable version than on older intermediate "unstable" versions.
As you said, other users on this Forum outside of EDF have run coupled simulations, but I believe most were running 2.0-beta2 or rc-1.
Best regards,
The problem with COUPLING_MODE=sockets might be due to a bug in the script. CAELinux's version 1.4.b is a pre-release of an unsupported developpement version, meaning it is based on the code in a state in which not everything was tested/debugged (the physics and numerics are almost identical to those of production version 1.3, with the addition of the multigrid and a new preprocessor output and restart file format, so there is no danger there, but the scripts were translated to English and modified in other ways, so there may be a bug here).
As you seem to be planning to install 2.0-rc1 or rc2 on a new machine soon, I would suggest installing 2.0-rc1 on your current machine, and updating your data to that version (this should not be a loss of time as long as you avoid trying to install METIS, as 2.0-rc2 will use almost the same installation procedure, albeit slightly more streamlined).
With 2.0-rc's, SYRTHES coupling is better tested, so it should work better, and if you still have a a bug, we prefer spending our limited time on the current (1.3) or better, imminent (2.0) stable version than on older intermediate "unstable" versions.
As you said, other users on this Forum outside of EDF have run coupled simulations, but I believe most were running 2.0-beta2 or rc-1.
Best regards,
Re: How to run a coupled calculation with Syrthes ?
Ok I will see what I can do with that !!
Do you think I can install the version 2.0-rc1 on my current machine without deleting the 1.4 ?? (as this version works for most of my cases which don't include conjugate heat transfer (CFD around buildings mostly), I don't want to erase it if I can't come up with a proper installation of a newer version... and then don't have anything working properly anymore !). I totally understand that you don't have time to waste on a intermediate version.
Anyway if it is risky to install the 2.0xx without touching the 1.4, I don't think I will do it on this machine and just wait for my new machine.
Thanks again for the wonderful help !!!
Alicia
Do you think I can install the version 2.0-rc1 on my current machine without deleting the 1.4 ?? (as this version works for most of my cases which don't include conjugate heat transfer (CFD around buildings mostly), I don't want to erase it if I can't come up with a proper installation of a newer version... and then don't have anything working properly anymore !). I totally understand that you don't have time to waste on a intermediate version.
Anyway if it is risky to install the 2.0xx without touching the 1.4, I don't think I will do it on this machine and just wait for my new machine.
Thanks again for the wonderful help !!!
Alicia
Re: How to run a coupled calculation with Syrthes ?
Yes, you can install 2.0-rc1 without touching 1.4.
Since 2.0-beta1, we may use separate build and installation directories, and prefer the following installation directory for the Kernel and other Code_Saturne libraries :
Code_Saturne/2.0-rc1/arch/Linux_X86_64
meaning you can have different versions installed side by side.
The Python installer script for 2.0-rc1 has a minor bug as it uses the name 2.0-beta2 instead of 2.0-rc1 (you can search/replace to avoid this issue), but this has no consequences if you do not install both beta2 and rc1.
Before installing, you will need to make sure you have Qt4 and Py-Qt4 installed on your machine (should be available through the package manager of your CAELinux distribution).
Also, in version 2.0-rc*, you do not need to source a .cs_profile file, but simply to use the correct "Code_Saturne/2.0-rc1/arch/Linux_X86_64/bin/code_saturne" executable (you may use an alias), with subcommands such as "create", "check_mesh", "info", ....
GUI XML files are not quite compatible, so re-creating them is best.
If you are not able to build the documentation for 2.0 (usually due to missing Latex files or a missing "fig2dev"), they are posted as pre-generated PDF files in the "announces" section of this Forum...
Good Luck !
Since 2.0-beta1, we may use separate build and installation directories, and prefer the following installation directory for the Kernel and other Code_Saturne libraries :
Code_Saturne/2.0-rc1/arch/Linux_X86_64
meaning you can have different versions installed side by side.
The Python installer script for 2.0-rc1 has a minor bug as it uses the name 2.0-beta2 instead of 2.0-rc1 (you can search/replace to avoid this issue), but this has no consequences if you do not install both beta2 and rc1.
Before installing, you will need to make sure you have Qt4 and Py-Qt4 installed on your machine (should be available through the package manager of your CAELinux distribution).
Also, in version 2.0-rc*, you do not need to source a .cs_profile file, but simply to use the correct "Code_Saturne/2.0-rc1/arch/Linux_X86_64/bin/code_saturne" executable (you may use an alias), with subcommands such as "create", "check_mesh", "info", ....
GUI XML files are not quite compatible, so re-creating them is best.
If you are not able to build the documentation for 2.0 (usually due to missing Latex files or a missing "fig2dev"), they are posted as pre-generated PDF files in the "announces" section of this Forum...
Good Luck !