Extrude terrain in code_saturne

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
benoit_wmr
Posts: 3
Joined: Wed Apr 08, 2020 10:20 am

Extrude terrain in code_saturne

Post by benoit_wmr »

Hello all,

I carry out athmospheric simulations on the scale of an urban district and I have difficulties in managing the DEM (digital elevation model).
I would like to be able to extrude the terrain directly in code_saturne. Is it possible?

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

Re: Extrude terrain in code_saturne

Post by Yvan Fournier »

Hello,

It may be possible, but tricky. You can define an extrusion in code_saturne (with fine, local control if you define it ysing user-defined functions), but this extrusion usually adds cells outside the domain. So in your case, you could manage that using an initial 3d mesh which is some distance above the highest point in the ground, and then extrude that towards the ground, using your DEM to compute the correct extrusion.

You still need to read your elevation model, and then interpolate it to the bottom surface of the mesh. The interpolation can be handled with built-in utilities (ple_locator API par parallel to parallel, or simply fvm_point_location API for a parallel code_saturne mesh with a DEM duplicated on all processes), once you have written the code to read the DEM model in a user-defined function.

Regards,

Yvan
benoit_wmr
Posts: 3
Joined: Wed Apr 08, 2020 10:20 am

Re: Extrude terrain in code_saturne

Post by benoit_wmr »

Hello,

Thank you for your advice. It seems to work, but there is a problem: I will get a "stair step" relief using this method. Do you think there is a solution to this problem?

Regards

Benoît
Yvan Fournier
Posts: 4222
Joined: Mon Feb 20, 2012 3:25 pm

Re: Extrude terrain in code_saturne

Post by Yvan Fournier »

Hello,

Could you post a image (zoomed if necessary) describing the issue ?

Since the extrusion API allow both a "high level" and "low level approach", the problem can probably be solved using the low-level approach if necessary, but it may require a bit of extra algorithmic work (adapting the number of layers to the height).

Best regards,

Yvan
benoit_wmr
Posts: 3
Joined: Wed Apr 08, 2020 10:20 am

Re: Extrude terrain in code_saturne

Post by benoit_wmr »

Hello,

Thanks for your answer.
Here is an image describing the issue.
Another problem exposed on the image is that the surface separating two contiguous extrusions remains in place...
I also join the fonction cs_user_mesh_modify (extract from file cs_user_mesh-modify.c)

Best regards

Benoît
Attachments
cs_user_mesh_modify.c
(4.37 KiB) Downloaded 215 times
MicrosoftTeams-image.png
MicrosoftTeams-image (1).png
Post Reply