# Reply To: High density/viscosity ratio Free Energy method

OpenLB – Open Source Lattice Boltzmann Code › Forums › on OpenLB › General Topics › High density/viscosity ratio Free Energy method › Reply To: High density/viscosity ratio Free Energy method

Hi Mehrdad,

I believe that expression is correct. OpenLB uses relative concentrations through an order parameter defined as ϕ = (c1 – c2) / (c1 + c2), where c2 = 1 – c1. The expression would have to be re-scaled in terms of the order parameter. We normally use a simple linear transition of 0.5*(1+ϕ)*(tau1)-0.5*(-1+ϕ)*tau2. In LBM, the BGK collision operator would just become 1/tau_f from your expression above.

The squareCavity2d example uses variable relaxation times but for a very different application. ExternalTauEffLESForcedBGKdynamics is used for the Navier-Stokes solver on line 193, although for the free energy, you would probably use ExternalTauEffIncForcedBGKdynamics. They define a coupling on line 607 using SmagorinskyBoussinesqCoupling. This is defined in src/dynamics/navierStokesAdvectionDiffusionCoupling and has an implementation of variable relaxation times, although this is different from the approach needed in the Free Energy Model. You would have to define your own coupling class that accepts tau1 and tau2 as parameters and sets the relaxation time for the Navier-Stokes solving lattice using the order parameter (I think this is still defined as rho) in the second lattice. You could try and test this with any of the multiComponent examples, as everything else should be the same.

I haven’t implemented anything with dynamic relaxation times myself in OpenLB, so someone else might be better suited to answering this.

Best wishes,

Michael