Replies: 1 comment 5 replies
-
Hi @bwahyatt , This is indeed a good place to ask these types of questions! Particles crossing the "shore" or other solid-fluid boundaries can be a complex problem, depending on the types of fields you are working with and in many cases we have not found a general 'answer' for all purposes. In fact, many simulations have used similar solutions to the one you have implemented. I am working on a notebook to explain the different options in different cases. Since you are working with MITgcm, am I correct to assume that the velocities come on a staggered grid: https://mitgcm.readthedocs.io/en/latest/algorithm/horiz-grid.html? If your velocities are indeed defined on this staggered grid (C-grid), the velocities at the cell edges that form your "shore" should be zero and particles should not be able to cross them. If they still do, could you either try decreasing your computational timestep (dt) or share the way you have set up your fieldset and the resulting animation? If your velocities are defined on an unstaggered grid, could you confirm this and maybe show how/where your particles cross the "shore"? Then I can recommend some options based on that. Cheers, |
Beta Was this translation helpful? Give feedback.
-
Hi all,
Hope this is the correct place to ask this question. I am currently using parcels to track particles for a lake simulation model. For now, I have been writing the output of the particle trajectories to .csv files which I am then reading into an independent animation script which uses the velocity field data outputted from an MITgcm executable. This U,V,W velocity field data is then used to create the .nc files that are loaded into my parcels script. These animations reveal that particles can temporarily cross the "shore" of the lake and travel on the land.
Is there a good way to prevent this effect from happening? I am looking to have the particles move along the edge of the shore when they encounter it, rather than crossing over and onto the land. In my case the bathymetry of the simulation is very simple, just a rectangular peninsula in a rectangular lake domain. I have been using this function as a quick fix to correct the trajectories:
Which I use by adding to the kernel in pset.execute, i.e.
pset.execute(AdvectionRK4+pset.Kernel(stop), ...)
. The hand written values in this function are relevant to my specific bathymetry.Is there a more general way to go about fixing this? I.e. how should I approach this for a bathymetry with an arbitrary/realistic geometry? I know the documentation mentions using a
land=True
parameter, but in this case I am using a flat mesh/cartesian coordinates with a custom made bathymetry (not modelling real oceans/continental coastlines). The bathymetry data is stored in a .bin file, and I have access to other independent scripts which use it produce cross sections of the lake as numpy arrays.For additional context, I am a 2nd year physics undergrad and very new to parcels, not a veteran programmer by any means (feel free to dumb it down, I will not be offended). Thanks so much!
Beta Was this translation helpful? Give feedback.
All reactions