Skip to content

3D Zou-He

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1755
    anna.leeds
    Member

    Hello,rnrnrnI am trying to compute the 3D lid-driven cavity test (code C++). I have used Bounce back boundary conditions for the wall. For the lid, I want to use the Zou-He boundary condition. I follow this paper ‘ Implementation of on-site velocity boundary condition for D3Q19 lattice Boltzmann’ Hecht, 2012.rnrnMy D3Q19 Model :rn

    Code:

    (14) 18(5)15 (11)rn | /rn /rn | /rn 8(2)10________________4(0)3_________________9(1)7rn / | rn / | rn / | zrn (12) 16(6)17 (13) |_ xrn rn rn (18) 11(5)14 (15)rn | /rn /rn | /rn 9(4)8________________1(0)2_________________7(3)10rn / | rn / | rn / | zrn (16) 13(6)12 (17) |_ y

    Code:

    rnrnrnThe subroutine for the boundary condition rn

    Code:

    void Zou_He (DistFunctArray& df, DistFunctArray& df_tmp)rn rn{rnint NZ = df.sizeZ()-1;rn for(int x=1; x<df.sizeX()-1; x++) rn for(int y=1; y<df.sizeY()-1; y++)rn {rn rn const real Vx = 1e-3;rn rn rn const real rho = df(0,x,y,NZ) + df(1,x,y,NZ) + df(2,x,y,NZ) + df(3,x,y,NZ) rn + df(4,x,y,NZ) + df(7,x,y,NZ) + df(8,x,y,NZ) + df(9,x,y,NZ) + df(10,x,y,NZ) rn + 2*(df(5,x,y,NZ) + df(11,x,y,NZ) + df(14,x,y,NZ) + df(15,x,y,NZ) + df(18,x,y,NZ));rn rn const real Nxz = 0.5 * (df(1,x,y,NZ) + df(9,x,y,NZ) + df(7,x,y,NZ) – (df(8,x,y,NZ)rn + df(2,x,y,NZ) + df(10,x,y,NZ))) – (rho * Vx )/3;rn const real Nyz = 0.5 * (df(3,x,y,NZ) + df(7,x,y,NZ) + df(10,x,y,NZ) – (df(9,x,y,NZ)+ df(4,x,y,NZ) + df(8,x,y,NZ)));rn rn df_tmp(6,x,y,NZ) = df(5,x,y,NZ);rn df_tmp(13,x,y,NZ) = df(14,x,y,NZ) + (rho * Vx )/6 ; //- Nxz;rn df_tmp(12,x,y,NZ) = df(11,x,y,NZ) – (rho * Vx )/6 ;// + Nxz;rn df_tmp(16,x,y,NZ) = df(15,x,y,NZ) ;//+ Nyz;rn df_tmp(17,x,y,NZ) = df(18,x,y,NZ) ;//- Nyz;rn rn } rn}rn

    Code:

    rnrnIf I do not use Nxz and Nyz it gives me results. But this is not the real Zou-He boundary condition, right? It is more a bounce back with a velocity.rnrnI don’t understand where i am wrong about the Zou-He boundary condition. When I ran with Nxz and Nyz i obtained Nan for df_tmp.rnrnThanks in advance for your help,rnrnAnnarn

    #2139
    mathias
    Keymaster

    Hi,rnrnwhat did you do for the corner nodes? I would set a combination of BB and Zou/He. Further, have a look in Sukops book there is some pseudo code or/and the OpenLB inplementation.rnrnBest regardsrnMathias

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.