Replies: 3 comments 3 replies
-
I don't know of any examples; it be nice to build one up! Right now this requires some source code knowledge. The way to do this is to use so we can build a using Oceananigans.Advection: div_Uc
tracer = model.tracers.T # for flux divergence of temperature
advection_scheme = model.advection.T
velocities = model.velocities
advective_flux_divergence_op = KernelFunctionOperation{Center, Center, Center}(div_Uc, advection_scheme, velocities, tracer) The operation can be computed with advective_flux_divergence = Field(advective_flux_divergence_op)
compute!(advective_flux_divergence) The syntax is a little different for hydrostatic models vs nonhydrostatic models (which don't support different advection schemes for velocities and tracers yet). To calculate the flux itself, then we need the functions Oceananigans.jl/src/Advection/tracer_advection_operators.jl Lines 30 to 34 in fa5e280 those would be built with, for example, advective_flux_x_op = KernelFunctionOperation{Face, Center, Center}(_advective_tracer_flux_x, advection_scheme, velocities.u, tracer) Note the location We could improve the user experience here. For example, there are two functions: one "outer" function |
Beta Was this translation helpful? Give feedback.
-
Thanks @glwagner, this is a helpful pointer for getting started on this. I'll give it a shot. |
Beta Was this translation helpful? Give feedback.
-
@hdrake I may be misunderstanding your question, but note that Oceanostics has a module for tracer variance terms here: https://github.com/tomchor/Oceanostics.jl/blob/main/src/TracerVarianceBudgetTerms.jl Is this what you need? Although at the moment we only have They follow the same pattern described by @glwagner, so you can also look there for examples. If you do go through the trouble of implementing these other terms, I'd really appreciate if you could share it so that we can include it in Oceanostics and make it easier for future users . (And ofc feel free to add them there yourself!) |
Beta Was this translation helpful? Give feedback.
-
Are there any examples/validation experiments that show how a closed tracer budget can be diagnosed from
Oceananigans.jl
? I realize budget terms could be approximated manually by discretizing the various operators in the budget, but this does not ensure they will be consistent with how they are computed online (which will depend on timestepping scheme, advection scheme, corrections for anisotropic grids, etc.).It seems like @tomchor has already tackled the more challenging problem of TKE budgets in Oceanostics, but I have not found a simple cell-wise tracer budget example.
Beta Was this translation helpful? Give feedback.
All reactions