No-Slip Boundary Condition #2478
-
Hello everyone! I'm studing an example with 2d turbulence and I would like to modify it to study a domain with no-slip boundaries. So, I have changed the model:
After the simulation is complete (the rest of the code has not changed) I see that, e.g.,
How can I set no-slip (zero velocity) boundary conditions? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @parfenyev ! Thanks for opening a discussion! In short: what you're seeing is expected! Oceananigans uses a finite volume method, which means that the numbers you see represent cell-averaged values for the field. Finite volumes solve equations in the "weak form", which means they time-step a volume-integrated form of the equations. They differ from "strong form" methods like finite difference or typical pseudospectral / global spectral methods in which the discretized field represents a continuous field evaluated at particular points. (One reason why In this case, you're printing values for y-velocity component So while you can't verify that the no-slip condition is enforced by looking for "0" somewhere in your field, you can verify that the effect of the no-slip condition is felt (ie, momentum should be extracted). One thing you can try is to visualize two cases: one with free-slip conditions (the default), and one with no-slip conditions (what you've written), and see if you can detect the difference. You also likely want to increase the diffusivity from 1e-5. For a resolution 128^2 with no-slip / viscous boundary layers, maybe something like 1e-3 or 1e-2 is more reasonable? You can also try the initial condition # streamfunction psi(x, y) = sin(x) * sin(y)
ui(x, y, z) = sin(x) * cos(y)
vi(x, y, z) = - cos(x) * sin(y)
set!(model, u=ui, v=vi) It'd be great to see the results too if you want to post them in this discussion! |
Beta Was this translation helpful? Give feedback.
Hi @parfenyev ! Thanks for opening a discussion!
In short: what you're seeing is expected!
Oceananigans uses a finite volume method, which means that the numbers you see represent cell-averaged values for the field. Finite volumes solve equations in the "weak form", which means they time-step a volume-integrated form of the equations. They differ from "strong form" methods like finite difference or typical pseudospectral / global spectral methods in which the discretized field represents a continuous field evaluated at particular points. (One reason why
heatmap
is in fact a really nice way to visualize finite volume fields!)In this case, you're printing values for y-velocity component
v
.…