Git Product home page Git Product logo

Comments (10)

mlange05 avatar mlange05 commented on June 8, 2024

Ok, I believe this is similar to the diagnostic fields that @Jacketless requires to model predator-prey interactions. The idea here is to generate a field (numpy array) that sums the total amount of a variable quantity stored on the particles in each cell and then normalises this by cell volume. To get a particle density the value each particle "deposits" is then 1, but for a "prey" particle this might be some measure of biomass, which in turn allows the "predator" particle to sample the local population and adjust its behaviour accordingly.

In terms of implementation it is important to note that no tree is required here, since our particles always know where they are in the grid. The syntax I would propose for the "depositing" action would probably be something like grid.DiagFieldA << particle.varA, which would be interpreted in parcels.Kernels accordingly.

from parcels.

pwolfram avatar pwolfram commented on June 8, 2024

The benefit to the tree is aggregation of particles for computational
efficiency. This essentially helps with problems requiring accounting for
lumped effects of particles far away, especially for problems like
gravitation. I agree, @mlange05, you can probably do something like binning
based on position instead for densities, but may find trees useful for
other applications.

from parcels.

Jacketless avatar Jacketless commented on June 8, 2024

I'm now at the point where I would soon like to begin comparing particle densities at certain points with corresponding variables from a Eulerian model.
This is something I can do "offline" from the particle output .nc file in the manner @mlange05 suggests (binning and counting), but do we want to open a branch that does these calculations and writes to a field as a first step to on-the-fly particle density calculation?

from parcels.

erikvansebille avatar erikvansebille commented on June 8, 2024

Did PR #81 fix this issue now? Or do we still need to keep it open?

from parcels.

mlange05 avatar mlange05 commented on June 8, 2024

No, PR #81 was orthogonal to this.

from parcels.

Jacketless avatar Jacketless commented on June 8, 2024

PR #67 has made an attempt at density calculation within the main execution loop, but is not passing tests. A more considered design of adaptive execution loops was mentioned in #78 and so I have held off any further development on this issue. #67 contains enough functionality for me at the moment, but happy to discuss how to fix and get it into the master branch.

This is really the last piece of PARCELS functionality I require for the initial tuna milestones.

from parcels.

erikvansebille avatar erikvansebille commented on June 8, 2024

Two points on this old Issue:

  • Related to calculating densities is also the computation of streamfunctions (like what Ariane does). This would be a great feature to have, as it is one of the most-used diagnostics in Ariane. We could look at their implementation and mimic that
  • An additional difficulty in computing fields of particle densities (or streamfunctions) during runtime is that in C we can presently not write to Fields (we can only read Fields). So there is no easy way to change values of a field within the JIT-execution. Not sure how to easily fix this

from parcels.

erikvansebille avatar erikvansebille commented on June 8, 2024

Fixed in #255

from parcels.

mathildejutras avatar mathildejutras commented on June 8, 2024

Hi, I was wondering if there was any development on the computation of streamfunctions, as mentioned above. Thanks!

from parcels.

erikvansebille avatar erikvansebille commented on June 8, 2024

We haven't developed code for this in Utrecht yet, but I think that @ignasivalles may have previously computed streamfunctions from particles. Maybe he can help?

from parcels.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.