unrealistic pressure gradient forming along bathymetry
-
- Posts: 43
- Joined: Wed Nov 30, 2016 11:18 pm
- Location: University of Massachusetts Dartmouth
unrealistic pressure gradient forming along bathymetry
Hello,
Previously, I posted a couple of discussion threads on 'unrealistic' velocities forming along the bathymetry on my domain. As a follow-up - I did some more analysis, and found out that the unrealistic velocities are forming due to spurious patterns in the pressure gradient, evolving along the spatially varying bathymetry. Below, are a few plots showing the problem.
Pressure gradient at the 1st time step Notice the small-scale patterns forming. This is happening along the varying bathymetry. (plot below) Velocity difference between 1st and 2nd timesteps The anomalies in the velocity, match with the pressure gradient.
In this run, the pressure gradient is calculated with standard density jacobian algorithm. I was going through some threads, where it is said that the pressure gradient on a sigma coordinates can form errors, giving rise to spurious currents (probably that's what is happening here).
Any suggestions on how to accurately estimate the pressure gradient? I tried smoothing the bathymetry, but that doesn't solve the problem. Strong gradients eventually form at later times, shooting up the velocity to unrealistic levels.
Thanks,
Sonaljit.
Previously, I posted a couple of discussion threads on 'unrealistic' velocities forming along the bathymetry on my domain. As a follow-up - I did some more analysis, and found out that the unrealistic velocities are forming due to spurious patterns in the pressure gradient, evolving along the spatially varying bathymetry. Below, are a few plots showing the problem.
Pressure gradient at the 1st time step Notice the small-scale patterns forming. This is happening along the varying bathymetry. (plot below) Velocity difference between 1st and 2nd timesteps The anomalies in the velocity, match with the pressure gradient.
In this run, the pressure gradient is calculated with standard density jacobian algorithm. I was going through some threads, where it is said that the pressure gradient on a sigma coordinates can form errors, giving rise to spurious currents (probably that's what is happening here).
Any suggestions on how to accurately estimate the pressure gradient? I tried smoothing the bathymetry, but that doesn't solve the problem. Strong gradients eventually form at later times, shooting up the velocity to unrealistic levels.
Thanks,
Sonaljit.
Re: unrealistic pressure gradient forming along bathymetry
this can occur for many reasons. One could be an imbalance of the initial density-velocity-bathymetry. Where did you get the density and velocity fields from? did you interpolate them to the roms grid? If you let it run for a while, do they go away?
-john
-john
-
- Posts: 43
- Joined: Wed Nov 30, 2016 11:18 pm
- Location: University of Massachusetts Dartmouth
Re: unrealistic pressure gradient forming along bathymetry
density and velocity fields - Obtained from HYCOM/NCODA analysis 1/12.
Interpolation - Yes, all fields are interpolated to the ROMS grid.
After running for a while, the problem still persists. The unrealistic velocities build up and the model crashes. I tried using smaller time step, in which case the simulation continues for a bit longer, but eventually the velocities build up to high values and it crashes again.
Can you elaborate on the imbalance of the initial density-velocity-bathymetry? I tried smoothing the bathymetry as well, but that just makes the simulation run a little longer. However, the pressure gradient errors eventually occur in the domain, incrementing the velocities to unrealistic values.
Also, this error is only happening in the velocities. The T/S fields are evolving smoothly.
Interpolation - Yes, all fields are interpolated to the ROMS grid.
After running for a while, the problem still persists. The unrealistic velocities build up and the model crashes. I tried using smaller time step, in which case the simulation continues for a bit longer, but eventually the velocities build up to high values and it crashes again.
Can you elaborate on the imbalance of the initial density-velocity-bathymetry? I tried smoothing the bathymetry as well, but that just makes the simulation run a little longer. However, the pressure gradient errors eventually occur in the domain, incrementing the velocities to unrealistic values.
Also, this error is only happening in the velocities. The T/S fields are evolving smoothly.
Re: unrealistic pressure gradient forming along bathymetry
can you list your cppdefs.
-
- Posts: 43
- Joined: Wed Nov 30, 2016 11:18 pm
- Location: University of Massachusetts Dartmouth
Re: unrealistic pressure gradient forming along bathymetry
#define UV_ADV
#define UV_COR
#define UV_LOGDRAG
#define PJ_GRADP
#define SPLINES_VDIFF
#define SPLINES_VVISC
#ifdef TS_U3ADV_SPLIT
# define TS_DIF2
# define DIFF_GRID
# define MIX_GEO_TS
#endif
#ifdef UV_U3ADV_SPLIT
# define UV_VIS2
# define VISC_GRID
# define MIX_GEO_UV
#endif
#define NONLIN_EOS
#define SALINITY
#define SOLVE3D
#define CURVGRID
#ifdef GLS_MIXING
# define CANUTO_A
# define CHARNOK
# define K_C4ADVECTION
# define N2S2_HORAVG
# define RI_SPLINES
#endif
Apart from these, I have the following settings in build.bash
export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DTS_A4HADVECTION -DTS_A4VADVECTION"
export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DUV_C4ADVECTION"
#define UV_COR
#define UV_LOGDRAG
#define PJ_GRADP
#define SPLINES_VDIFF
#define SPLINES_VVISC
#ifdef TS_U3ADV_SPLIT
# define TS_DIF2
# define DIFF_GRID
# define MIX_GEO_TS
#endif
#ifdef UV_U3ADV_SPLIT
# define UV_VIS2
# define VISC_GRID
# define MIX_GEO_UV
#endif
#define NONLIN_EOS
#define SALINITY
#define SOLVE3D
#define CURVGRID
#ifdef GLS_MIXING
# define CANUTO_A
# define CHARNOK
# define K_C4ADVECTION
# define N2S2_HORAVG
# define RI_SPLINES
#endif
Apart from these, I have the following settings in build.bash
export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DTS_A4HADVECTION -DTS_A4VADVECTION"
export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DUV_C4ADVECTION"
Re: unrealistic pressure gradient forming along bathymetry
I believe we are all using DJ_GRADPS.
-
- Posts: 43
- Joined: Wed Nov 30, 2016 11:18 pm
- Location: University of Massachusetts Dartmouth
Re: unrealistic pressure gradient forming along bathymetry
I tried that, but doesn't seem to make a difference. Still the same patterns forming along bathymetry.
Re: unrealistic pressure gradient forming along bathymetry
Would you show us the log file?
-JH
-JH
Joonho Lee
Re: unrealistic pressure gradient forming along bathymetry
Sonaljit, I had similar trouble in my idealized simulations.
In my case, the problem happened where the vertical grid spacing was largest (and s-surfaces were sloping; i.e. classic conditions for pressure gradient error). Reducing vertical grid spacing increased the amount of time it took the noise to appear, so you could try playing with the stretching or add more vertical grid points --- this might be "objectively" the best solution.
I ended up bumping up my background biharmonic viscosity and diffusivity using MIX_S_TS and MIX_S_UV (can't remember if these are the right options?). This didn't eliminate the noise but reduced the magnitude significantly --- my criterion was w < 1e-4 m/s throughout the simulation. Mixing along s-surfaces is unphysical; but to kill this noise, the mixing needs to be strong enough... Using biharmonic viscosity makes it slightly less bad.
EDIT: Just noticed that your snapshots are from the first two timesteps, so what I said above does not apply. It does seem like your initial conditions are mismatched. What happens if you run with flat isopycnals and no velocities? That'll give you a baseline for how bad the pressure gradient error is for your stretching / mixing / topography.
In my case, the problem happened where the vertical grid spacing was largest (and s-surfaces were sloping; i.e. classic conditions for pressure gradient error). Reducing vertical grid spacing increased the amount of time it took the noise to appear, so you could try playing with the stretching or add more vertical grid points --- this might be "objectively" the best solution.
I ended up bumping up my background biharmonic viscosity and diffusivity using MIX_S_TS and MIX_S_UV (can't remember if these are the right options?). This didn't eliminate the noise but reduced the magnitude significantly --- my criterion was w < 1e-4 m/s throughout the simulation. Mixing along s-surfaces is unphysical; but to kill this noise, the mixing needs to be strong enough... Using biharmonic viscosity makes it slightly less bad.
EDIT: Just noticed that your snapshots are from the first two timesteps, so what I said above does not apply. It does seem like your initial conditions are mismatched. What happens if you run with flat isopycnals and no velocities? That'll give you a baseline for how bad the pressure gradient error is for your stretching / mixing / topography.
- jivica
- Posts: 172
- Joined: Mon May 05, 2003 2:41 pm
- Location: The University of Western Australia, Perth, Australia
- Contact:
Re: unrealistic pressure gradient forming along bathymetry
I think there was already a quite a lot discussion about HPGE and smoothing techniques in the forum.
In short, I would make pure HPGE simulation using only vertical profile of T and S (using ANA_INITIAL), and no forcing, closed brys (or clamp to the same profile of T,S using again ANA_).
You can compute mean vertical profile for your grid and then fit to analytical function *there are examples in ANA_INITIAL*.
Let model run for say 2 weeks and then have a look at the bottom (or near) currents. This will indicate what are HPGE effects for the bathy and vertical setup (Vtransform, stretching, theta, N) ONLY, as you have no external forcing, density was horizontally homogeneous etc..
Note that higher number of vertical layers (especially at the bottom) and stronger vertical density gradient is actually main reason for large HPGE. What is killing you is not rx0 but rx1.
To handle that we've developed quite elaborate technique for smoothing, using iterations to compute HPGE velocities and then smooth ONLY in those regions where they are above critical value, and then again new iteration.... but as I said, I wrote the cookbook long time ago on the forum...
for HPGE, I use something like:
In short, I would make pure HPGE simulation using only vertical profile of T and S (using ANA_INITIAL), and no forcing, closed brys (or clamp to the same profile of T,S using again ANA_).
You can compute mean vertical profile for your grid and then fit to analytical function *there are examples in ANA_INITIAL*.
Let model run for say 2 weeks and then have a look at the bottom (or near) currents. This will indicate what are HPGE effects for the bathy and vertical setup (Vtransform, stretching, theta, N) ONLY, as you have no external forcing, density was horizontally homogeneous etc..
Note that higher number of vertical layers (especially at the bottom) and stronger vertical density gradient is actually main reason for large HPGE. What is killing you is not rx0 but rx1.
To handle that we've developed quite elaborate technique for smoothing, using iterations to compute HPGE velocities and then smooth ONLY in those regions where they are above critical value, and then again new iteration.... but as I said, I wrote the cookbook long time ago on the forum...
for HPGE, I use something like:
#define UV_ADV
#define UV_COR
#define UV_QDRAG
#define UV_VIS2
#define MIX_S_UV
#define UV_U3HADVECTION
#define UV_C4VADVECTION
#define SALINITY
#define TS_U3HADVECTION
#define TS_C4VADVECTION
#define TS_DIF2
#define MIX_GEO_TS
#define DJ_GRADPS
#define MASKING
#define CURVGRID
#undef STATIONS
#define VISC_GRID
#define DIFF_GRID
#define AVERAGES
#define AVERAGES_FLUXES
#define SOLVE3D
#define GLS_MIXING
#define ANA_BSFLUX
#define ANA_BTFLUX
#if defined GLS_MIXING || defined MY25_MIXING
#undef LMD_MIXING
#define KANTHA_CLAYSON
#define N2S2_HORAVG
#define AKLIMIT
#endif
#undef ATM_PRESS
#define ANA_SMFLUX
#define ANA_STFLUX
#define ANA_SSFLUX
#define ANA_SRFLUX
#define ANA_BSFLUX
#define ANA_BTFLUX
#define ANA_INITIAL
#define ANA_FSOBC
#define ANA_M2OBC
#define ANA_M3OBC
-
- Posts: 43
- Joined: Wed Nov 30, 2016 11:18 pm
- Location: University of Massachusetts Dartmouth
Re: unrealistic pressure gradient forming along bathymetry
Thanks very much for all the feedback. Based on your suggestions, I did the following changes which resulted in better performance of the simulation.
- As Kate suggested, I am now using DJ_GRADPS for pressure gradient.
- Deepak, thanks for the feedback. I am currently using biharmonic friction with mixing on GEO surfaces. Also, there was mismatch in my climatological inputs, which is fixed now.
- I changed the 2D fields boundary condition to flather. The strong currents in my simulation are still forming, but last for the first 2-3 day simulation time. They are subsiding eventually.
- John, thanks for your suggestions. The OPENMP version was giving trouble in my system. With openmp I was getting 0.0 minimum grid spacings, which might have been the cause for the blowups.
Metrics information for Grid 01:
===============================
Minimum X-grid spacing, DXmin = 0.00000000E+00 km
Maximum X-grid spacing, DXmax = 9.97359248E-01 km
Minimum Y-grid spacing, DYmin = 0.00000000E+00 km
Maximum Y-grid spacing, DYmax = 9.88258405E-01 km
Minimum Z-grid spacing, DZmin = 0.00000000E+00 m
Maximum Z-grid spacing, DZmax = 3.24032263E+02 m
Thanks everyone.
- As Kate suggested, I am now using DJ_GRADPS for pressure gradient.
- Deepak, thanks for the feedback. I am currently using biharmonic friction with mixing on GEO surfaces. Also, there was mismatch in my climatological inputs, which is fixed now.
- I changed the 2D fields boundary condition to flather. The strong currents in my simulation are still forming, but last for the first 2-3 day simulation time. They are subsiding eventually.
- John, thanks for your suggestions. The OPENMP version was giving trouble in my system. With openmp I was getting 0.0 minimum grid spacings, which might have been the cause for the blowups.
Metrics information for Grid 01:
===============================
Minimum X-grid spacing, DXmin = 0.00000000E+00 km
Maximum X-grid spacing, DXmax = 9.97359248E-01 km
Minimum Y-grid spacing, DYmin = 0.00000000E+00 km
Maximum Y-grid spacing, DYmax = 9.88258405E-01 km
Minimum Z-grid spacing, DZmin = 0.00000000E+00 m
Maximum Z-grid spacing, DZmax = 3.24032263E+02 m
Thanks everyone.