Shan-Chen tutorial fixes
I included the changes i made to the tutorial during the espresso summer school to make it momentum conserving. The comparison with the reference data is now done after 1000 timesteps for the two-component version and also only done up to an error of 1e-4. The reason is that there is a difference in the velocity-calculation using the Guo-force correction, the reference implementation always uses the current force whereas this notebook uses the old force value. I might be wrong here but the version from this notebook seems more physical to me.
Merge request reports
Activity
We should split these into test cases and tutorials. My aim was to exactly reproduce the result from Krüger's sample code, and that should continue to be done in a test case. If you look closely, we do this weird initialization with a separate
method_without_force
-- that is only done because that's what Krüger did for simplicity. The test cases should continue do exactly what we did before, comparing the results down to numerical precision. The tutorials should do as you suggest, but furthermore remove themethod_without_force
initialization. Could you please take care of that, @alexander.reinauer?Also, if I remember correctly, the tutorial (or Krüger's code) is not stable at the parameters used. If you run it for a lot more than 1000 time steps, it eventually explodes. For the tutorial, it would obviously be preferable if you could find parameters that lead to quick convergence and long-term stability.
assigned to @alexander.reinauer
I am not sure if the test case is really unstable for the parameter set. As @alexander.reinauer showed at the summer school, there was a problem with the momentum conservation. With the changes, I get stable results for at least 10 000 timesteps.
@alexander.reinauer could you please update the MR to the latest master so it is ready to merge?
added 22 commits
-
704312d4...358ebb11 - 18 commits from branch
pycodegen:master
- 92d1f19f - Merge remote-tracking branch 'upstream/master' into tutorial_fixes_new
- 8712c943 - test: extracted two-component shan-chen testcase
- 8c348a15 - tests: extracted two_phase shan-chen
- 1094f9da - notebooks: removed tests from 08
Toggle commit list-
704312d4...358ebb11 - 18 commits from branch
assigned to @holzer and unassigned @alexander.reinauer
mentioned in commit a991402e