ali-ramadhan / lagrangian-microbes

🦐🐟🦈 A framework for simulating millions of interacting Lagrangian particles (or microbes!) in a turbulent ocean.
MIT License
10 stars 0 forks source link

Isotropic horizontal diffusion #28

Closed ali-ramadhan closed 5 years ago

ali-ramadhan commented 5 years ago

This should let us add a constant horizontal diffusivity. Ocean Parcels has one but it requires you to define kh_zonal and kh_meridional fields which is a bit cumbersome.

I'm trying to use a closure to generate isotropic diffusion kernels that SciPy can compile.

Two issues:

Resolves #21

ali-ramadhan commented 5 years ago

Even hard coding in the kh value gives issues as the closure/kernel is not pickleable so joblib errors =/

So I guess I'll use the built-in BrownianMotion2D kernel but it slows the advection down by a factor of 12~15x which is kind of sad. Might open an Ocean Parcels issue.

Oh well, we can just use up more cores lol...

ali-ramadhan commented 5 years ago

Not 100% sure why that was slow but just looping over the particles and manually adding in the diffusion works and takes up as much time as the advection so I'll just stick with this for now.