Output the coordinates of the Inlet faces

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Gen
Posts: 17
Joined: Sat Sep 05, 2020 7:39 am

Output the coordinates of the Inlet faces

Post by Gen »

Dear code_saturne team,
Bonjour,

I would like to know how to output the coordinates of each point(actually faces) of the inlet plane.
I tried to use the point_coordinates of n_points, but n_points --> Local number of points, this way can only output values for a small part of the entry plane.

What are the corresponding global variables (in the C function)?

Code: Select all

cs_gnum_t n_g_elts = inlet->zone->n_g_elts;
How can I output the coordinates for the n_g_elts total points?

Any advice would be appreciated. Thank you very much in advance.

Best regards,
Gen
Yvan Fournier
Posts: 4208
Joined: Mon Feb 20, 2012 3:25 pm

Re: Output the coordinates of the Inlet faces

Post by Yvan Fournier »

Hello,

There are no global variables for this, beyond the metadata (number of elements).

To output the global info, the easiest solution is to generate an additional postprocessing sub-mesh (or restart location) for this. Otherwise, to do this in a user-defined function, you need some specific parallel operations, since the data can be distributed across multiple processors. You can check the example in src/user_examples/cs_user_extra_operations-nusselt_calculation.c for something similar.

Regards,

Yvan
Gen
Posts: 17
Joined: Sat Sep 05, 2020 7:39 am

Re: Output the coordinates of the Inlet faces

Post by Gen »

Hello Yvan,

Actually, I want to divide the inlet plane into different regions and then assign different velocity fluctuations values for each area. So, my original idea was to divide the inlet plane according to the point coordinates. Since there is no such global variable, could I use some functions like cs_selector_get_b_face_list to get every element information of the plane?

Besides, I tried to output the point coordinates using the SEM method, I find that the total number of output points(n_points) was always 820, no matter how many entities I defined. It seems that the local number is a fixed value. Perhaps, I thought, is it possible to increase this fixed value?

Thank you so much for everything.

Best regards,
Gen
Yvan Fournier
Posts: 4208
Joined: Mon Feb 20, 2012 3:25 pm

Re: Output the coordinates of the Inlet faces

Post by Yvan Fournier »

Hello,

Yes, you can use cs_selector_get_b_face_list with additional geometric criteria (for example) to select sub-zones.
You can also define your own virtual blocks and check for each face center in the main selection to which sub-block it belongs (assuming a division in rectangular sections), with a bit of programming in user-defined functions.

There are more complex examples for post-processing (see the recent addition of https://github.com/code-saturne/code_sa ... profiles.c), but this is probably not what you need.

Regarding the SEM point coordinates, I am not familiar enough with the method to provide an answer. I would need to check the code in more detail to explain this.

Best regards,

Yvan
Gen
Posts: 17
Joined: Sat Sep 05, 2020 7:39 am

Re: Output the coordinates of the Inlet faces

Post by Gen »

Hello Yvan,

Thank you sooo much for your help!I have solved my problem by doing a sum of all ranks.

Best regards,
Gen
Post Reply