-
Notifications
You must be signed in to change notification settings - Fork 15
Restructure TVF #864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Restructure TVF #864
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nice!
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #864 +/- ##
==========================================
+ Coverage 70.98% 71.03% +0.04%
==========================================
Files 107 107
Lines 7045 7018 -27
==========================================
- Hits 5001 4985 -16
+ Misses 2044 2033 -11
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Sven Berger <[email protected]>
Can you add the continuity equation based on the advection velocity? At least in my testing this was much better! |
This is step 2 that I described above. It will be the next PR. This PR doesn't change features, it only refactors the code and fixes a bug. |
/run-gpu-tests |
/run-gpu-tests |
/run-gpu-tests |
/run-gpu-tests |
This PR consists of several changes that I did in steps.
Step 1
The current approach is integrating the transport velocity through stages. So, between time steps,

\tilde{v}
is set tov
, and then it is integrated for one time step withd\tilde{v}/dt
set to the term inside the parentheses here:Note that this approach is currently flawed, as the
dv/dt
term in the RHS is missing, so only the physical velocity from the last time step is used at every stage.In the paper, with the different time integration, this transport velocity is only computed once per step:

While we can interpret this as "transport velocity is integrated within the step starting from v", which leads to the approach explained above, we could also interpret this as "
dr/dt = v + δv
, whereδv
isdt * v_c
andv_c
is the second term inside the parentheses above".This interpretation leads to a
δv = dt * v_c
that is either constant throughout the time step and computed between steps, orv_c
is recomputed at every stage. The latter is the one I implemented for the following comparisons, but I don't think the difference between computing this only between steps is significant, so we might be able to save some significant computation here.Results
Step 2
The original 2013 paper was using kernel summation to compute the density. When we use this implementation with the continuity equation, we get the same inconsistency as the inconsistent PST, as particles are now moving with the transport velocity, but the physical velocity is used in the continuity equation.
This can lead to an uncontrolled increase of density in a closed simulation.
In "A generalized transport-velocity formulation for smoothed particle hydrodynamics" (Zhang et al. 2017), the density is integrated with the continuity equation and the transport velocity is used here:
