Tangential velocity

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Robert
Posts: 26
Joined: Mon May 22, 2017 11:14 am

Tangential velocity

Post by Robert »

Hello everyone,

I made a simple cylinder and i'm trying to put a tangential velocity on the inlet. I only used the GUI and i wrote the equations to transform the cartesian to cylindrical coordinates in the user profile direction but my fluid doesn't enter with the specificed angle all around the inlet as you can see in the attached figure. I would be grateful if you could help me with an example to understand how does it work or, if i have to modify a subroutine, which one do I have to modify.

Best regards,
Robert
Attachments
1.png
Luciano Garelli
Posts: 284
Joined: Fri Dec 04, 2015 1:42 pm

Re: Tangential velocity

Post by Luciano Garelli »

Hello

Could you post the equations that you set in the inlet and give additional information about your problem in order to understand what are you solving.

Regards

Luciano
Robert
Posts: 26
Joined: Mon May 22, 2017 11:14 am

Re: Tangential velocity

Post by Robert »

Hello, thank you for your interest.
Those are the settings i wrote in user profile: x=1;
y=1;
z=10;
r=sqrt(x^2+y^2);
o=atan(y/x);
a=(60/360)*2*pi;
V=1;
vt=V*cos(a);
vr=V*sin(a);
dir_x = -vt*sin(o)-vr*cos(o);
dir_y = vt*cos(o)-vr*sin(o);
dir_z =0;

What i'm trying to do is to impose a certain angle to the velocity on inlet as there would be some guide vanes upstream the inlet. Attached you have setup.xml file, the geometry made in salome ( you have to change Test.XML to Test.hdf, it didn't let me to upload .hdf file) and a picture of how i would like the velocity to enter all around the inlet. Let me know if you can't open the geomtry file and i will do some screenshots.

Regards,
Robert
Attachments
Test.XML
(2.4 MiB) Downloaded 338 times
1.png
(17.82 KiB) Not downloaded yet
setup.xml
(6.98 KiB) Downloaded 335 times
Luciano Garelli
Posts: 284
Joined: Fri Dec 04, 2015 1:42 pm

Re: Tangential velocity

Post by Luciano Garelli »

Hello,

If you specify the velocity direction using a user profile, for each boundary face you can access to the (x,y,z) coordinate of the face center, so with this information you can set

Code: Select all

r=sqrt(x^2+y^2);
dir_x = -y/r;
dir_y = x/r;
dir_z =0;
This will give you an anti-clockwise tangential velocity. When you check the velocity field you have to take into account that the velocities are shown at the cells center and not at the face center.
veloc.jpg
Regards,

Luciano
Robert
Posts: 26
Joined: Mon May 22, 2017 11:14 am

Re: Tangential velocity

Post by Robert »

It looks great! But i tried to follow you instructions and it seems I can't make it( as you can see attached). If it's not too much, could you please share your setup file? And I would be grateful if you could explain step by step how did you make the velocity field. I tried to apply cell centers filter to the extract block-fluid domain filter but when i apply the glyph I can't see anything and I can't even choose vector or scalars.
And another question, is it possible to declare a vector? For example i want "a" to take values from 0 to 360 and so on.

Thanks for your time.

Regards,
Robert
Attachments
1.png
Luciano Garelli
Posts: 284
Joined: Fri Dec 04, 2015 1:42 pm

Re: Tangential velocity

Post by Luciano Garelli »

Hello,

I attach the setup, results and a state file to load in Paravis. Yo don't need to apply a cell center/extract block filters. Only with a slice an a glyph is enough.

Where do you want to declare a vector?? Paravis or Saturne?

Regards,

Luciano
Attachments
RESU.tar.gz
(1.18 MiB) Downloaded 311 times
Robert
Posts: 26
Joined: Mon May 22, 2017 11:14 am

Re: Tangential velocity

Post by Robert »

Hello,

I would like to add the vector in code_saturne. And about the visualisation in Paraview, i usually apply an extract block- fluid domain-> cell data to point. I will try to apply directly cell points. Thanks a lot!

Regards,
Robert
Robert
Posts: 26
Joined: Mon May 22, 2017 11:14 am

Re: Tangential velocity

Post by Robert »

Hello,

I managed to fix the angle for the previous case but now I have another question. Let's say that we have a simple cylinder ( Figure 1) and this time the inlet is the one shown with red. Is there any way to set a volumic flow rate as boundary condition and to input an angle A as shown in Figure 2 using the user profile? So far I managed to control the angle but in the axial direction( z axis) and I want to control it in (x,y) plan in order to get a swirl.

Thank you,
Robert
Figure 1
Figure 1
2.png
Figure 2
(7.72 KiB) Not downloaded yet
Yvan Fournier
Posts: 4209
Joined: Mon Feb 20, 2012 3:25 pm

Re: Tangential velocity

Post by Yvan Fournier »

Hello,

No, there is currently no alternative to this than using user subroutines (cs_user_boundary_conditions.f90). I'll need to check if we already have examples for swirls in the Doxygen documentation, and possibly add one, as inlets with swirls are a (moderately frequently) recurring question...

In any case, if there is no example (have not checked), I could send you a old example, which should still need improvement.

Best regards,

Yvan
Robert
Posts: 26
Joined: Mon May 22, 2017 11:14 am

Re: Tangential velocity

Post by Robert »

Hello,

Thank you for the answer. Anything is helpful, it doesn't matter if it's a bit old. Let me know if you need my mail adress.

Best regards,
Robert
Post Reply