Call the rotational axis and rotational velocity in user_subrutine in C

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
hyder4
Posts: 22
Joined: Tue Apr 04, 2023 12:06 am

Call the rotational axis and rotational velocity in user_subrutine in C

Post by hyder4 »

Dear Developers,

I am using frozen rotor model and I want to call the rotation axis and velocity from GUI to my user subrutine in C.
what function should I use? Thanks!

Kind regards,
Hyder.
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: Call the rotational axis and rotational velocity in user_subrutine in C

Post by Yvan Fournier »

Hello,

Check the Doxygen documentation for cs_rotation.c.

When running a turbomachinery case, rotation 0 matches the stator, and each subsequent rotation id matches the rotors, in order of declaration, so if you defined a single rotor in the GUI, simply access it as rotation 1 with the functions from cs_rotation.c/h.

Best regards,

Yvan
hyder4
Posts: 22
Joined: Tue Apr 04, 2023 12:06 am

Re: Call the rotational axis and rotational velocity in user_subrutine in C

Post by hyder4 »

Hello,
Got it, thank you.
May I also ask how can I call rotation velocity and axis if I am using Coriolis source term option in body force in GUI?
Best,
Hyder.
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: Call the rotational axis and rotational velocity in user_subrutine in C

Post by Yvan Fournier »

Hello,

If you are using the Coriolis source term, the whole domain is in rotation, which matches rotation id 0 (in C).

The logic is then the same as for turbomachinery.

Note that I do not know if Coriolis + turbomachinery are compatible, as we do not consider compostion of rotations. I believe that would be possible with "not too complicated" adjustments, but the combination would probably provide incorrect results today.

Best regards,

Yvan
hyder4
Posts: 22
Joined: Tue Apr 04, 2023 12:06 am

Re: Call the rotational axis and rotational velocity in user_subrutine in C

Post by hyder4 »

Hi,
Got it, thanks.
Best,
Hyder.
Post Reply