Hi Michal,
thanks, I have found the equilibrium. Despite I more or less got the
solution with v0.2, I am now stuck with v0.3 that I have on a
workstation. I wanted just to ask you a couple of things and if you
think what I have done until now could be correct. I rapidly sum up
what I want to do/have done:
1. Fix relaxation time:
https://github.com/sailfish-team/sailfish/blob/master/sailfish/sym.py#L1022
def relaxation_time(viscosity):
return my_tau #(6.0 * viscosity + 1.0) / 2.0
2. Impose my own dx and dt: in v0.2 I did it respectively in geo.py
(line 118) and lbm.py (line 121), namely:
------------------------
@property
def dx(self):
return my_length/min(self.shape) #1.0/min(self.shape)
-----
@property
def dt(self):
return my_expression*self.geo.dx**2 #self.geo.dx**2
(obviously in my_expression goes tau -> self.get_tau() )
------------------------
3. Modify equilibrium as you suggested above, to correct speed of
sound from 1/sqrt(3) to my_c/sqrt(3) (where my_c is my_dx/my_dt),
then:
https://github.com/sailfish-team/sailfish/blob/master/sailfish/sym.py#L506
for i, ei in enumerate(grid.basis):
t = (grid.weights[i] * (
(rho + rho0 * poly_factorize(
3*ei.dot(grid.v) +
Rational(9, 2) * (ei.dot(grid.v))**2 -
Rational(3, 2) * grid.v.dot(grid.v)))))
becomes (cutting 2-nd order):
my_c = my_dx/my_dt
my_Cs = my_c/(3**0.5)
c_over_Cs2 = my_c/(my_Cs**2)
for i, ei in enumerate(grid.basis):
t = (grid.weights[i] * ((rho + rho0 * c_over_Cs2 *
ei.dot(grid.v))))
4. Modify single_fluid.mako as said above to never update velocity
field and keep that given in sim.vx[:] and sim.vy[:]
------------------
I think this steps may be sufficient to resolve an advection-diffusion
equation on a double periodic 2D domain (applying no BCs). In
conclusion my problem is that I cannot find definition of dx and dt in
v0.3. Could you please point me there?
Do you think what I have done could be correct?
Thanks a lot!
Luca