idies / Turbulence

7 stars 1 forks source link

spline for channel broken #2

Closed chichilalescu closed 9 years ago

chichilalescu commented 9 years ago

hi @KKanov,

there's something wrong with the spline interpolations for the upper half of the channel (i.e. ynode >256 or around). my guess is that when you compute the cell it's off by 1, and it's related to the passing from negative to positive values of y, but I may be wrong. In any case, above y = 0 the relative distance between my local implementation and the DB implementation grows from machine precision to around 1 (i.e. very wrong).

chichilalescu commented 9 years ago

oh, and since we're on the subject, I think it would be a good idea to implement M2Q16 instead of M2Q14. As you'll see in the plot at the end of http://nbviewer.ipython.org/github/idies/pyJHTDB/blob/develop/examples/test_divergence.ipynb, M2Q14 still has a divergence error comparable to FD4Lag4 (which is not truly surprising, but unpleasant nonetheless). In fact, once Charles and Greg see this plot, they may want to go to much higher values of q, at least in the y direction...

KKanov commented 9 years ago

Chichi,

Check to see if the spines work as you want for y >= 0 now.

chichilalescu commented 9 years ago

Sorry, it still looks bad on my end.

On 11/14/2014 12:22 PM, KKanov wrote:

Chichi,

Check to see if the spines work as you want for y >= 0 now.

— Reply to this email directly or view it on GitHub https://github.com/idies/Turbulence/issues/2#issuecomment-63098625.

Cristian Constantin Lalescu Postdoctoral Researcher Department of Applied Mathematics & Statistics 3400 North Charles Street The Johns Hopkins University Baltimore, Maryland 21218-2682 USA

chichilalescu commented 9 years ago

hold on, I think it's ok. I'll get back to you in 2 mins

chichilalescu commented 9 years ago

hm. are you still working on this? I see inconsistent results. the distances should be around 10^(-6), but I see much bigger distances for positive y anyway, here's a paste of my test code's output:

channel, around ynode 50 [0.024543693, 1.0921943] [-0.99280703, -0.86749905] [0.012271847, 0.17794177] The client library does not currently provide local implementations of the server-side functions for the channel flow dataset. Redirecting to the server... The client library does not currently provide local implementations of the server-side functions for the channel flow dataset. Redirecting to the server... average relative distance for ux between DB 104 and M1Q4 is 1.1004030398e-07 an example point is [ 0.50920731 -0.9811694 0.0734755 ], with the values 0.628641724586 (DB) and 0.628641784191 (local interpolation) average relative distance for uy between DB 104 and M1Q4 is 8.86121313215e-07 an example point is [ 0.50920731 -0.9811694 0.0734755 ], with the values 0.0301383696496 (DB) and 0.0301383715123 (local interpolation) average relative distance for uz between DB 104 and M1Q4 is 7.31194518266e-07 an example point is [ 0.50920731 -0.9811694 0.0734755 ], with the values 0.0996184870601 (DB) and 0.0996185019612 (local interpolation) average relative distance for dxux between DB 104 and M1Q4 is 3.21863785757e-06 an example point is [ 0.50920731 -0.9811694 0.0734755 ], with the values 0.0757671073079 (DB) and 0.0757697075605 (local interpolation) average relative distance for dyux between DB 104 and M1Q4 is 5.05393700223e-06 an example point is [ 0.50920731 -0.9811694 0.0734755 ], with the values 27.0914592743 (DB) and 27.0914402008 (local interpolation) average relative distance for dzux between DB 104 and M1Q4 is 4.15057911596e-06 an example point is [ 0.50920731 -0.9811694 0.0734755 ], with the values -14.1449556351 (DB) and -14.1449661255 (local interpolation) average relative distance for dxuy between DB 104 and M1Q4 is 1.88944488855e-06 an example point is [ 0.50920731 -0.9811694 0.0734755 ], with the values 0.219658002257 (DB) and 0.21965867281 (local interpolation) average relative distance for dyuy between DB 104 and M1Q4 is 1.91424260265e-06 an example point is [ 0.50920731 -0.9811694 0.0734755 ], with the values 4.29787111282 (DB) and 4.29786682129 (local interpolation) average relative distance for dzuy between DB 104 and M1Q4 is 1.51713345531e-06 an example point is [ 0.50920731 -0.9811694 0.0734755 ], with the values 0.823405921459 (DB) and 0.823409318924 (local interpolation) average relative distance for dxuz between DB 104 and M1Q4 is 2.12697318602e-06 an example point is [ 0.50920731 -0.9811694 0.0734755 ], with the values -0.129626750946 (DB) and -0.12962642312 (local interpolation) average relative distance for dyuz between DB 104 and M1Q4 is 2.30434261539e-06 an example point is [ 0.50920731 -0.9811694 0.0734755 ], with the values 7.42026424408 (DB) and 7.42026185989 (local interpolation) average relative distance for dzuz between DB 104 and M1Q4 is 1.49016170781e-06 an example point is [ 0.50920731 -0.9811694 0.0734755 ], with the values -3.90910887718 (DB) and -3.90910863876 (local interpolation) channel, around ynode 310 [0.024543693, 1.0921943] [0.15032499, 0.52374291] [0.012271847, 0.17794177] The client library does not currently provide local implementations of the server-side functions for the channel flow dataset. Redirecting to the server... The client library does not currently provide local implementations of the server-side functions for the channel flow dataset. Redirecting to the server... average relative distance for ux between DB 104 and M1Q4 is 4.5089818741e-05 an example point is [ 1.08795071 0.27827746 0.17436193], with the values 1.12666833401 (DB) and 1.12666833401 (local interpolation) average relative distance for uy between DB 104 and M1Q4 is 0.00112866517156 an example point is [ 1.08795071 0.27827746 0.17436193], with the values 0.0267164185643 (DB) and 0.0267164185643 (local interpolation) average relative distance for uz between DB 104 and M1Q4 is 0.000444449746283 an example point is [ 1.08795071 0.27827746 0.17436193], with the values 0.00833649747074 (DB) and 0.00833649653941 (local interpolation) average relative distance for dxux between DB 104 and M1Q4 is 0.000735350477044 an example point is [ 1.08795071 0.27827746 0.17436193], with the values 0.0802905187011 (DB) and 0.0802833214402 (local interpolation) average relative distance for dyux between DB 104 and M1Q4 is 0.0395004823804 an example point is [ 1.08795071 0.27827746 0.17436193], with the values -0.120187819004 (DB) and -0.120183326304 (local interpolation) average relative distance for dzux between DB 104 and M1Q4 is 0.000745841651224 an example point is [ 1.08795071 0.27827746 0.17436193], with the values -0.115047983825 (DB) and -0.115098953247 (local interpolation) average relative distance for dxuy between DB 104 and M1Q4 is 0.000463739415864 an example point is [ 1.08795071 0.27827746 0.17436193], with the values 0.126165255904 (DB) and 0.12616507709 (local interpolation) average relative distance for dyuy between DB 104 and M1Q4 is 0.0276357922703 an example point is [ 1.08795071 0.27827746 0.17436193], with the values 0.039229363203 (DB) and 0.0392291881144 (local interpolation) average relative distance for dzuy between DB 104 and M1Q4 is 0.000601025763899 an example point is [ 1.08795071 0.27827746 0.17436193], with the values 0.144008845091 (DB) and 0.144009232521 (local interpolation) average relative distance for dxuz between DB 104 and M1Q4 is 0.000568926916458 an example point is [ 1.08795071 0.27827746 0.17436193], with the values 0.0439918674529 (DB) and 0.0439918227494 (local interpolation) average relative distance for dyuz between DB 104 and M1Q4 is 0.023113258183 an example point is [ 1.08795071 0.27827746 0.17436193], with the values -0.0613952167332 (DB) and -0.0613952837884 (local interpolation) average relative distance for dzuz between DB 104 and M1Q4 is 0.000930628506467 an example point is [ 1.08795071 0.27827746 0.17436193], with the values -0.118376880884 (DB) and -0.118376970291 (local interpolation)

chichilalescu commented 9 years ago

ok, looking good now for M1Q4 and M2Q8. testing M2Q14

chichilalescu commented 9 years ago

test for M2Q14 is ok as well. I guess you're ready to commit now

KKanov commented 9 years ago

Hmm, that's a little strange as I actually haven't changed anything between the first message I sent and now, but now I'm wondering whether I actually deployed the code to the DBs. I did certainly deploy at some point, so maybe the change I made went in then.

The issue I think was that because of the symmetry around the center line we are rounding to different points in order to keep the kernels symmetric, you might remember there was a discussion with Jason about this. I suppose you don't really care about this and are always taking the "lower" point. Nevertheless, this is the change that I made to kind of ignore the center line for the splines options.

On Fri, Nov 14, 2014 at 2:03 PM, Cristian C Lalescu < notifications@github.com> wrote:

test for M2Q14 is ok as well. I guess you're ready to commit now

— Reply to this email directly or view it on GitHub https://github.com/idies/Turbulence/issues/2#issuecomment-63112812.

chichilalescu commented 9 years ago

ok, so I was talking to the server, not to you. in any case, it's working now. after you commit the change, I'll run my tests again, and then we can close the issue. or you may as well put "Fixes #2" in the commit message, and the issue is going to be closed automatically.