Output mesh and writers

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
knewlands

Output mesh and writers

Post by knewlands »

Hello,

My questions are probably rather basic, but I would appreciate some clarification regarding output mesh and writers. I would like to output the coordinates and time averages for the entire domain, so I edited the example in usvpst "Volume variables on the main volume mesh (ipart=-1)". I also enable "Domain boundary post-processing" in the gui, so I will need to add ipart=-2 in usvpst, correct?

As I am not creating additional mesh parts, I didn't plan to use usdpst. However, usdpst allows me to choose different writers and to specify to write the results on the last time step. I will use ParaView to visualize the instantaneous results, so the post-processing format I selected in the gui is Ensight Gold, Binary. I need the x, y and z coordinates and the time averages in text format however, so that I can use Matlab for further processing. My fundamental question is: can I use usdpst to define the writers only with no additional mesh parts or can I specify different writers elsewhere?

Thank you,

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

Re: Output mesh and writers

Post by Yvan Fournier »

Hello,

I assume you are using version 2.0, but please indicatewhich version you are using when you post.

Yes, you can use usdpst to define writers only with no additional mesh parts. You choose which writers are associated to given meshes, so the calls to "pstass" at the end of usdpst should simply be consistent with the meshes which do exit (-1 and -2 in your case).

For finer control, you may also be interested in mesh aliases (see example call of pstalm in usdpst), where the reference mesh is -1 or -2, and the alias is a strictly positive integer (1 or 2 is recommended if you have no other meshes defined in usdpst). This allows you to associate the "real" mesh with the default writer, and the "alias" mesh with the additional writer, and use the different mesh number in tests in usvpst to output different variables for each writer. If you want the same variables for the default and additional writer, do not bother with this, and simply associate meshes -1 and -2 to your additional (I presume EnSight text) writer.

Best regards,

Yvan
knewlands

Re: Output mesh and writers

Post by knewlands »

Hello,

Thank you for your reply Yvan and I must apologise for not stating which version of the code I'm using, it is in fact version 2.0.5.

The mesh alias is actually useful to me and I have edited the usdpst subroutine to associate the "automatic" meshes (ipart=-1 and -2) with text and binary writers and also specified the text writer for the alias mesh in order to re-write the velocity and pressure variables already written in binary format by default. I am having issues with the writers for the volume and boundary meshes though in that, whilst the data for the alias mesh is saved in the folder text.ensight as it should, the data for ipart=-1 and ipart=-2 is only saved in the chr.ensight folder created by default and only written in the format I specified in the GUI. I've probably made a very silly mistake and I have attached the usdpst file in the hope that someone can point it out for me.

Thank you,

Kristin
Attachments
usdpst.f90
(12.55 KiB) Downloaded 288 times
Yvan Fournier
Posts: 4208
Joined: Mon Feb 20, 2012 3:25 pm

Re: Output mesh and writers

Post by Yvan Fournier »

Hello,

If I understand correctly, you problem may be solved by using the pstcat function inside usdpst in addition to the functions yo use. An example with pstcat (PoST-processing mesh CATegory) is provided in the reference example for usdpst.f90, near the end of the file (i.e. just after aliasses), though there is a typo (ipart = -3 should be replaced by ipart = 3).

Simply associate category -1 to the alias of mesh -1, and -2 to the alias of -2.

Best regards,

Yvan
Post Reply