QuazarTech / Bolt

A Fast Solver Framework For Kinetic Theories
GNU General Public License v3.0
7 stars 5 forks source link

Collision time stepping is not O(dt^2) #19

Closed mchandra closed 7 years ago

mchandra commented 7 years ago

Commit: c08646c6597692897268756d5c16455eb812470b

The current implementation of the collision step is

  # Performing the step of df/dt = C[f] = -(f - f_MB)/tau:
  f0             = f_MB(da, args)
  f_intermediate = args.f - (dt/2)*(args.f - f0)/tau
  args.f         = args.f - (dt)  *(f_intermediate - f0)/tau

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

shyams2 commented 7 years ago

Issue was fixed in PR #20 #26