-
Notifications
You must be signed in to change notification settings - Fork 186
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
Add custom forcing velocity to particles #3396
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Gregory L. Wagner <gregory.leclaire.wagner@gmail.com>
Co-authored-by: Gregory L. Wagner <gregory.leclaire.wagner@gmail.com>
… into glw/better-interpolate
Co-authored-by: Simone Silvestri <silvestri.simone0@gmail.com>
Co-authored-by: Simone Silvestri <silvestri.simone0@gmail.com>
Co-authored-by: Simone Silvestri <silvestri.simone0@gmail.com>
Co-authored-by: Simone Silvestri <silvestri.simone0@gmail.com>
I've updated the code to @inline particle_u_velocity(x, y, z, u_fluid, particles, p, advective_velocity::ParticleVelocities, grid, clock, Δt, model_fields) = advective_velocity.u(x, y, z, u_fluid, particles, p, grid, clock, Δt, model_fields) I also swapped around I've implemented a simple example with a drag in the form of |
…s before advecting particles
Upon thinking about it I think perhaps it makes more sense to run Also provided a draft example of how one could set up a problem where the particle sinks with a drag in the form of Since particle velocities are not updated when the particle is bounced, it will not work if the particles bounce from the boundaries back into the interior during the advection step, but for doubly-periodic domian and sinking particles it might not be very important. |
…ction.jl Co-authored-by: Gregory L. Wagner <gregory.leclaire.wagner@gmail.com>
Are you sure? This could mean that the advecting velocity is extracted at time-step |
I think that depends on how one defines the advective velocity eg. if it is defined as an explicit function of time then it is better that dynamics act first to compute the radius at time |
But in that case, when a time-step is complete, the radius has been computed at time |
Actually, I think we need to change the time-stepping loop: Oceananigans.jl/src/TimeSteppers/quasi_adams_bashforth_2.jl Lines 93 to 100 in 3e26503
We should step particles forward before stepping the velocity field? It also seems that we need to separate particle advection from "dynamics", and compute the dynamics once the time-stepping is complete (probably it makes sense to compute dynamics within |
Makes sense. |
Agreed. @simone-silvestri what do you think? |
This reverts commit edc3610.
…github.com/CliMA/Oceananigans.jl into ss-xl/particle-advection
…les-out-of-bounds' into ss-xl/particle-advection
With @xkykai we were looking at ways to add a sinking velocity to particles to be added to the advecting velocity.
This PR introduces a framework to do this by adding a
particle_forcing_u
function.The usage will be something like this: