NOAA-ORR-ERD / PyGnome

The General NOAA Operational Modeling Environment
https://gnome.orr.noaa.gov/doc/pygnome/index.html
Other
54 stars 44 forks source link

Difference between PyCurrentMover and c_GridCurrent Mover #142

Open tommasogallingani opened 1 year ago

tommasogallingani commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

tommasogallingani commented 1 year ago

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:

Input files and notebook at the link

Thanks tommaso

tommasogallingani commented 1 year ago

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:

does it make sense?

thanks

tommaso

ChrisBarker-NOAA commented 1 year ago

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 commented 1 year ago

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

ChrisBarker-NOAA commented 1 year ago

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 :-)