Evolving perturbations vs total fields in Nonhydrostatic model #3263
Replies: 21 comments 4 replies
-
b_yz_NH.mp4 |
Beta Was this translation helpful? Give feedback.
-
I probably would have to think a bit about it, but aren't baroclinic instabilities developing on the x-y plane? Can you represent a baroclinic instability process with 1 point in the jet direction? |
Beta Was this translation helpful? Give feedback.
-
This is a baroclinic jet and you are correct that having a Flat topology prevents any baroclinic instabilities from happening. We are actually studying inertial instabilities, and they can occur in a y-z plane. |
Beta Was this translation helpful? Give feedback.
-
One thing that might be easier to ask for help with his, I wanted to print out the norm of the perturbation buoyancy in both cases. When we evolve the perturbation this is easy, but when we evolve the total field, I couldn't figure out how to do it. Do you have a recommendation? This would be helpful to determine how the norm changes with resolution. |
Beta Was this translation helpful? Give feedback.
-
I gues something like this would work B₀ = CenterField(grid)
set!(B₀, B)
b = model.tracers.b
b′² = Field(Average((b - B₀)^2)) |
Beta Was this translation helpful? Give feedback.
-
Thanks for the suggestion @simone-silvestri . Building on your suggestion, what I tried below seemd to do the trick. Cheers!
|
Beta Was this translation helpful? Give feedback.
-
@simone-silvestri , thanks to your help I am now able to print out the norms of the perturbation buoyancy in the case when we evolve the total fields. The error that arises in this case, but not when we evolve the perturbation fields, decreases quadratically with increasing resolution. I could pick a resolution where this is small but in the first hour the norm or buoyancy grows by three orders of magnitude, which looks like an instability. It is not noisy and very well resolved, it can't be a baroclinic instability and does not look anything like an inertial instability. |
Beta Was this translation helpful? Give feedback.
-
Is it because your initial condition is only geostrophically balanced in the continuous limit? You may need to compute the velocity field that's in discrete geostrophic balance with your initial buoyancy field. You are using analytical formula for both U(x, y, z) = Umax / cosh(y/Lⱼ)^2 * exp(-(z-z0)^2/D^2)
B(x, y, z) = N² * z + 2*f*Umax*Lⱼ/D^2 * (tanh(y/Lⱼ)) * (z-z0) * exp(-(z-z0)^2/D^2) but to satisfy the discrete geostrophic balance you would have to compute one of those fields from the other one, in a manner consistent with how Coriolis forces are implemented. |
Beta Was this translation helpful? Give feedback.
-
Something like this might work: B(x, y, z) = N² * z + 2*f*Umax*Lⱼ/D^2 * (tanh(y/Lⱼ)) * (z-z0) * exp(-(z-z0)^2/D^2)
set!(model, b=B) # this calls `update_state!`, and thus calculates the hydrostatic pressure associated with buoyancy
f = model.coriolis.f
ph = model.pressures.pHY′
U = - ∂y(ph) / f
set!(model, u=U) Curious to see if that solves it. And just for sanity we can look into the source to ensure that the hydrostatic pressure is indeed calculated during Not a terrible idea to plot |
Beta Was this translation helpful? Give feedback.
-
Thanks @glwagner for the suggestion. We will try this out and see if we can improve our results, and if this instability disappears. Actually, we found that the Hydrostatic model suffers from the same problem, and since it solves for the total field that is maybe not surprising. So confirming the hydrostatic pressure is a very good idea! |
Beta Was this translation helpful? Give feedback.
-
@glwagner : I was able to get your suggestion working very easily, thanks again. Unfortuantely it doesn't help is removing the error that is introduced in the centre or the fact that it grows exponentially (I am guessing). I have looked at the pressure and it looks smooth but I suppose looking at the pertrubation pressure might be more telling. |
Beta Was this translation helpful? Give feedback.
-
Can you confirm that there is hydrostatic balance at the discrete level? It might help to plot the deviation from thermal wind, for example, to get a clue as to what's going on. |
Beta Was this translation helpful? Give feedback.
-
PS can we convert this to a discussion? I very much doubt this is a bug in the source code and it might be nice to have the discussion format to organize our ideas to solve this problem |
Beta Was this translation helpful? Give feedback.
-
I was thinking the same! |
Beta Was this translation helpful? Give feedback.
-
Thank you for the great suggestions so far. I see no problem with converting this thread to a discussion. Although the problem is not solved yet, we have done some investigation around it:
leads to no perturbation when evolving the total fields.
|
Beta Was this translation helpful? Give feedback.
-
Why not? When evolving the total fields, the condition of geostrophic balance is computed during the prognostic evolution of the total variables. When evolving just the perturbation, the algorithm for mean-perturbaiton decomposition assumes that the mean fields are balanced. There is no need to worry about the tiny difference between discrete and continuous balance in the case that you only evolve perturbations. But if you want to evolve the geostrophically balanced state, you must ensure that it is perfectly balanced to within machine precision, or you will have an adjustment. That's the basis for my suggestion. I'm not sure the computation I recommended achieves numerical balance (something might be missing) --- that should be checked. |
Beta Was this translation helpful? Give feedback.
-
I'm not sure I understand. The error is only associated with post-processing and not with the actual simulation? |
Beta Was this translation helpful? Give feedback.
-
@glwagner : did you want to convert this to a discussion before we go further in our chat? |
Beta Was this translation helpful? Give feedback.
-
Yes if youre ok with that I will |
Beta Was this translation helpful? Give feedback.
-
@glwagner : We have followed up on your suggestion and have computed the error in geostrophic and hydrostatic balance at the initial time. The animation included here shows the results for the first 10 minutes. In the geostrophic equation we get errors on the order of O(1e-7), which is about 100 times smaller, than the two terms in the equation. This shows that the error is about 1 percent. The hydrostatic equation, on the other hand, looks to be zero from the animation O(1e-17) but upon further investigation, we find that the pressure at the bottom is O(1e-2) and at the top we have O(1e-6). The pressure in the interior is zero to machine precision. Something has gone wrong in the calculation for the hydrostatic pressure at the very top and the very bottom, and wonder how we can fix this. gbhb.mp4 |
Beta Was this translation helpful? Give feedback.
-
I have thougth about this a bit more and I believe I have identified two sources of error. First, when I look at the vertical derivative of pressure at the top and bottom it is 0. We are not imposing what boundary conditions to impose on pressure and I guess it's assuming homogeneous Neumann boundary conditions, which is not correct. Is there something else we need to do after Second, we are not being careful enough with the positioning of variables. To test geostrophic and hydrostatic balance we used the following equations,
Since both u and p are at centres in the y direction, computing a y derivative then moves pressure to a different location. Similary, pressure and buoyancy are both at centres in the vertical, and the z derivative then moves one of the fields to the wrong location. I presume we need to do an 2 dimensional interpolation after we compute the derivative in each case to end up at the centres? |
Beta Was this translation helpful? Give feedback.
-
@m3azevedo and me are doing a simulation of an unstable baroclinic jet in the context of the Nonhydrostatic model and having some success but some difficulties as well.
We have tried two different approaches:
Method 1: define the jet and stratification to be part of the background field and evolve the perturbations.
Method 2: define the jet and stratification as part of the initial conditons and evolve the total field.
These are mathematically equivalent and should both yield the same results, but we are finding a difference and believe there is a problem with method 2 (evolving the total fields).
When pick there to be zero perturbations, the jet is an exact solution to the governing equations (even though it is an unstable one) and it should persist, until perturbations arise because of numerical errors.
The good news is that when we use method 1, evolve the perturbations, when we pick zero perturbations, no pertrubations develop for a long time.
The not so good news, is that when we use method 2, evolve the total field, a distrubance develops right away,in the center of the jet that spans the entire depth, and this seems to radiate gravity waves to the left and right. The amplitude of the distrubance is small and it does decrease with increasing resolution but it seems problematic.
I am going to include an animation that shows the problem that develops in the first 6 hours and the two codes, which are almost identical. Is there something that we are doing wrong here? @glwagner ?
Method 1: Evolve perturbations
Method 2: evolve total field
Beta Was this translation helpful? Give feedback.
All reactions