Implement Gravity in Shen Chen model
OpenLB – Open Source Lattice Boltzmann Code › Forums › on OpenLB › General Topics › Implement Gravity in Shen Chen model
 This topic has 4 replies, 2 voices, and was last updated 3 years, 9 months ago by zshi6193.

AuthorPosts

August 17, 2019 at 12:38 pm #4504zshi6193Participant
Hello OpenLB,
I am trying to use Shenchen multicomponent model to simulate the gravitydriven 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.
August 21, 2019 at 9:04 am #4509mgaedtkeKeymasterHi zshi,
using
slatticeOne.defineExteneralField ( geometry, 1, externalforcebeginat, sizeofexternalforce, f)
to set additional forces when using ShanChenModel 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,
MaxAugust 21, 2019 at 4:53 pm #4514zshi6193ParticipantDear Max,
Thanks for your reply. Much appreciated.
I am sorry that I have one more question regarding the pressure boundary used in ShanChen 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 prefilled 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.
SimonAugust 21, 2019 at 5:46 pm #4515mgaedtkeKeymasterHi Simon,
that sounds like you have implemented a buoyancy force already and the densities of oil and water differ in your initial conditions.
Best,
MaxAugust 22, 2019 at 5:50 am #4519zshi6193ParticipantDear 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) 
AuthorPosts
 You must be logged in to reply to this topic.