CliMA / Oceananigans.jl

🌊 Julia software for fast, friendly, flexible, ocean-flavored fluid dynamics on CPUs and GPUs
https://clima.github.io/OceananigansDocumentation/stable
MIT License
958 stars 191 forks source link

Model not enforcing zero vertical shear at top and bottom (do we expect this?) #540

Closed ali-ramadhan closed 3 years ago

ali-ramadhan commented 4 years ago

@sandreza noticed that when running free convection simulations with AMD the horizontally averaged u and v velocities profiles do not flatten at the top and bottom.

That is, he was expecting that ∂u/∂z and ∂v/∂z would go to zero at the top and bottom but they do not.

He is using no-flux boundary conditions which should enforce zero-gradient at the boundary. Maybe we only expect to see a smoothly vanishing vertical shear once the tiny diffusive boundary layer is resolved?

Not 100% sure if there is an issue or where the potential bug would be. Should probably try using a constant isotropic diffusivity and seeing if increasing the resolution helps.

cc @jm-c who might have ideas or advice.

ali-ramadhan commented 4 years ago

@sandreza Is ∂u/∂z the problematic quantity or is it the horizontally averaged RMS shear \overline{(∂u/∂z)^2}? Maybe both.

We should make sure it's not an issue with diagnostics or abstract operators by comparing the horizontal average profile with the same profile diagnosed from 3D fields.

glwagner commented 4 years ago

Our finite volume numerical method does not enforce gradients or values of fields. The numerical method we use solves the weak form of the equations. In practice, we infer fluxes from the user-prescribed boundary conditions, and ensure that the volume-integrated budget for each field is locally conserved.

A separate issue is the distinction between direct numerical simulation and large eddy simulation of fluids. In direct numerical simulation, all scales of motion are resolved, down to the smallest scales of motion where fields are smooth due to the action of molecular diffusion. Thus in direct numerical simulation, we expect fields to smoothly vary at the grid scale, which further implies that the volume-averaged values of fields adjacent to boundaries will be close to satisfying the boundary conditions. Note that the values of fields still will not be exactly equal to the boundary conditions. For example, the cell-averaged velocity field adjacent to a no-slip wall is not zero --- it is just small.

In large eddy simulation, a possibly infinite range of scales is unresolved by the numerical solution, depending on the ratio between the grid scale and the Kolmogorov scale below which molecular diffusion dominates. For example, a typical oceanic boundary layer simulation might have a grid resolution of 0.5 m, whereas the Kolmogorov scale can be as small as 0.1 mm (or less, especially close to boundaries). Thus a large fraction of the flow structure is unresolved on a coarse 0.5 m grid. More importantly, there is no physical reason to expect that resolved LES fields, which should be interpreted as some "filtered" version of the exact solution, are smooth at the grid scale. Due to this, a "no-flux" or "zero gradient" boundary conditions does not guarantee that the gradient of a field is zero across any boundary-adjacent region. Because we do not enforce gradients or values of fields at boundaries, and because coarse LES does not guarantee smoothness of fields, we do not expect the values and gradients of fields to tend to their exact values adjacent to boundaries.

Note that in cases where a value or gradient condition implies a non-zero flux of some quantity across a boundary, one typically should use a "wall model" to approximate fluxes across boundaries in LES. Otherwise, fluxes across boundaries will be approximated by the LES subfilter flux model, which in principle is not well-defined on boundaries.

For ocean surface boundary layer problems, fluxes are typically prescribed at a free surface, which circumvents this issue to some degree; budgets are prescribed. But the problem of modeling dynamics near the ocean surface affected by waves, wave breaking, capillary waves, and bubbles in LES with rigid lids is difficult and in general, I think, unsolved. The uppermost grid points in ocean LES are thus likely unrealistic in general. A corollary of this point is that it is important to choose problems in which interior turbulent mixing is not strongly affected by the necessarily incorrect and unrealistic dynamics close to the surface.

ali-ramadhan commented 4 years ago

@glwagner's post might be relevant to @sandreza, @rafferrari, and @kburns.

ali-ramadhan commented 3 years ago

@glwagner Should we close this issue?

glwagner commented 3 years ago

Yes --- we have convergence tests that demonstrate the accuracy of our method at solid boundaries.