Freezing mesh coordinates in deformed condition

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

Freezing mesh coordinates in deformed condition

Post by Luca »

Dear all,

in order to perform studies of the aerodynamic behaviour of objects at different angles of attack it would be extremely useful to use the ALE module to deform the mesh and then deactivate it leaving the mesh in deformed condition. The deactivation of the ALE module is needed to save 'a lot' of useless computational time.

If I deactivate the ALE module during the calculation a fatal error occurs. If I save the deformed condition and restart the calculation deactivating the ALE module the undeformed condition is restored.

Does anybody have a workaround?

Thank you for your help!
Luca

Freezing mesh coordinates in deformed condition

Post by Luca »

PS: When in the GUI the user edits the ALE module options (like the mesh viscosity), the writer switches automatically to FIXED COORDINATES. I tried to log in in Mantis to report the bug but I couldn't log in.
Yvan Fournier
Posts: 4208
Joined: Mon Feb 20, 2012 3:25 pm

Re: Freezing mesh coordinates in deformed condition

Post by Yvan Fournier »

Hello,

Which version of the code are you using ?

Yvan
Luca

Re: Freezing mesh coordinates in deformed condition

Post by Luca »

Hi Yvan,

thank you as usual for your quick replies! I'm using CS 2.2.0

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

Re: Freezing mesh coordinates in deformed condition

Post by Yvan Fournier »

Hello,

The GUI bug should minor: i.e. you can switch back to transient coordinates (We'll check and fix this bug in version 3.0, but it won't be a priority for 2.2).

In any case, I recommend upgrading 2.2.0 to 2.2.3, to avoid another output bug (missing displacements in postprocessing).

There is no option to do exactly what you are trying to do (read frozen coordinates), but you could do this by reading the vertex coordinates in the cs_user_mesh_modify() subroutine (in cs_user_mesh.c). In addition to the examples in that file, you will need to look at the cs_mesh_structure in src/mesh/cs_mesh.h (actually, only the vtx_coords array of the cs_glob_mesh structure need to be updated with read values), and use the functions defined in src/base/cs_restart.h (cs_restart_create to open, cs_restart_read_section to read the 'deplact_x_no', 'deplact_y_no', and 'deplact_z_no' 1D arrays on mesh location 4, and cs_restart_destroy to close the file).
You will need to copy those independent arrays intot the (interleaved) cs_glob_mesh->vtx_coords array.

I'll let you start on the coding if you choose to do this (it should only require about 20-30 lines of code in cs_user_mesh_modify), but I can check your code once you've started on it if you choose.

Regards,

Yvan
Luca

Re: Freezing mesh coordinates in deformed condition

Post by Luca »

Thank you Yvan,

I will finish developing the strictly necessary routine and then I will start coding to increase speed. I hope I will be able to find my way!

Thanks for the great support!
Luca
Post Reply