ludwig-cf / ludwig

A lattice Boltzmann code for complex fluids
https://ludwig.epcc.ed.ac.uk
Other
51 stars 34 forks source link

Viscosity model in binary-fluid #296

Closed nobodynum4862 closed 3 months ago

nobodynum4862 commented 5 months ago

It seems that the Arrhenius parameters do not set the viscosities differently. I check it in the following way:

I set a system with 2 phases whose interface is at the middle of the z-axis, 
I set different viscosities for the two phases with the Arrhenius viscosity model,
I put an inactive particle respectively at the centre of each phase and set gravity in the x direction.

Apparently, if the viscosities are different in different phases, the two particles should have different curves of velocity over time. However, in my simulation, the two particles share approximately the same curve.

Please see the input file attached, and note that I've modified the source code a little so that "phi_initialisation bath" generates a 1:1 phase separation instead of a 1:3 phase separation. input.txt

Thank you very much in advance!

kevinstratford commented 5 months ago

OK. I can see what has happened here. You've selected in the input the free energy symmetric_lb, which is using a collision with two lattice Boltzmann distributions.

In what looks like an oversight, I haven't implemented the viscosity model in that collision kernel (we don't use it much these days).

If you switch the free energy to symmetric the different viscosities should appear. This choice uses finite difference for the compositional order parameter.

If you really want the symmetric_lb, we'd have to add the viscosity model there.

nobodynum4862 commented 5 months ago

OK. I can see what has happened here. You've selected in the input the free energy symmetric_lb, which is using a collision with two lattice Boltzmann distributions.

In what looks like an oversight, I haven't implemented the viscosity model in that collision kernel (we don't use it much these days).

If you switch the free energy to symmetric the different viscosities should appear. This choice uses finite difference for the compositional order parameter.

If you really want the symmetric_lb, we'd have to add the viscosity model there.

Thank you for your response! I experimented with the symmetric mode in my gravity test case, and while it runs, the quantitative accuracy of the results seems lacking. I'm considering whether the symmetric_lb mode might align better with the theoretical expectations. Additionally, I encountered issues when attempting to simulate squirmers' behavior near the interface.

From my perspective, I am interested in utilizing the symmetric_lb mode with varying viscosities. However, I acknowledge that it may not be a high-priority task, given its infrequent use.

Let me summarize my understanding of this section, and please correct me if I'm mistaken:

1. There are two ways to implement binary fluid: `symmetric` and `symmetric_lb`. The primary distinction lies in the fact that with `symmetric_lb`, the program calculates two distributions, while with `symmetric`, it computes only one distribution using parameters obtained through finite differences. Regarding viscosity, `symmetric` determines local viscosity using the Arrhenius model.

2. In the symmetric_lb mode, there already exists a `lb_collision_binary` function that calculates two distributions. However, both distributions currently share the same viscosity parameter (relaxation time tau), determined by the `lb_collision_relaxation_times_set` function, which presently considers only `ndist==1`.

3. Therefore, to extend this functionality for symmetric_lb, one would need to create a `lb_collision_relaxation_times_set` function for the `ndist==2` case and establish a pipeline to the `lb_collision_binary function` (essentially the `lb_collision_mrt2_site` function).

4. However, given the instability observed in the `symmetric` mode for squirmers near the interface, there is no guarantee that the `symmetric_lb` mode will perform flawlessly.

Please confirm if my understanding is accurate so that I can plan my next steps accordingly. Thank you very much for your assistance!