Skip to content
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

Difference between PyCurrentMover and c_GridCurrent Mover #142

Open
tommasogallingani opened this issue Mar 20, 2023 · 9 comments
Open

Difference between PyCurrentMover and c_GridCurrent Mover #142

tommasogallingani opened this issue Mar 20, 2023 · 9 comments

Comments

@tommasogallingani
Copy link

Hi,
I was wondering which are the differences between PyCurrentMover and c_GridCurrentMover and why we are obtaining different results using the netcdf file attached. The grid file .nc attached is a "zero depth" file.
We have seen that using the c_GridCurrentMover there's almost no effect on particle moving while using the PyCurrentMover the effect is significant,
Thanks in advance
Tommaso

https://drive.google.com/file/d/1pDCuQF76hUFiNPhOz06a3ueaKj-wP6tx/view?usp=sharing

@ChrisBarker-NOAA
Copy link
Contributor

The c_GridCurrentMover is the older C++ cpde that used in GNOME 1 (Desktop GNOME)

PyCurrentMover (which has been renamed to just "Current Mover" is newer code. The new version does a 2nd order Runge Kutta rather than Euler method and may have slightly better interpolation.

They should give similar, though not identical results.

c_GridCurrentMover there's almost no effect on particle moving while using the PyCurrentMover the effect is significant,

Are the PyCurrentMover results what you expect? If so, then the data file is probably somehow incompatible with the older code. There's no reason to use the older code [^], so I wouldn't worry about it :-)

If the results are not what you expect than you might have found a bug -- we'l take a look.

[*] There are some older, non-standards-compliant model output files that only work with the old code, which is why we keep it around (but have recently renamed things to make it a bit more hidden)

@ChrisBarker-NOAA
Copy link
Contributor

Hmm -- at a quick glance, this is pretty simple file -- it should work with both.

@coconnor8: Do you see any reason this might not work with the C++ code ?

@coconnor8
Copy link
Contributor

I was able to load the file into WebGnome, both as a c_GridCurrent and as a PyCurrentMover. They both moved a spill similarly, and the vectors looked close though not exactly the same. I will try it also just with PyGnome and see if there is a difference there.

@coconnor8
Copy link
Contributor

Do you have a script you could post? I am not seeing much difference, but there could be something unique in your scenario.

@tommasogallingani
Copy link
Author

tommasogallingani commented Mar 27, 2023

Hi @coconnor8 sorry for the delay and thanks for the answers. Attached the data we used and the code used to test the two movers. From what we can see, after 5/7 days the results appear different, in particular in terms of propagation of particles in the north-west direction.
While modeling and preparing the data, we crashed into other "issue"/difference:

  • Is that true that with respect to c_GridCurrentMover, the PyCurrentMover works with .nc file where the depth variable is defined (even if a single constant value for the grid)
  • Does the c_GridWindMover have the same differences with respect to the PyWindMover?

Input files and notebook at the link

Thanks
tommaso

@tommasogallingani
Copy link
Author

Hi @ChrisBarker-NOAA and @coconnor8. We have further investigated the behaviour of the two movers and we found something that could maybe explaine the differences we have seen. In particular, we saw that for spill near the coast, where 3D Random mover is used it happens that the particles spreading is small.

The situation is the following:

  • we have surface spill near the coast where the currents value is limited for all depth
  • the 3d mover is used to simulate limited vertical mixing
  • the wind mover should be the major driving force here, right? But we saw in the code that only particles at surface (depth==0.0) are moved by wind mover. But of course, only in the first step of simulation particles are placed exactly at 0.0. Is that correct that there should be a limited layer where particles are affected by wind? In particular if particles are a proxy of a control volume with also surface oil concentration that is not zero.

does it make sense?

thanks

tommaso

@ChrisBarker-NOAA
Copy link
Contributor

yes, the wind mover acts only on particles exactly on the surface.

The idea is that it captures the direct wind effect on the surface sheen.

The assumption is that the the near-surface wind driven currents should be captured by the ocean circulation model.

If you wanted to capture the movement in the near-surface, I suppose we could have a wind-driven surface profile -- but in fact, the circulation in the region is extremely complex -- pretty much impossible to estimate it, so we make the clear distinction between "on the surface" and "under the surface".

But if you are trying to simulate a surface spill, then you really want to have your release on the surface, and it should stay there. Currently we don't have a mechanism to move particles off the surface.

The RandomMover3D simulated vertical diffusion within the water column -- it should be used for subsurface releases -- for non-buoyand substances or for oil with a RiseVelocity Mover.

@tommasogallingani
Copy link
Author

thanks @ChrisBarker-NOAA. If I get you right, there's no way to simulate the vertical displacement due to wave turbolent mixing.

@ChrisBarker-NOAA
Copy link
Contributor

yes, that's correct. all we have at the moment is a single "mixed layer".

The trick with all this is that mixing near the surface, and particularly in the wave region is not a simple diffusion process, there's a lot going on, most at much smaller spacial and time scales then we can hope to resolve.

We could (and will, eventually) at least capture entrainment into the mixed layer from the surface.

Contributions welcome :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants