how can we export boundary pressure results

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
dimitri14
Posts: 33
Joined: Tue Jan 03, 2023 10:25 am

how can we export boundary pressure results

Post by dimitri14 »

I'm studying the flow around an immersed cylinder. I'd liked to export the pressure values on the cylinder surface at the end of the simulation. Idealy , a kind of array with the cell center coordinates ( i assume that pressure is cell centered calculated?)and the pressure.
I try to import a csv file in profile option , but it doesn't work. I try to extract values on paraview but i can't extract the boundary surface. If someone has an idea it will be a great help
Attachments
setup.xml
(7.04 KiB) Downloaded 30 times
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: how can we export boundary pressure results

Post by Yvan Fournier »

Hello,

You can define additional postprocessing meshes (subsets of existing meshes), and associate them to writers in the postprocessing section.

I recommend defining a boundary surface mesh corresponding only to the cylinder surface.

Reading that in ParaView, exporting to other formats such as .csv should be easier.

Best regards,

Yvan
dimitri14
Posts: 33
Joined: Tue Jan 03, 2023 10:25 am

Re: how can we export boundary pressure results

Post by dimitri14 »

Thank you very much.
Actualy, my goal is to do a 2 way coupling between code saturne and code aster.
Before exploring the coupling patch I’m trying to do it step by step :
Fluid modelisation and pression results on cylinder surface with code saturne
export boundary condition in code aster and calculate node’s displacement
Determination of the new cylinder shape
Fluid modelisation and pression results on new shape cylinder surface
I have read one of your old post viewtopic.php?t=1767
and i try to follow your advice. Therefore i have created a med writter in order to export mesh and boundary condition (cf image).
question.png
You were talking about using user subroutines, such as cs_user_postprocess_var.f90, to obtain only pressure information. Could you tell me a little more about this type of process or indicate a link to work on it
Best regards
dimitri14
Posts: 33
Joined: Tue Jan 03, 2023 10:25 am

Re: how can we export boundary pressure results

Post by dimitri14 »

For the shake of clarity i would like to know :
Is my med file i correct ? :
donees.med
(1.06 MiB) Downloaded 43 times
How to associate pressure boundary condition from C saturne to C aster?
question2.png
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: how can we export boundary pressure results

Post by Yvan Fournier »

Hello,

The post you refer to is getting old, as cs_user_postprocess_var.f90 has been replaced by cs_user_postprocess_values (in cs_user_postprocess.c).

The approach is still feasible, but if you can wait a few months, 2 way coupling should be available in a few months : we hafd a basic wlrking prototype last november, and the code is already in v8.0 beta. It should ne in a release of code_aster around June if I am not mistaken. That coupling mode uses MEDCoupling, and should work in parallel, though it has only undergon light testing so far.

Best regards,

Yvan
dimitri14
Posts: 33
Joined: Tue Jan 03, 2023 10:25 am

Re: how can we export boundary pressure results

Post by dimitri14 »

Thanks for the answer. It's good news, knowing that coupling process will be completed in a few month. However, i'm working on my "these" and i have to product some results quickly (at the end of mars...) In order to reach this goal i really need to finalise the "manualy" coupling . My tutor can help me using code Aster, but noone , in my team, has used code saturne.
So i'll try to follow your advice using cs_user_postprocess_values. And i keep you informed on the results
Best regards
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: how can we export boundary pressure results

Post by Yvan Fournier »

Hello,

Ok. I just checked your "donnees.med" file, and it seems correct. You can probably also choose to output the full stress as a single vector, instead of separating shear stress and normal component, but that depdens on what is best for your coupling scheme.

Since all of this can be configured with the GUI, you do not need to spend time with cs_user_postprocess_values, especially if you have a deadline :-).

Best regards,

Yvan
dimitri14
Posts: 33
Joined: Tue Jan 03, 2023 10:25 am

Re: how can we export boundary pressure results

Post by dimitri14 »

Hello, I have several problems to export my results.
At first i’m wondering about the quality of my cfd results. Indeed, although my velocity results accord to experimentals results (Von Karman allée, good vortex frequency) I’m not sure that pressure one are right : As indicate in the picture below i have a constant pressure while velocity on the cylinder is very turbulent :
Image
And obviously, my Stress boundary med file export descripte not the stress leads to turbulent velocity, but only static pressure depending on the depth and à t=0s, therefore i have ticked (for the med writter) output at end of calculation
If someone can take a look at the attach files ang give me some advices it will be greatfull
Attachments
export_donees.med
fichier resultat format med à exporter vers code aster
(972.84 KiB) Downloaded 38 times
setup.xml
(7.18 KiB) Downloaded 37 times
question.png
dimitri14
Posts: 33
Joined: Tue Jan 03, 2023 10:25 am

Re: how can we export boundary pressure results

Post by dimitri14 »

The problem seems to be linked with gravity option. In fact if i untick (oz) gravity i obtain a good med stress file (joined)
When i open this med file in paravis the stress field is defined with TS0/donees ComSup0/Stress. I'd liked to know how call it when i use it in Code Aster; cause TS0_donees_ComSup0_Stress is not working or TS0(((donees((ComSup0(Stress))) too.
Attachments
export_donees.med
(1.28 MiB) Downloaded 32 times
dimitri14
Posts: 33
Joined: Tue Jan 03, 2023 10:25 am

Re: how can we export boundary pressure results

Post by dimitri14 »

I have tried with an another med file and i can see the name field in paravis : Normal Stress is ok
However Normal Stress is the Name of the med file correponding to the operator NOM_CHAM_MED in Code Aster
NOM_CHAM_MED='Normal Stress',
But I need another information relative to the component name type NOM_CMP_MED
I have made a dump file in code aster to explore the med file and acces to this information but it doesn't work
I have read several posts and tried several cmp name without any succes : NOM_CMP_MED='X', NOM_CMP_MED='V1',
If someone can help me to find the issue i'll be thankfull

Code: Select all

STRESS = LIRE_RESU(
  FORMAT='MED', 
  FORMAT_MED=_F(
    NOM_CHAM='PRES', 
    NOM_CHAM_MED='Normal Stress', 
    NOM_CMP=('PRES', ), 
    NOM_CMP_MED=('X', )
  ), 
  INST=(0.0, ), 
  MODELE=modelflu, 
  TYPE_RESU='EVOL_CHAR', 
  UNITE=2
) 
Attachments
donees.med
(747.84 KiB) Downloaded 37 times
Post Reply