Moving Boundaries

Issues and examples using this model (available in the Models Repository)

Moving Boundaries

Postby brandon.w.maryatt on Wed Feb 09, 2011 1:37 pm

Hi all,

I'm having trouble with moving boundaries (in Blender, colored RGB(r,0,0) where r=[0,1[ . I use RGB(0,0,0)). My moving boundaries were originally not moving and letting fluid pass through them, but I fixed the latter problem. Now they just won't move. I've tried basic Blender geometries like a sphere, a wall inside a box, etc. but nothing has worked. I've tried both the linear movement and sinusoidal movement pre-set options. I'm using Dalrymple boundary conditions, and in Blender I'm performing the three commands on all my mesh objects (ctrl+A,1 ; shift+c; center cursor). Does anyone know what else I could try?

Thanks,
Brandon
brandon.w.maryatt
 
Posts: 6
Joined: Tue Jan 25, 2011 9:40 am

Re: Moving Boundaries

Postby arnom on Wed Feb 09, 2011 1:53 pm

Hey Brandon,

there was a problem with boundaries not moving. This should however be fixed with the latest release. Are you sure that you have upgraded to v2.2.1?

If you did and it still does not work, try compiling with -O0 instead of -O3 and get back to me.

Best regards,
Arno
arnom
 
Posts: 54
Joined: Tue Mar 03, 2009 10:48 am
Location: Manchester, UK

Re: Moving Boundaries

Postby brandon.w.maryatt on Wed Feb 09, 2011 2:01 pm

Thanks for the quick reply Arno! I'll check it and get back to you tomorrow.

Some more information:

SPHysics is writing to the MULT_MV file correctly, but when I visualize the results in MATLAB and I go look at the PART files the fourth, fifth and sixth columns (velocities ux, uy and uz) are listed as 0.000000 for all the boundary particles. This is the case for all PART files in the simulation. This happens even when I try something simple, similar to Case9, where a gate makes a linear movement in one direction.
brandon.w.maryatt
 
Posts: 6
Joined: Tue Jan 25, 2011 9:40 am

Re: Moving Boundaries

Postby brandon.w.maryatt on Fri Feb 11, 2011 12:44 pm

Hi Arno,

I've upgraded to v2.2.1 . I wasn't able to run any of my own external file (Blender) simulations so I compiled with -O0 and then I was able to run simulations (pre-packaged cases worked fine). My setup is a 1m radius sphere (centered at (1,1,1)) with moving boundary conditions, with a cube of fluid inside the sphere. I set the sphere to move in the x-direction at a speed of 2 m/s, and it does move. However, I have two new problems:

1.) There appears to be an invisible wall at the x=2m mark. Any part of the sphere that has passed through the wall disappears. Additionally, fluid that flows through the invisible barrier disappears and is thrown out by SPHysics (when compiling I get many errors regarding particles out of limits).

2.) It appears that 2 m/s is too fast for the fluid particles to keep up. The sphere moves at 2 m/s and a lot of the fluid particles pass through the sphere's walls as if they are not moving fast enough and are being left behind. The sphere moving at a slower speed, like 0.3 m/s, does not show this problem. Is there a speed limit to boundaries in SPHysics?

I'll send you an email now with images of what I'm talking about (I'm not allowed to attach .fig files to this message).
brandon.w.maryatt
 
Posts: 6
Joined: Tue Jan 25, 2011 9:40 am

Re: Moving Boundaries

Postby arnom on Sun Feb 13, 2011 5:51 am

Hi Brandon,

Do I understand you correctly. Even with 2.2.1 you could not run your own cases except if you compiled with -O0? (If this is true I recommend you also try -O1 and -O2 to obtain better efficiency.)

Ad 1.) I guess your sphere is initially 2m wide. That means that xmax, zmax are set to 2 respectively. The problem is that SPHysics needs to know how large the domain of computation is going to be. In case of linear movement this is not predicted (consider a gate that moves upwards. It is not of interest what happens to it once it goes over zmax.) Now of course things are different in your case and I did not consider something like this. I will send you a file that should allow you to enter your own limits. Others that are interested see code at the end of this post. Note that I have not tested it and I kindly ask you to do that for me as my time is a bit limited at the moment.

Ad 2.) Yes it can happen that movements are too fast. What I can recommend is either set the speed of sound higher or use an accelerating movement (use the movement file option for this for example).

Hope I could sort out these issues now. I'm sorry that you have so many problems, but a program of that allows such a wide array of applications is difficult to test for every possible flaw so thanks for your patience.

Best regards,
Arno




________________

In external_file.f add the following at line 525:

write(*,*) ' Enter own limits? (0=No,1=Yes)'
read(*,*) i
write(*,*) i
if(i.eq.1)then
write(*,*) ' Enter xmin,xmax'
read(*,*) mv_xmin, mv_xmax
write(*,*) ' Enter ymin,ymax'
read(*,*) mv_ymin, mv_ymax
write(*,*) ' Enter zmin,zmax'
read(*,*) mv_zmin, mv_zmax
if(mv_xmin.gt.mv_xmax)then
t = mv_xmin
mv_xmin = mv_xmax
mv_xmax = t
endif
if(mv_ymin.gt.mv_ymax)then
t = mv_ymin
mv_ymin = mv_ymax
mv_ymax = t
endif
if(mv_zmin.gt.mv_zmax)then
t = mv_zmin
mv_zmin = mv_zmax
mv_zmax = t
endif
write(*,*) ' Final limits '
write(*,*) 'x:',mv_xmin,mv_xmax
write(*,*) 'y:',mv_ymin,mv_ymax
write(*,*) 'z:',mv_zmin,mv_zmax
endif
arnom
 
Posts: 54
Joined: Tue Mar 03, 2009 10:48 am
Location: Manchester, UK

Re: Moving Boundaries

Postby brandon.w.maryatt on Tue Feb 15, 2011 11:11 am

Hi Arno,

Yes, that's correct about the -O0. This is the case even with a clean install, however my coworker can run the same cases with -O3. I'm not sure what the problem is, but with -O0 it works for me.

Regarding inputting the size of the domain, I expected that might be the case. I implemented the new external_file.f and modified the Case##.txt file to match but the invisible barrier is still there. When I try and run the case with the Linear movement option the sphere still disappears through the invisible wall and the fluid goes with it. When I try and run the case with the Sinusoidal movement option the simulation won't complete, giving me an error. I seem to get the same error with different numbers:

*When I don't select my own limits, or when I select my own limits and some of the limits are 0:
ERROR in divide_3D.f
ii.lt.1
itime 1370
kind_p 1
nplink_max 300
n_start,n_end 0 2878
k 0
xp(k), yp(k), zp(k) -0.38637781 0.0000000 0.0000000
icell, jcell, kcell 0 1 1
Box ii 0
nc(ii,kind_p) 343

*When I select my own limits and some of the limits are negative (here, I used -1 and 5 for x, -1 and 3 for y, -1 and 3 for z):
ERROR in divide_3D.f
ii.lt.1
itime 1290
kind_p 2
nplink_max 300
n_start,n_end 2879 4208
k 4096
xp(k), yp(k), zp(k) NaN NaN NaN
icell, jcell, kcell -2147483647 -2147483647 -2147483647
Box ii -2147483647
nc(ii,kind_p) 0


Using the debugger for the Case with the second error message, I found that in divide_3D.f my variables have the following values which together give me an ii < 1 (and the error):
dx = -0.320442945
dy = 0.0659348667
dz = 0.0659348667
one_over_2h = 3.13777304
icell = 0
jcell = 1
kcell = 1
ncx = 7
nsheet = 49
ii = 0


However I'm not sure what roles these play, what values they should be or how to fix them. Do you have any ideas? With a code such as this that can be adapted for so many purposes I didn't expect it to be able to do exactly what I needed right away. At least we're making progress!

Thanks,
Brandon
brandon.w.maryatt
 
Posts: 6
Joined: Tue Jan 25, 2011 9:40 am

Re: Moving Boundaries

Postby arnom on Thu Feb 17, 2011 3:28 pm

Hi Brandon,

for now I will say that this divide error is the result of something else going horribly. I am currently quite busy so my free time is a bit limited. Anyhow please send me your Case* file as well as the *.blend so that I can reproduce your setup. Please also attach the INDAT file. I will have a look at it on Sunday.

Best regards,
Arno
arnom
 
Posts: 54
Joined: Tue Mar 03, 2009 10:48 am
Location: Manchester, UK

Re: Moving Boundaries

Postby arnom on Sat Feb 19, 2011 4:08 pm

Hi Brandon,

I found the first bug. In getdata_3D.f remove lines 832 - 876. Then you should be able to use the custom limits. This is a general bug not related to custom limits.

There is something else going wrong with sinusoidal movement. I will get back to you as soon as I figure it out. You should be able to use custom limits though.

Best,
Arno
arnom
 
Posts: 54
Joined: Tue Mar 03, 2009 10:48 am
Location: Manchester, UK

Re: Moving Boundaries

Postby arnom on Sat Feb 19, 2011 4:54 pm

And I got a second bug as well. I described the fix in the Blender FAQ thread. To avoid you some hassle I also sent you the corrected file via mail.

It should at least remove some very obvious problems. I haven't actually tested it with SPHysics itself. So please do that for me and in case there are any persistent errors I will have a more thorough look. I'm actually quite surprised at this stage that the code ever worked ;)

Best regards,
Arno
arnom
 
Posts: 54
Joined: Tue Mar 03, 2009 10:48 am
Location: Manchester, UK

Re: Moving Boundaries

Postby mhadishabani on Fri Jul 17, 2015 9:03 pm

Hi Brandon,

I'm having trouble with moving boundaries too; I don’t know why fluid particles penetrate moving boundaries. I made many attempts, but none of them worked; moreover I applied the changes Arno wrote in “FAQ Blender Add-On” post of sphysics forum, and those were unsuccessful too.
How did you fix your problem?!

Many thanks in advance for your helps.

Regards,
Hadi
mhadishabani
 
Posts: 1
Joined: Thu Feb 12, 2015 9:57 am


Return to SPHysics User Discussions

Who is online

Users browsing this forum: No registered users and 5 guests

cron