carlosrosales / mplabs

Multiphase Lattice Boltzmann Suite
GNU General Public License v3.0
16 stars 11 forks source link

problems in collision and streaming process of ZSC model #1

Closed PokerN closed 8 years ago

PokerN commented 8 years ago

Hi, I've downloaded your code, and learned a lot of skills from your work. So thank you for your sharing. However, when I read the collision and stream part, I found there may be something different from the original algorithm. Details : The original order parameter LB equation is :

zsc_eq1

Your implementation:

     Af1 = 0.5D0*Gamma*muPhi
     Af0 = -2.D0*Gamma*muPhi
     Cfp = invEta2*phin
     f(i,j,0,nxt) = f(i,j,0,now) + invTauPhi*( Af0 + phin   - f(i,j,0,now) ) 
     f(i,j,1,now) = f(i,j,1,now) + invTauPhi*( Af1 + Cfp*ux - f(i,j,1,now) )
     f(i,j,2,now) = f(i,j,2,now) + invTauPhi*( Af1 + Cfp*uy - f(i,j,2,now) )
     f(i,j,3,now) = f(i,j,3,now) + invTauPhi*( Af1 - Cfp*ux - f(i,j,3,now) )
     f(i,j,4,now) = f(i,j,4,now) + invTauPhi*( Af1 - Cfp*uy - f(i,j,4,now) )
! Identify near neighbors
     ie = ni(i,j,1)
     jn = ni(i,j,2)
     iw = ni(i,j,3)
     js = ni(i,j,4)
! Relax and stream order parameter distribution function
     f(ie, j,1,nxt) = eta*f(i,j,1,now) + eta2*f(ie,j,1,now)
     f( i,jn,2,nxt) = eta*f(i,j,2,now) + eta2*f(i,jn,2,now)
     f(iw, j,3,nxt) = eta*f(i,j,3,now) + eta2*f(iw,j,3,now)
     f( i,js,4,nxt) = eta*f(i,j,4,now) + eta2*f(i,js,4,now)

It seems that the code actually act in accordance with the other equations as shown below: 1、 collision (Eq1):

zsc_eq2s

2、stream (Eq2):

zsc_eq3s

where eta is :

zsc_eq4s

Unfortunately, I couldn't get the original formula from eq1 and eq2. Maybe I misunderstand your solution. Looking forward to your reply.

PokerN commented 8 years ago

The location of project mentioned before is /src/std/zsc-seq/

carlosrosales commented 8 years ago

Thanks Nan Nan,

I have not worked in this code for several years, so I need to set some time aside to go over this. It is possible I have made a mistake, so it is important to figure this out.

I'll try to find some time this week to investigate this issue and get back to you.

Regards, Carlos

On Thu, May 19, 2016 at 5:50 AM, Nan Nan notifications@github.com wrote:

Hi, I've downloaded your code, and learned a lot of skills from your work. So thank you for your sharing. However, when I read the collision and stream part, I found there may be something different from the original algorithm. Details : The original order parameter LB equation is : [image: zsc_eq1] https://cloud.githubusercontent.com/assets/8172625/15384925/a0c263fe-1dd0-11e6-8215-9a636eb7a073.png Your implementation:

  • collsion:

    Af1 = 0.5D0_Gamma_muPhi Af0 = -2.D0_Gamma_muPhi Cfp = invEta2phin f(i,j,0,nxt) = f(i,j,0,now) + invTauPhi( Af0 + phin - f(i,j,0,now) ) f(i,j,1,now) = f(i,j,1,now) + invTauPhi_( Af1 + Cfpux - f(i,j,1,now) ) f(i,j,2,now) = f(i,j,2,now) + invTauPhi( Af1 + Cfpuy - f(i,j,2,now) ) f(i,j,3,now) = f(i,j,3,now) + invTauPhi( Af1 - Cfpux - f(i,j,3,now) ) f(i,j,4,now) = f(i,j,4,now) + invTauPhi( Af1 - Cfp_uy - f(i,j,4,now) )

  • streaming:

! Identify near neighbors ie = ni(i,j,1) jn = ni(i,j,2) iw = ni(i,j,3) js = ni(i,j,4)! Relax and stream order parameter distribution function f(ie, j,1,nxt) = eta_f(i,j,1,now) + eta2_f(ie,j,1,now) f( i,jn,2,nxt) = eta_f(i,j,2,now) + eta2_f(i,jn,2,now) f(iw, j,3,nxt) = eta_f(i,j,3,now) + eta2_f(iw,j,3,now) f( i,js,4,nxt) = eta_f(i,j,4,now) + eta2_f(i,js,4,now)

It seems that the code actually act in accordance with the other equations as shown below: 1、 collision (Eq1): [image: zsc_eq2s] https://cloud.githubusercontent.com/assets/8172625/15390686/b2e60e40-1def-11e6-955e-7458ed3320f1.png 2、stream (Eq2):

[image: zsc_eq3s] https://cloud.githubusercontent.com/assets/8172625/15390693/be44f508-1def-11e6-83ed-5ccad4a66fe9.png

where eta is : [image: zsc_eq4s] https://cloud.githubusercontent.com/assets/8172625/15390699/c3af4b92-1def-11e6-8d73-f8daa59859bb.png

Unfortunately, I couldn't get the original formula from eq1 and eq2. Maybe I misunderstand your solution. Looking forward to your reply.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/carlosrosales/mplabs/issues/1

GUE Tech I Diver Slow is smooth, smooth is fast

carlosrosales commented 8 years ago

Let me go over the original formulation and see if this is an actual issue. hat is the term that you are missing when you try to recover the original equation set?

carlosrosales commented 8 years ago

I think I see the problem. This would give additional terms involving the equilibrium distribution function for f(x+dx,t). Before I go ahead and modify the code I'll run the equations once more to make sure this is not something I need to undo later on, but so far I think you are right!

PokerN commented 8 years ago

Hi, Carlos

Thank you for your attention! Because of the time difference, I 'm sorry that I can't get your message in time. Recently, I have modified the code based on my comprehension. As long as I changed a little, then it will give me wrong results. So, I am very confused now.

Waiting for your result!

Yours, Nan

PokerN commented 8 years ago

I think the key is how to implement the term fi(x+ ci dt, t), as you know, that is unusual with standard LB equation. It doesn't mentioned clearly in 06's paper. What I mean is, the value of fi(x + ci dt, t) is pre-collision or post-collision. If it's post-collision, then what collision form it does.

carlosrosales commented 8 years ago

After further discussion it looks like if we interpret the original equations in any other way other than that implemented the code does not produce physical data, so no changes are actually needed.