use a deformed mesh (med file)to restart code saturne calculation
Forum rules
Please read the forum usage recommendations before posting.
Please read the forum usage recommendations before posting.
use a deformed mesh (med file)to restart code saturne calculation
I’m working on a FSI study and have to share med file between Code aster and Code Saturne. The work consists in determining water pressure on a monolith fixed in a water tank . The result is called maillage_bassin. Med and contains (the mesh bassin, and data informations such as velocity and so on) . Then calculate the monolith deformation using code aster and generate the new mesh linked to the water tank (rbassin.med). That part is working
Now, I’d liked to restart code saturne using the deformed mesh (contained in rbassin.med) associated to cell data maillage_bassin. Med (need to restart with previous velocity turbulence values)
So i have tried two methods
In salome , using medcoupling, build a med file with rbassin mesh and maillage_bassin data (but it’s not working)
Or in code saturne use the restart option, but i can’t use directly the option « use different mesh » cause it’s base of a csm file and not a med one
I share the files through this link
https://unicloud.unicaen.fr/index.php/s/pm7rocgXPpc3rSy
If someone can help me to fix this problem it will be great
regards
Now, I’d liked to restart code saturne using the deformed mesh (contained in rbassin.med) associated to cell data maillage_bassin. Med (need to restart with previous velocity turbulence values)
So i have tried two methods
In salome , using medcoupling, build a med file with rbassin mesh and maillage_bassin data (but it’s not working)
Or in code saturne use the restart option, but i can’t use directly the option « use different mesh » cause it’s base of a csm file and not a med one
I share the files through this link
https://unicloud.unicaen.fr/index.php/s/pm7rocgXPpc3rSy
If someone can help me to fix this problem it will be great
regards
-
- Posts: 4157
- Joined: Mon Feb 20, 2012 3:25 pm
Re: use a deformed mesh (med file)to restart code saturne calculation
Hello,
You can easily convert the rbassin.med file to CSM by using a separate code_saturne run, in "import mesh only" mode.
If that mesh has the same connectivity as maillage_bassin, you can directly use the corresponding mesh_input.csm instead of the previous one in the restart. Otherwise, you need the "separate mesh" option.
That seems to be the simplest approach. Otherwise, if you want to work directly with MED files, you can use MEDCoupling. Check the user example here : https://www.code-saturne.org/documentat ... er_3d.html
Best regards,
Yvan
You can easily convert the rbassin.med file to CSM by using a separate code_saturne run, in "import mesh only" mode.
If that mesh has the same connectivity as maillage_bassin, you can directly use the corresponding mesh_input.csm instead of the previous one in the restart. Otherwise, you need the "separate mesh" option.
That seems to be the simplest approach. Otherwise, if you want to work directly with MED files, you can use MEDCoupling. Check the user example here : https://www.code-saturne.org/documentat ... er_3d.html
Best regards,
Yvan
Re: use a deformed mesh (med file)to restart code saturne calculation
Thank you for your answer Yvan,
I have tried both process (restart /medcoupling)
Concerning the second i have some trouble using medcoupling library and have posted some enquiries on salome forum
Concerning restart strategy i have followed your advice and read some post to make it work. I have drawn a graph which details data transfert and folders are stocked here
https://unicloud.unicaen.fr/index.php/s ... Ped296Eyg
But i have two interrogations
first one : To start i launch a first sudy (folder saturne) and i determine the water tank mesh deformed. Then i transform this med file in a csm one (preprocess folder). And at last i restart the initial saturne study (sat folder). So does it right to create a new saturne study (sat folder) and locate the checkpoint in folder saturne/EBRSM/RESU/20240110-1556/checkpoint. Indeed i would like that saturne compute the deformed tank mesh associated with the first data flow
second one in run solver log i have a warning :
WARNING: WHEN READING THE AUXILIARY RESTART FILE
@ =======
@ Reading physical properties It was not possible to read some values from the
@ auxiliary restart file. They will be initialized by the default values. «
but i can’t find which kind of data are missing
regards
I have tried both process (restart /medcoupling)
Concerning the second i have some trouble using medcoupling library and have posted some enquiries on salome forum
Concerning restart strategy i have followed your advice and read some post to make it work. I have drawn a graph which details data transfert and folders are stocked here
https://unicloud.unicaen.fr/index.php/s ... Ped296Eyg
But i have two interrogations
first one : To start i launch a first sudy (folder saturne) and i determine the water tank mesh deformed. Then i transform this med file in a csm one (preprocess folder). And at last i restart the initial saturne study (sat folder). So does it right to create a new saturne study (sat folder) and locate the checkpoint in folder saturne/EBRSM/RESU/20240110-1556/checkpoint. Indeed i would like that saturne compute the deformed tank mesh associated with the first data flow
second one in run solver log i have a warning :
WARNING: WHEN READING THE AUXILIARY RESTART FILE
@ =======
@ Reading physical properties It was not possible to read some values from the
@ auxiliary restart file. They will be initialized by the default values. «
but i can’t find which kind of data are missing
regards
-
- Posts: 4157
- Joined: Mon Feb 20, 2012 3:25 pm
Re: use a deformed mesh (med file)to restart code saturne calculation
Hello,
Regarding your first question, does the deformed mesh have the same topology (number and connectivity of elements) as the original one ? If that is the case, you can simply:
- Create an empty "checkpoint" directory.
- Copy the .csm file for the new calculation into it.
- Copy the checkpoint/main.csc and checkpoint/auxiliary.csc files from the initial (undeformed) computation in that same directory.
- Use that checkpoint directory for a restart with the new mesh.
In that case, you do not need the "different mesh" option.
If the mesh topology/refinement/... has changed, then you can simply use the "different mesh" restart option, choosing the checkpoint directory from the first computation and the "mesh.csm" from that same directory as the "different mesh", but the interpolation will be from the undeformed mesh to the deformed one, so values might not be located at cells from the deformed mesh not located inside the original mesh (in this case values remain at 0, and you can modify them in cs_user_initialization).
Regarding the second question, can you post your run_solver.log ? It should indicate which fields were not present, so I could tell you if it is an issue or not.
Best regards,
Yvan
Regarding your first question, does the deformed mesh have the same topology (number and connectivity of elements) as the original one ? If that is the case, you can simply:
- Create an empty "checkpoint" directory.
- Copy the .csm file for the new calculation into it.
- Copy the checkpoint/main.csc and checkpoint/auxiliary.csc files from the initial (undeformed) computation in that same directory.
- Use that checkpoint directory for a restart with the new mesh.
In that case, you do not need the "different mesh" option.
If the mesh topology/refinement/... has changed, then you can simply use the "different mesh" restart option, choosing the checkpoint directory from the first computation and the "mesh.csm" from that same directory as the "different mesh", but the interpolation will be from the undeformed mesh to the deformed one, so values might not be located at cells from the deformed mesh not located inside the original mesh (in this case values remain at 0, and you can modify them in cs_user_initialization).
Regarding the second question, can you post your run_solver.log ? It should indicate which fields were not present, so I could tell you if it is an issue or not.
Best regards,
Yvan
Re: use a deformed mesh (med file)to restart code saturne calculation
Thanks for the answer but i have some diffuclties to understand this restart process.
Concerning geometry, the deformed mesh has the same number of nodes and position than the original one except nodes which belong to the cylinder boundary hole. These nodes have been translated as we can see on the picture To begin i will try your first strategy. Owing to the fact that the deformed mesh has to be computed by Code aster do i need to launch three successive Code saturne calculation as described in (graph1). If I want to repeat this process should i adopt the following strategy (cf graph2) ?
Regarding my third enquiry, I join The run_solver.log
Thank you for your help
Concerning geometry, the deformed mesh has the same number of nodes and position than the original one except nodes which belong to the cylinder boundary hole. These nodes have been translated as we can see on the picture To begin i will try your first strategy. Owing to the fact that the deformed mesh has to be computed by Code aster do i need to launch three successive Code saturne calculation as described in (graph1). If I want to repeat this process should i adopt the following strategy (cf graph2) ?
Regarding my third enquiry, I join The run_solver.log
Thank you for your help
- Attachments
-
- run_solver.log
- (22.55 KiB) Downloaded 756 times
-
- fsi.pdf
- (43.62 KiB) Downloaded 782 times
-
- Posts: 4157
- Joined: Mon Feb 20, 2012 3:25 pm
Re: use a deformed mesh (med file)to restart code saturne calculation
Hello,
Graph2 seems better adapted to an iterative solution, assuming the flow has a significant influence on the water tank.
What i not clear to me is the type of flow you are trying to compute. Most FSI studies done with code_saturne involve interaction with a complex flow, such as flow induced vibration of tube bundles. For a tank with sloshing, you would need ALE of VOF for the free surface in addition to the FSI aspects along the reservoir/tank walls. For an application such as sloshing with a fixed surface, using a simpler model than code_saturne would probably do.
Regarding the restart file, it seems you have one less variable in the restarted computation compared to the original one (change of model ?).
The "ref_presstot01" array is not present in the auxiliary checkpoint, but I do not think this should be too much of an issue.
Best regards,
Yvan
Graph2 seems better adapted to an iterative solution, assuming the flow has a significant influence on the water tank.
What i not clear to me is the type of flow you are trying to compute. Most FSI studies done with code_saturne involve interaction with a complex flow, such as flow induced vibration of tube bundles. For a tank with sloshing, you would need ALE of VOF for the free surface in addition to the FSI aspects along the reservoir/tank walls. For an application such as sloshing with a fixed surface, using a simpler model than code_saturne would probably do.
Regarding the restart file, it seems you have one less variable in the restarted computation compared to the original one (change of model ?).
The "ref_presstot01" array is not present in the auxiliary checkpoint, but I do not think this should be too much of an issue.
Best regards,
Yvan
Re: use a deformed mesh (med file)to restart code saturne calculation
The aim of this work is to study interraction between waves and monolith. But we're working step by step. So, at first, i try to validate the process of sharing data between CS and CA with a simple situation in which water is flowing with a velocity of 0.16 m.s-1 at the inlet. When it will be done we'll use an ale model with free surface as shown https://sites.google.com/view/wavecfd/h ... aturne-ale.
Thank you for your help. I will work on the simulation next week and keep you in touch
Regards Dimitri
Thank you for your help. I will work on the simulation next week and keep you in touch
Regards Dimitri
Re: use a deformed mesh (med file)to restart code saturne calculation
I was studying my process and launching some calculation on Code Saturne and it was working (no error message)
Since this morning i've got an error message due to divergence Rij calculation could you help me to fix this error
Regards
Dimitri
Since this morning i've got an error message due to divergence Rij calculation could you help me to fix this error
Regards
Dimitri
Re: use a deformed mesh (med file)to restart code saturne calculation
Ok i have fixed it it was a problem between low reynolds and wall law. I try a two step coupling and keep you in touch
Re: use a deformed mesh (med file)to restart code saturne calculation
The process seems efficient
However i have always a med file format . Indeed Code Saturne write med 4.1.1, and Code Aster 4.0.1
So i have tried with salome meca/ mesh module to convert this med file:
I import maille_mafluide (format 4.1.1) in the mesh module and then i export it under the name mafluide (format 4.0.1). Code aster can read this new file but the field (normal stress) who was in maille-mafluide has disappeared. Have you got an idea which allows to convert med format and keep stress field
Regards Dimitri
ps files are available here https://unicloud.unicaen.fr/index.php/s/azDEtzn5dAXdDai
However i have always a med file format . Indeed Code Saturne write med 4.1.1, and Code Aster 4.0.1
So i have tried with salome meca/ mesh module to convert this med file:
I import maille_mafluide (format 4.1.1) in the mesh module and then i export it under the name mafluide (format 4.0.1). Code aster can read this new file but the field (normal stress) who was in maille-mafluide has disappeared. Have you got an idea which allows to convert med format and keep stress field
Regards Dimitri
ps files are available here https://unicloud.unicaen.fr/index.php/s/azDEtzn5dAXdDai