free surface not moving

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
olivier_g
Posts: 7
Joined: Tue Oct 18, 2016 11:02 am

free surface not moving

Post by olivier_g »

Hello,

I am using code saturne 4.0.6 on Ubuntu 16-04.
I simply tried to reproduce the test of the solitary wave (i.e modeling a 2D tank test and imposing a velocity field at the inlet via cs_user_boundary_conditions_ale.f90) to check if the free surface boundary condition from the GUI was working.
The solver is running but when visualizing the results with Paravis I cannot see any motion of the free surface. It seems that I have missed something here.

Note that I did not set up any additional fluid velocity boundary condition on the free surface via a user subroutine, contrary to what is explained in the user guide, because I am not sure if it is included or not by default when using "free surface" with the GUI.

Thanks in advance for your help!

Olivier
Attachments
solitary_wave.xml
(7.91 KiB) Downloaded 393 times
tank_test.txt
mesh (universal ideas; to be renamed with .unv)
(8 MiB) Downloaded 285 times
cs_user_boundary_conditions_ale.f90
subroutine that imposes the velocity field
(7.46 KiB) Downloaded 289 times
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: free surface not moving

Post by Yvan Fournier »

Hello,

Did you check if there is a vertices-based array for mesh displacement under ParaView ?

Regards,

Yvan
olivier_g
Posts: 7
Joined: Tue Oct 18, 2016 11:02 am

Re: free surface not moving

Post by olivier_g »

Hello,

Thanks Yvan for your quick reply! Yes there is indeed a displacement array, based on vertices, in the Paravis output, but it shows zero displacement magnitude. I tried to use the "warp by vector" filter as well, but still no motion.
I guess it is not a matter of visualization (still I might be wrong), but more of boundary conditions?
olivier_g
Posts: 7
Joined: Tue Oct 18, 2016 11:02 am

Re: free surface not moving

Post by olivier_g »

Hello,

Did anyone manage to download my example and can tell me what's wrong with the model, why I cannot see any motion of the free surface? As already explained before, I presume it could be something to add in the user subroutine related to the boundary condition, but I don't know what.
Another way to help me could be to send me an example of model with a moving free surface, so that I can compare with mine.

Thanks in advance for your help! I am really struggling with this for quite a few days now... I hope that some users have already delt with such problem...
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: free surface not moving

Post by Yvan Fournier »

Hello,

I don't have much time to look into this in right now, but here is a test case in which the sliding mesh works (for version 4.0).

Best regards,

Yvan
Attachments
VALVE.tar.gz
(292.92 KiB) Downloaded 274 times
olivier_g
Posts: 7
Joined: Tue Oct 18, 2016 11:02 am

Re: free surface not moving

Post by olivier_g »

Hi Yvan,

Sorry for late reply. Still working on this topic :)
First of all thanks for the interesting example, which is unfortunately not using the "free surface" boundary condition, but still could be useful somehow in the future.
After digging into the src of code_saturne, I found out that the kinematic boundary condition of the free surface (ifresf), the one which will give the mesh velocity, is well calculated in alelav.f90, through variables pimpv(i), and the information stored thanks to "set_dirichlet_vector".
Then in my understanding, subroutine "alemav", via the "aledis" subroutine, should use this information about the mesh velocity and transform it into displacement of the nodes. Which is obviously not done in my case.
I will try to install the debug version of code_saturne to check the status of the relevant variables in alelav, alemav and aledis to understand why the calculated mesh velocity does not lead to displacement of the nodes.

Meanwhile, if you have anything new that could help me, I would of course be glad to hear from you!

Olivier
Luciano Garelli
Posts: 280
Joined: Fri Dec 04, 2015 1:42 pm

Re: free surface not moving

Post by Luciano Garelli »

Hello olivier,

I was looking at your problem. First of all, I couldn't run but I found some issues in the user subroutine.

1) You have a

Code: Select all

if (.false.) then 
before the boundary selection.

2)

Code: Select all

 call getfbr('5', nlelt, lstelt) 
any of your baundaries has this ('5') indentifier.

3) The axis of your mesh are not setted like in this reference (http://cfd.mace.manchester.ac.uk/twiki/ ... _COZZI.pdf), so I think that this line

Code: Select all

DWDZ * cdgfbo(3,ifac) should be [DWDZ * (cdgfbo(2,ifac) +5)
in order to use and translate the Y axis.

These are my comments by now...I will let you know if I have any progress.

Regards,

Luciano
olivier_g
Posts: 7
Joined: Tue Oct 18, 2016 11:02 am

Re: free surface not moving

Post by olivier_g »

Hi Luciano,

Thanks for your post. I agree with the 3 items you have mentionned - there were mistakes in my initially posted user subroutine. I already fixed it as well some time ago; I could have uploaded the updated subroutine, but since it does not change the fact that the free surface does not move, I did not do it. The fluid velocity after the inlet is ok, I can check it with paraview, but no motion of the free surface.

Have you noticed the same thing (I guess you have tried to run this solitary wave model), and have you any example of model with a moving free surface?

Thanks!

Olivier
Luciano Garelli
Posts: 280
Joined: Fri Dec 04, 2015 1:42 pm

Re: free surface not moving

Post by Luciano Garelli »

Hello Olivier,

Please, next time post the updated subroutine

Whe you mentioned that you "digging" the alelav.f90, did you debug or printed the values of pimpv(i) for any face??. Because I debugging (printing) the data in alelav.f90 and I don't get any face that satisfied the condition

Code: Select all

if (ialtyb(ifac).eq.ifresf) then
So, no pimpv() velocity is computed.

Regards,

Luciano
olivier_g
Posts: 7
Joined: Tue Oct 18, 2016 11:02 am

Re: free surface not moving

Post by olivier_g »

Hi Luciano,

Yes, next time I will post the updated subroutine, sorry about that.
By "digging into" I simply meant that I tried to understand how and where the free surface boundary condition was treated in the src.
I wanted as well to install a debugging version to check why the mesh velocity was not well calculated/or does not lead to a mesh displacement, but could not do it yet (my workstation being under repair for a few days). But it seems you have already done it: thanks for that!

So according to you none of the boundary faces is marked with the "ifresf" keyword?? Strange since I am using the GUI to assign "free surface" condition to the relevant faces. Could it be that it is instead a problem of numbering of the faces? I see that the loop we are talking about in alelav.f90, to calculate and assign pimpv(), is being done for ifac = 1 to nfabor.

Should we understand that to work properly then, the boundary faces should have a continuous numbering from 1 to nfabor (which is of course not the case with my mesh, which I have created with Salome)? Or there is kind of a automatic re-numbering of the faces in the preprocessor which is not done correctly there?

Olivier
Post Reply