OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics add gravity leads to instability, bifurcation 3D, multiphase, particles

Viewing 11 posts - 1 through 11 (of 11 total)
• Author
Posts
• #4590
Manuel Berger
Participant

Dear all!

I have modified the bifurcation example (olb-1.3r1/example/particles/bifurcation3d) to simulate gravitation effects. The simulations is stable without gravitation, but when I apply g = 9.81 m/s^2 I have no chance to get a reasonable result. Gravity is transformed to lattice units by gLB = g * dt*dt/dx where dt is the physical time step size of one iteration and dx is the lattice spacing. Additionally, I have changed the boundary conditions to a constant inlet velocity and the outlets are set to ambient pressure.

The implementation of gravity is in the code lines 180 and 181.

The code, stl-file and log-file is available at:

https://www.dropbox.com/sh/dah69crhc2a8tgz/AACj3XTxFFcbkpx05TuOQqM3a?dl=0

Thanks for the feedback and advices

Manuel Berger

#4591
mathias
Keymaster

Dear Manuel,

here are some hints:
1/ Use the converter to convert quanteties in lattice units. You need accelation insteed of forces – see the other examples dealing with forces like poiseuilleXd.
2/ You should Buoyancy forces.
3/ Strating with a working and stable example, change one thing, get a stable result, then change the next thing. So dont change boundary conditions as well as introducing a force at once.

Best
Mathias

#4592
Manuel Berger
Participant

Dear Mathias!

Thanks for the fast response and the hints:

1/ I have used the converter to convert quantities into lattice units (i.e. gravitation code line 174)

T gLB= gravity*converter.getPhysDeltaT()*converter.getPhysDeltaT()/converter.getPhysDeltaX();

I have also used the poiseuilleXd file as a starting point. However, it shows how to apply a body force, but not how the body force is connected to gravitation. I think in the LB framework OpenLB, there is so far no code that shows this connection. The LB framework palabos (palabos-v2.0r0\examples\showCases\vofMultiPhase\damBreak3d.cpp) shows that body force and gravitation (in lattice units) is the same. Code line 70,71. I assume my implementation of gravitation is fine in the bifurcation3d (see dropbox)?

2/ You are right Buoyancy forces are not considered.

3/ I get already a stable simulation result with changed boundary conditions (without gravitation). Adding gravity (1 thing changed) does not work.

I would be great if you could find a specific mistake in my code or recommendation i could change.

Thanks you very much for the help in advance

Manuel Berger

#4593
mathias
Keymaster

Dear Manuel,

there are methods of the unitConverter which does the job. The factor should be

latticeForce = physForceGivenInSiUnits*converter.getConversionFactorMass()/converter.getConversionFactorForce();

Best
Mathias

PS we will have a lecture on that in our next spring school given by Timm Krüger

#4594
Manuel Berger
Participant

Dear Mathias,

I have already registered for the spring school in Berlin.

I have tried your conversion factor and found out that

converter.getConversionFactorMass()/converter.getConversionFactorForce();

is equal to

converter.getPhysDeltaT()*converter.getPhysDeltaT()/converter.getPhysDeltaX();

thus, my conversion is also fine.

The only question that still remains, which is independent of this code line is: How to convert gravitational acceleration (9.81 m/s^2) to body force? – or is it the same?

Thanks a lot!

Best
Manuel

#4595
mgaedtke
Keymaster

Hi Manuel,

the force field in OpenLB is actually a force over reference density, thus it is equivalent to an acceleration. To convert your gravitational acceleration you can use the term

`converter.getPhysDeltaT()*converter.getPhysDeltaT()/converter.getPhysDeltaX()`

See you at the Spring School!

Best,
Max

#4596
Manuel Berger
Participant

Hi Max,

thanks for the explanation. Thus, my implementation of gravity is correct. See you at the Spring School!

Now I have to find a way to make this simulation numerically stable. Any recommendations based on personal experience for boundaries? So far I made the experience that increasing the resolution N helps sometimes, but with the disadvantage that the computational time increases dramatically.

Boundaries for numerical stability would be interested for: (in brackets are the used values)

gravitational force in lattice units (0.0187673)
latticeRelaxationTime (0.557646)
maximum velocity in lattice units (0.0505667)
maybe lattice viscosity
….

What are the steps you do, do make a LB simulation numerically stable.

Thanks a lot!

Best
Manuel

• This reply was modified 3 years, 11 months ago by Manuel Berger.
#4598
mathias
Keymaster

1/ Check if the carrier phase simulation is stable
>if not, choose a smaller mesh size or use a smagorinsky model until it becomes a stable set-up
2/ Check if the particle phase is stabel
> if not, choose a even smaller mesh size or choose a bigger diffusion coefficient until it becomes a stable set-up

Mathias

#4599
Manuel Berger
Participant

Dear Mathias,

thank you very much!

Best,
Manuel

#4600
zshi6193
Participant

Dear Max,

You mention the force field in OpenLB is actually a force over reference density. For multi-phase flow, I have two phases (liquid and vapor via using single component Shan-Chen model). If I define a force field (an acceleration) into the whole domain, will this method still works?
I am just thinking that vapor tends to have very small acceleration because of very small density. Or this method can only be used two-component Shan-Chen model.

Simon

#4602
mgaedtke
Keymaster

Hi Simon,

yes, this will still work. Just check the examples/multiComponent/rayleighTaylor2d/ or 3d

Best,
Max

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