Deterministic thermal drift tests #69
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is to address a comment left by a reviewer about testing the thermal drift. Mainly, it adds:
deltain the interface of NBody and DPStokes, as well as changes to specifyingdeltain units ofhydrodynamicRadiusHere's a plot using DPStokes(single_wall) showing convergence of an RFD for a fixed particle configuration to the deterministic solution. It matches the expected$O(1/\sqrt{N})$ convergence:

I changed it to specify delta in terms of particle radius since it should have units of length and since we found delta needs to be small specifically compared to particle radius. Here's another plot showing an RFD for the same particle configuration using$a=0.1$ with DPStokes. If we just use $\delta=1e^{-3}$ , the error plateaus early. Using $\delta=1e^{-3}a$ gives better convergence.

I also deleted the tests
test_divM_is_zeroandtest_divM_matches_rfdas I think this test should supersede those two tests. It implicitly checks (to numerical error) that periodic/open geometries return 0 for divM since the deterministic divergence in those cases is numerically 0 (very small).Final notes: NBody single_wall can converge somewhat slowly but runs quickly so I cranked the number of iterations it was allowed to go up to. DPStokes can reach an error plateau sometimes slightly before 1e-3, presumably since DPStokes is only designed for 2-3 digits of accuracy. For this reason, I used a lower tolerance to test convergence for DPStokes.
Let me know what you think!