This takes f^{n} -> f^{n+1} through an intermediate half step f_intermediate which is at n+1/2. However, the local equilibrium f0 being used in both the steps is at n, whereas it should be centered at n+1/2 in the second step. The code should perhaps be:
# Performing the step of df/dt = C[f] = -(f - f_MB)/tau using an intermediate half-step:
# Half-step n -> n+1/2:
f0 = f_MB(da, args) # f0 at n
f_intermediate = args.f - (dt/2)*(args.f - f0)/tau # n -> n+1/2
# Full-step n -> n+1
f_n = args.f # should it be args.f.copy() ?
args.f = f_intermediate # .copy() ?
f0_intermediate = f_MB(da, args) # f0 at n+1/2
args.f = f_n - (dt) *(f_intermediate - f0_intermediate)/tau
I think the error will show up in cases which are collision dominated, i.e., tau << 1
Commit: c08646c6597692897268756d5c16455eb812470b
The current implementation of the collision step is
This takes
f^{n}
->f^{n+1}
through an intermediate half stepf_intermediate
which is atn+1/2
. However, the local equilibriumf0
being used in both the steps is atn
, whereas it should be centered atn+1/2
in the second step. The code should perhaps be:I think the error will show up in cases which are collision dominated, i.e.,
tau << 1