Skip to content

Implement Gravity in Shen Chen model

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics Implement Gravity in Shen Chen model

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #4504
    zshi6193
    Participant

    Hello OpenLB,

    I am trying to use Shen-chen multicomponent model to simulate the gravity-driven drainage process. To apply a gravity force, I am current using “slatticeOne.defineExteneralField ( geometry, 1, externalforcebeginat, sizeofexternalforce, f) ”
    I am not sure how to choose the value of f to link to the gravity. As f=rho*g, f is not a unique value and it is related to the density in a specific cell. Could anyone help me with the implementation of gravity?
    Many thanks.

    Regards.

    #4509
    mgaedtke
    Keymaster

    Hi zshi,

    using slatticeOne.defineExteneralField ( geometry, 1, externalforcebeginat, sizeofexternalforce, f) to set additional forces when using Shan-Chen-Model is exactly right. Note that our field externalforce is actually F/rho (acceleration), so that you don’t have any problems with variing densities. Just set the externalforce to g in lattice units and you should be fine.

    Cheers,
    Max

    #4514
    zshi6193
    Participant

    Dear Max,

    Thanks for your reply. Much appreciated.
    I am sorry that I have one more question regarding the pressure boundary used in Shan-Chen two compartment multiphase model. To set the pressure inlet and pressure outlet, I used the following methods:
    slatticeWater.defineRho(supergeometry,3(inlet),rhowater)
    slatticeOil.defineRho(supergeometry,3(inlet),zero)
    slatticeWater.defineRho(supergeometry,4(outlet),rhowater)
    slatticeOil.defineRho(supergeometry,4(outlet),zero).
    (I applied above four codes every iteraction to keep the constant pressure)
    Alternatively, I also try:
    Bcwater.addPressureBoundary(supergeometry,3(inlet),omega)
    BcWater.addPressureBoundary(supergeometry,4(outlet),omega)
    slatticeOil.defineRho(supergeometry,3(inlet),zero).
    slatticeOil.defineRho(supergeometry,4(outlet),zero).

    The middle part of the domain is filled with oil and the rest is filled with water. But under above set up, the equilibrium state can not be achieved. The pre-filled oil layer moves downwards.
    I am not sure that I set up the boundary conditions correctly or not? .Could you help me to check it? Ideally, at the same pressure at the top and bottom (no pressure gradient), the oil in the middle part should be stable.

    Thank you very much.
    Simon

    #4515
    mgaedtke
    Keymaster

    Hi Simon,

    that sounds like you have implemented a buoyancy force already and the densities of oil and water differ in your initial conditions.

    Best,
    Max

    #4519
    zshi6193
    Participant

    Dear Max,

    Sorry that I didn’t express myself clearly. I would like to test whether the system can reach equilibrium without gravity. So the middle of the domain is filled with oil and the rest part of the domain is filled with water. I set the same density for oil and water. If I use the following code, the system should reach the equilibrium but unfortunately, it didn’t. Would you think that the following codes are correct for the constant pressure boundary at both inlet and outlet?
    Also, a very small question, do we need add ” sLatticeWater.addLatticeCoupling(superGeometrytest, 3(inlet), couplingtest, sLatticeOil ) for the inlet and outlet.

    Thank you.

    Code:
    slatticeWater.defineRho(supergeometry,3(inlet),rhowater)
    slatticeOil.defineRho(supergeometry,3(inlet),zero) (not sure whether we need to set the pressure for oil is zero)
    slatticeWater.defineRho(supergeometry,4(outlet),rhowater)
    slatticeOil.defineRho(supergeometry,4(outlet),zero).
    (applied in each step)

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