weymouth / lily-pad

Real-time two-dimensional fluid dynamics simulations in Processing. Initiated by Dr G D Weymouth:
https://github.com/weymouth/
MIT License
161 stars 77 forks source link

two phase code always crashes for me. #9

Closed damian-666 closed 7 years ago

damian-666 commented 7 years ago

first i just uncomment the code so tat the two phase file does all the work. this usually gives a result. i needed to use the prior pix, to use the settings to set the size, in the middle of teh file like on the my last suggestested change

64 322 array out of bounds.

Field( Field b, int is, int n, int js, int m ){ this.n = n; this.m = m; a = new float[n][m]; btype = b.btype; bval = b.bval; for( int i=0; i<n; i++){ for( int j=0; j<m; j++){ a[i][j] = b.a[i+is][j+js]; }}

I would love it if a wave can eat a gulp air and it bubbles up..., or is sprayed out as the wave crashes.. while salf walter and refresh water or volcanic dust settles in ...i see this in REEF3d. vids on their site. wich is similar in setup.. the mesh based code in galerkin has got to be 10x better for the computational cost, but if its too hard to work with .. whats the use..

weymouth commented 7 years ago

Thanks for reporting this bug. It was a holdout from when the code was updated to run on Processing 3. I also found and removed some redundant code. I pushed up the new code, so you just need to pull to get the new version. The test simulation for TwoPhase is the classic dam-break; lots of air-gulping.

damian-666 commented 7 years ago

I tried your latest test code. so to get anything like water and air seems to me the next thing to try is algebraic multigrid as preconditioner

besides what i sent earlier , i have a few papers seems like what you have .. but i dont understand it well, was wondering if you thought it was worth a try. I have java versions somewhere too.. Let me know if i should find those but google might turn them up.. should i try to make a wave tank if the two phase can work?

i see the papers try to achieve* 1/800 density.*.. air in water, and seems we can get snow flakes in water and emergency bubbles. all say to use AMG +CG... or using spectral methods with various tricks..

http://www.hpcs.cs.tsukuba.ac.jp/~tatebe/research/paper/CM93-tatebe.pdf http://www.hpcs.cs.tsukuba.ac.jp/~tatebe/research/paper/CM93-tatebe.pdf

_http://ftp.demec.ufpr.br/CFD/bibliografia/MULTIGRID/Pereira_et_al_2006.pdf http://ftp.demec.ufpr.br/CFD/bibliografia/MULTIGRID/Pereira_et_al_2006.pdf_

https://www.google.co.id/search?q=The+multigrid+preconditioned+conjugate+gradient+method.&rlz=1C1PQHB_enID617ID617&oq=The+multigrid+preconditioned+conjugate+gradient+method.&aqs=chrome..69i57j0l2.615j0j7&sourceid=chrome&ie=UTF-8

I have some other code that does cut cell and conjugate gradient, which i plan for my mutli-density hot dust and ash and volcanic, one phase stormy sky. But, using just a conjugate gradient solver, But, it does not converge if i move the immersed paddle and the originators dont have the desired to fix it.

So... i might try to use lily pad for my air and water. I want to study it more and maybe help if i can.

They use AMG CG, and other solvers, with or without level sets..... but for my purpose to have full NS solve from top to bottom is important to that the bottom causes the wave to break. Also for surfing , the direction of the wave current at surface, as the wave breaks... is very important.. for lift.. the CIP method... http://repository.kulib.kyoto-u.ac.jp/dspace/handle/2433/63952 seems interesting to be to add detail to the surface..

Maybe later>>>> And there are a lot of spectral IB methods.. they use FFT for the pressure solve.. even in 2 phase

FFT for the pressure solve is the first stam paper i saw I can get a 1024x1024 grid. People say it wont work with IB, But the papers claim ( even peskin, using some tricks, that immersed bodies massless or not , or with a" twin" can be placed in there , maybe if the IB object is small or other conditions apply) its just a gas pressure solve , for air does not need to be exact.

There is mention of use of level sets, but if we can fix this, i have some relevant ideas. like using level sets on the bubble that emergy if Level of detail wants to show it. But .. i would like an uneven bottom to affect the breaking waves.. so using it for the surface would need to have the grid affect the level set, not merely advect the surface level set. I have also studied som CIP code.. ,.... I was hoping to reduce to 1D the surface but these go to 3d from 2d...

And i see vorton /flux / vof methods.

if you have the turbulence in there, maybe best to remove it...for now... im researching but there is too much to learn. i end up at infinite dimensional LIE groups and Riemann surfaces.. einstein level stuff...

thanks..

On Mon, Sep 5, 2016 at 5:26 PM, Dr Weymouth notifications@github.com wrote:

Thanks for reporting this bug. It was a holdout from when the code was updated to run on Processing 3. I also found and removed some redundant code. I pushed up the new code https://github.com/weymouth/lily-pad/commit/2d954cd8701187de896622ee2ddd4c9ed7be4a49, so you just need to pull to get the new version. The test simulation for TwoPhase is the classic dam-break; lots of air-gulping.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/weymouth/lily-pad/issues/9#issuecomment-244701066, or mute the thread https://github.com/notifications/unsubscribe-auth/AP_Lma84N3RZ8tCohz_mJJpZwDMcvuymks5qm-A8gaJpZM4Jv-mK .

damian-666 commented 7 years ago

Hello again Dr...

Lily Pad re: issue with two phase stability..

I'm back because my intuition tells me this code might be the best. I was looking at the free surface module, two phase and wondering if it is "code complete" or there is a todo list. What I don't see is any surface tension or tracking or special treatments as in CIP, VOF, or level set, cut cell with "ghost cells" or if the BDIM can resolve the air water boundary as it does the solid/ water ..

Could your code be used as a numerical wave tank with waves breaking due to the bottom bathymetry ( in 2d) and gulping air and affected by wind ( on shore is messy waves with less impact on breaking , offshore wind fills barrel shaped waves) .

  1. My main question is is the code currently complete with bugs, or if code from somewhere else should be merged, or if i'm looking for too much.. I am just now reading your paper about conservative VOF.

I was looking at wave code, numerical wave tank , and i ran across this mans work and he refers to Weymouth quite a bit.

https://github.com/melmi/aban2 i though you might want to take a look at it and see if it is something that was planned for lily pad.. i haven't tried it because i completely burned out at the moment, the code is linux oriented, have downed a terabyte of stuff , and still lack direction. But you might take a look at see if it is code might fits..

  1. Also, if I had time , should i try the other solver? putting AMG as a preconditioner for a conjugate gradient solver in there.

An application of Cartesian-grid and volume-of-fluid methods to numerical ship hydrodynamics http://oai.dtic.mil/oai/oai?verb=getRecord&metadataPrefix=html&identifier=ADP023891

I have seen good demos with coarse or adaptive, cartesian grids and good interpolation and interfacing techniques.

I have some FLIP code, and was going to try Nast2d.. but this Naval code i trust.

But the new stuff keep pouring in endlessly and I need some direction. I am willing to help on Lily pad if there are things you suggest I should try and if i find the time.

thanks.

On Mon, Sep 5, 2016 at 5:26 PM, Dr Weymouth notifications@github.com wrote:

Thanks for reporting this bug. It was a holdout from when the code was updated to run on Processing 3. I also found and removed some redundant code. I pushed up the new code https://github.com/weymouth/lily-pad/commit/2d954cd8701187de896622ee2ddd4c9ed7be4a49, so you just need to pull to get the new version. The test simulation for TwoPhase is the classic dam-break; lots of air-gulping.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/weymouth/lily-pad/issues/9#issuecomment-244701066, or mute the thread https://github.com/notifications/unsubscribe-auth/AP_Lma84N3RZ8tCohz_mJJpZwDMcvuymks5qm-A8gaJpZM4Jv-mK .

damian-666 commented 7 years ago

ok sorry to bug you but, i found the cVOF slosh tank, and i was wondering if the source is anywhere or if its already merged in lily pad. (the cVOF has a very well defined interface though) but ..its oil and water 0.9 to 1.. and i was wondering if we could do 1 to 100 or 1 to 10... the bubbles are nice... also i see other papers and i am interested in the velocity on the surface, for surfing.. the images that show the circles moving as depth increase, flattening, would be ideal. if i can help , with guidance, i might be able to solve something.

i see a recent paper on Galerkin or other interpolation methods, extrapolating a rough grid can give amazing sub-grid thin splash features with cut cells. only the interface is given more nodes based on curvature, entropy, and the grid is fixed ..

found it here they work if i down load the Jar files...

http://web.mit.edu/weymouth/www/

TITLE: An Application of Cartesian-Grid and Volume-of-Fluid Methods to Numerical Ship Hydrodynamics

wonder if these papers would help with the free interface or if it can be treated like a boundary, but ..with more surface tension..

Detailed Water with Coarse Grids: Combining Surface Meshes and Adaptive Discontinuous Galerkin

http://www.flow.kth.se/sites/flow.kth.se/files/TSZ-Book-ch-1-4.pdf

the CIP method..

or if this code is available .. http://www.sciencedirect.com/science/article/pii/S0021999109006974 http://www.ingentaconnect.com/content/sname/jsr/2005/ 00000049/00000002/art00002

An application of Cartesian-grid and volume-of-fluid methods to numerical ship hydrodynamics http://oai.dtic.mil/oai/oai?verb=getRecord&metadataPrefix=html&identifier=ADP023891

RANS Computational Fluid Dynamics Predictions of Pitch and Heave Ship Motions in Head Seas

thanks..

On Mon, Oct 3, 2016 at 10:06 AM, Damian Hallbauer < damian.hallbauer@gmail.com> wrote:

Hello again Dr...

Lily Pad re: issue with two phase stability..

I'm back because my intuition tells me this code might be the best. I was looking at the free surface module, two phase and wondering if it is "code complete" or there is a todo list. What I don't see is any surface tension or tracking or special treatments as in CIP, VOF, or level set, cut cell with "ghost cells" or if the BDIM can resolve the air water boundary as it does the solid/ water ..

Could your code be used as a numerical wave tank with waves breaking due to the bottom bathymetry ( in 2d) and gulping air and affected by wind ( on shore is messy waves with less impact on breaking , offshore wind fills barrel shaped waves) .

  1. My main question is is the code currently complete with bugs, or if code from somewhere else should be merged, or if i'm looking for too much.. I am just now reading your paper about conservative VOF.

I was looking at wave code, numerical wave tank , and i ran across this mans work and he refers to Weymouth quite a bit.

https://github.com/melmi/aban2 i though you might want to take a look at it and see if it is something that was planned for lily pad.. i haven't tried it because i completely burned out at the moment, the code is linux oriented, have downed a terabyte of stuff , and still lack direction. But you might take a look at see if it is code might fits..

  1. Also, if I had time , should i try the other solver? putting AMG as a preconditioner for a conjugate gradient solver in there.

An application of Cartesian-grid and volume-of-fluid methods to numerical ship hydrodynamics http://oai.dtic.mil/oai/oai?verb=getRecord&metadataPrefix=html&identifier=ADP023891

I have seen good demos with coarse or adaptive, cartesian grids and good interpolation and interfacing techniques.

I have some FLIP code, and was going to try Nast2d.. but this Naval code i trust.

But the new stuff keep pouring in endlessly and I need some direction. I am willing to help on Lily pad if there are things you suggest I should try and if i find the time.

thanks.

On Mon, Sep 5, 2016 at 5:26 PM, Dr Weymouth notifications@github.com wrote:

Thanks for reporting this bug. It was a holdout from when the code was updated to run on Processing 3. I also found and removed some redundant code. I pushed up the new code https://github.com/weymouth/lily-pad/commit/2d954cd8701187de896622ee2ddd4c9ed7be4a49, so you just need to pull to get the new version. The test simulation for TwoPhase is the classic dam-break; lots of air-gulping.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/weymouth/lily-pad/issues/9#issuecomment-244701066, or mute the thread https://github.com/notifications/unsubscribe-auth/AP_Lma84N3RZ8tCohz_mJJpZwDMcvuymks5qm-A8gaJpZM4Jv-mK .

damian-666 commented 7 years ago

​hello.. i am back to this.. just a quick thing on TWO PHASE i went to your earlier 1.0 code... and its better, but has different issues.. might be a clue ..

i changed a parameter in bold here below i think dt and gamma.... havent tried sloshing yet... but its clearly better.

the other solver wasn't stable when i tried...would love to see a numerical wave tank with a fairly steady wind on it but if this isn't the whole solution...or just part... i could use advice.

i wasn't sure if you were moving towards JS and that stream..and vortons...any ways..

seemst the surface tension seems inadequate to keep the air out..

curious about VOF code in java i couldnt find your source...

thanks.. too much code out there...i cant seem to get progress on my boats...

/** TwoPhase class

Extends BDIM by adding two-phase modeling

This means we need to track the free interface and apply the variable density to the pressure gradient

example code: **_/ TwoPhase flow; void setup(){ int n=(int)pow(2,7)+2, m=(int)pow(2,6)+2; flow = new TwoPhase(n,m,_1,001*); flow.f.eq(0,m,n,0,m); flow.u = new VectorField(n,m,0,0); } void draw(){ flow.update(); flow.update2(); flow.f.display(); }

void settings() { size(400,200); } class TwoPhase extends BDIM{ FreeInterface f,f0;

TwoPhase( int n, int m, float dt, Body body, float nu, boolean QUICK, float g, float gamma ){ super( n, m, dt, body, nu, QUICK); f = new FreeInterface( n, m, gamma ); f0 = new FreeInterface( n, m, gamma ); this.g.y = g; } TwoPhase( int n, int m, float dt, float g ){ this( n, m, dt, new CircleBody(0,0,0.,new Window()), 1, false, g, 0.1); }

void update(){ f.strang = (f.strang+1)%2; // strang operator splitting getRhoCoeffs(); f0.eq(f); f.advect( dt, u0 ); super.update(); } void update2(){ getRhoCoeffs(); f.eq(f0); f.advect( dt, u0, u ); super.update2(); } void getRhoCoeffs(){ rhoi.eq(f.rho().inv()); c.eq(del.times(rhoi.times(dt))); } }

On Mon, Oct 3, 2016 at 10:12 PM, Damian Hallbauer < damian.hallbauer@gmail.com> wrote:

ok sorry to bug you but, i found the cVOF slosh tank, and i was wondering if the source is anywhere or if its already merged in lily pad. (the cVOF has a very well defined interface though) but ..its oil and water 0.9 to 1.. and i was wondering if we could do 1 to 100 or 1 to 10... the bubbles are nice... also i see other papers and i am interested in the velocity on the surface, for surfing.. the images that show the circles moving as depth increase, flattening, would be ideal. if i can help , with guidance, i might be able to solve something.

i hired a student free to port Griebbels nast2d.. we might merge it if we can...

i see a recent paper on Galerkin or other interpolation methods, extrapolating a rough grid can give amazing sub-grid thin splash features with cut cells. only the interface is given more nodes based on curvature, entropy, and the grid is fixed ..

found it here they work if i down load the Jar files...

http://web.mit.edu/weymouth/www/

TITLE: An Application of Cartesian-Grid and Volume-of-Fluid Methods to Numerical Ship Hydrodynamics

wonder if these papers would help with the free interface or if it can be treated like a boundardy, but ..with more surface tension..

Detailed Water with Coarse Grids: Combining Surface Meshes and Adaptive Discontinuous Galerkin

http://www.flow.kth.se/sites/flow.kth.se/files/TSZ-Book-ch-1-4.pdf

the CIP method..

i have flying wings, balloon ships, stand up surfer creatures, swimmers, all this work i think would do great with a proper pressure solver, if my flying wing sinks and bubbles come out that would be amazing ( mabye smoke in the bubbles).

or if this code is available .. http://www.sciencedirect.com/science/article/pii/S0021999109006974 http://www.ingentaconnect.com/content/sname/jsr/2005/0000004 9/00000002/art00002

An application of Cartesian-grid and volume-of-fluid methods to numerical ship hydrodynamics http://oai.dtic.mil/oai/oai?verb=getRecord&metadataPrefix=html&identifier=ADP023891

RANS Computational Fluid Dynamics Predictions of Pitch and Heave Ship Motions in Head Seas

thanks..

On Mon, Oct 3, 2016 at 10:06 AM, Damian Hallbauer < damian.hallbauer@gmail.com> wrote:

Hello again Dr...

Lily Pad re: issue with two phase stability..

I'm back because my intuition tells me this code might be the best. I was looking at the free surface module, two phase and wondering if it is "code complete" or there is a todo list. What I don't see is any surface tension or tracking or special treatments as in CIP, VOF, or level set, cut cell with "ghost cells" or if the BDIM can resolve the air water boundary as it does the solid/ water ..

Could your code be used as a numerical wave tank with waves breaking due to the bottom bathymetry ( in 2d) and gulping air and affected by wind ( on shore is messy waves with less impact on breaking , offshore wind fills barrel shaped waves) .

  1. My main question is is the code currently complete with bugs, or if code from somewhere else should be merged, or if i'm looking for too much.. I am just now reading your paper about conservative VOF.

I was looking at wave code, numerical wave tank , and i ran across this mans work and he refers to Weymouth quite a bit.

https://github.com/melmi/aban2 i though you might want to take a look at it and see if it is something that was planned for lily pad.. i haven't tried it because i completely burned out at the moment, the code is linux oriented, have downed a terabyte of stuff , and still lack direction. But you might take a look at see if it is code might fits..

  1. Also, if I had time , should i try the other solver? putting AMG as a preconditioner for a conjugate gradient solver in there.

An application of Cartesian-grid and volume-of-fluid methods to numerical ship hydrodynamics http://oai.dtic.mil/oai/oai?verb=getRecord&metadataPrefix=html&identifier=ADP023891

I have seen good demos with coarse or adaptive, cartesian grids and good interpolation and interfacing techniques.

I have some FLIP code, and was going to try Nast2d.. but this Naval code i trust.

But the new stuff keep pouring in endlessly and I need some direction. I am willing to help on Lily pad if there are things you suggest I should try and if i find the time.

thanks.

On Mon, Sep 5, 2016 at 5:26 PM, Dr Weymouth notifications@github.com wrote:

Thanks for reporting this bug. It was a holdout from when the code was updated to run on Processing 3. I also found and removed some redundant code. I pushed up the new code https://github.com/weymouth/lily-pad/commit/2d954cd8701187de896622ee2ddd4c9ed7be4a49, so you just need to pull to get the new version. The test simulation for TwoPhase is the classic dam-break; lots of air-gulping.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/weymouth/lily-pad/issues/9#issuecomment-244701066, or mute the thread https://github.com/notifications/unsubscribe-auth/AP_Lma84N3RZ8tCohz_mJJpZwDMcvuymks5qm-A8gaJpZM4Jv-mK .