CliMA / ClimateMachine.jl

Climate Machine: an Earth System Model that automatically learns from data
https://clima.github.io/ClimateMachine.jl/latest/
Other
453 stars 78 forks source link

Grid imprinting in specific variables (per unit mass) due to filtering, and energy-momentum leakage #2116

Open ilopezgp opened 3 years ago

ilopezgp commented 3 years ago

Description

The application of DG filters to conservative variables, e.g. "energy.ρe", can lead to grid imprinting in specific variables per unit mass, such as the potential temperature θ. This issue is demonstrated with an Anelastic1D simulation of a dry neutrally stratified Ekman layer in DG, using polynomial order N=4 and filtering in "energy.ρe". The setup to reproduce these results can be found in PR #2112.

In addition, there seems to exist leakage from momentum into the energy field. The potential temperature in this simulation should stay constant, since there is no buoyancy forcing of any kind. We will see below that this is not the case.

Finally, the horizontal velocity should develop the classical Ekman spiral over time, starting from an initial constant velocity profile. The vertical extent of the Ekman layer depends on the strength of SGS diffusion. Here, I consider two cases: 1) Constant kinematic viscosity of 0.1, 2) Smagorinsky-Lilly diffusion with parameter equal to 0.21.

To showcase the problem, I first perform a simulation using the aforementioned configuration for 9 simulation hours and NO FILTERING. Results are shown in the figure below for constant kinematic viscosity of 0.1.

Screen Shot 2021-03-15 at 4 05 45 PM

Note that in the previous figure, the potential temperature field experiences perturbations that mimic the horizontal velocity structure. These perturbations are not physical, to my knowledge.

Grid imprinting is not an issue in the previous simulation. However, it appears when applying filtering. I consider now the same simulation, using Boyd Vandeven filtering with Nc=1, s=4, following the tutorial. The results are shown below,

Screen Shot 2021-03-15 at 4 13 03 PM

Note that there is grid imprinting throughout the θ profile caused by the filter. Continuing through the examples in the tutorial, I use now Nc=1, s=8,

Screen Shot 2021-03-15 at 4 15 21 PM

with no substantial change. The results change when going to Nc=1, s=32. I have now only included the θ profile and a zoom, since the velocity profile is equivalent to the others shown.

Screen Shot 2021-03-15 at 4 19 48 PM

The situation improves with Nc=1, s=32, although the problem prevails with a smaller magnitude. Is this good enough? Let's look at a slightly more complicated case, where θ actually affects the dynamics of the Ekman layer: Smagorinsky-Lilly diffusion. I include below results for Nc=1, s=32 using this closure,

Screen Shot 2021-03-15 at 4 27 09 PM

We can see that now the imprinting comes back. Note that I have adjusted the scale, the imprinting wavelength has not changed. We can see that using this closure, there is still noise in the velocity profile which was not present in the constant kinematic viscosity case. Shown below are results using Nc=1, s=4 and the same SGS closure,

Screen Shot 2021-03-15 at 4 29 31 PM

The message is unchanged changing the filter parameters. To verify that the filter is the culprit using the Smagorinsky-Lilly closure, I run the simulation again without filter,

Screen Shot 2021-03-15 at 4 34 47 PM

and the imprinting goes away.

Summary:

mwarusz commented 3 years ago

I think that the strong grid imprinting here is caused by the filter acting on the full energy and not just the perturbation from the reference state. See below a plot of potential temperature at the final time using Boyd Vandeven filter with Nc=1, s=4 acting only on the energy perturbation. test

Note that it is currently not straightforward to filter perturbations for a single prognostic variable (or a subset). This capability needs to be added to AtmosFilterPerturbations. Alternatively, filtering only the tendency (using the overintegration filter hooks) might be an option.

tapios commented 3 years ago

Thanks, @mwarusz. Filtering perturbations from reference state helps, but is not the general solution to the problem. Deviations from reference state can be substantial, and then the problem remains that we are filtering a quantity that does not physically mix. We should always filter conservable, specific (per unit mass) quantities. You can then still add filtering perturbations from reference state for the specific quantities.

And, yes, filtering tendencies rather than states helps too.