How to export bottom drag? #3081
-
I am running a simulation focusing on the bottom mixed layer. How can I export bottom drag if I am interested about that? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Unfortunately there is no user interface to build using Oceananigans.BoundaryConditions: getbc
using Oceananigans: fields
# Boundary condition extractor in "kernel function form"
@inline kernel_getbc(i, j, k, grid, boundary_condition, clock, fields) =
getbc(boundary_condition, i, j, grid, clock, fields)
# Kernel arguments
grid = model.grid
clock = model.clock
model_fields = merge(fields(model), model.auxiliary_fields)
u, v, w = model.velocities
u_bc = u.boundary_conditions.bottom
v_bc = v.boundary_conditions.bottom
# Build operations
u_bc_op = KernelFunctionOperation{Face, Center, Nothing}(kernel_getbc, grid, u_bc, clock, model_fields)
v_bc_op = KernelFunctionOperation{Center, Face, Nothing}(kernel_getbc, grid, v_bc, clock, model_fields)
# Build Fields
u_bc_field = Field(u_bc_op)
v_bc_field = Field(v_bc_op) Note that this will compute the boundary condition directly. So if you specify a boundary condition as Another possibility is simply to write a function that computes the drag as it's been specified. However to do that correctly you need to be careful to handle the staggered grid correctly. If you share your code, we can help with that. |
Beta Was this translation helpful? Give feedback.
-
Hello, I'm also looking into this, is there a new user interface to build the |
Beta Was this translation helpful? Give feedback.
Unfortunately there is no user interface to build
Field
from boundary conditions, though we do need one. It's still possible, but a bit of work. This code is fairly general I think: