-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Forced flow verification experiment #573
Conversation
Hmm. We know from mathematics that the pressure boundary conditions must be obtained by evaluating the momentum equation on the boundary. If we are not doing that, we are not calculating pressure correctly (therefore, if the test passes, the test is flawed). If we are doing that, then this test could serve as a test that we are doing that correctly. As far as I know we are not evaluating the pressure correctly. Therefore, this test must fail if it is implemented correctly. It must also be noted that this test is incomplete. The pressure boundary condition is obtained by evaluating the momentum equation on the boundary --- and this applies to any momentum equation, including those with LES closures, biharmonic viscosity, anisotropic viscosity, wave-averaged surface wave terms, as well as arbitrary user-defined terms. It is possible to evaluate the momentum equation on the boundary (since we already evaluate in the interior) and use the result to determine inhomogeneous boundary conditions; this is permitted by the algorithm we use and its implementation is described in Schumann and Sweet (1979). |
I think you are referring to the possibility that numerical discretization error may overcome the error associated with a mathematically incorrect boundary condition. While this could be true at a fixed resolution, it will not be true as resolution is increased indefinitely. |
This is a test I tried to implement back in August (thus the old original commit). Noticed it still sitting on a stale branch so I figured I should try to revive it as it could serve as a pretty good verification experiment.
Yeah I'm expecting the test to fail in that we won't see second-order accuracy, but I don't think it shouldn't be blowing up.
Ah because it doesn't test the LES models? I suppose the test was designed for constant diffusivity only.
Hmmm, we have other verification experiments that do pass and in general we're pretty certain that Oceananigans produces the correct results but they've most been at Re > 1 so maybe you're right that numerical discretization errors dominate over this boundary condition error which might be small for most oceanographic simulations. |
All terms in the momentum equation affect the boundary conditions on pressure. This includes user-defined forcings.
I don't think the verification tests show the pressure solver is correct (its not, we know that). They only imply that, if it is not correct, the error associated with it does not corrupt the solution in one particular case. This 'test' seems different. It claims to verify that the pressure field obtained by our numerical method is correct. |
True. But it shows that as we increase the resolution, the solution converges to the analytic solution.
Yes, or at least tell use the order of accuracy on the pressure and velocity fields. |
Former-commit-id: 5355044
e6fda3b
to
22fd496
Compare
Codecov Report
@@ Coverage Diff @@
## master #573 +/- ##
=======================================
Coverage 73.14% 73.14%
=======================================
Files 70 70
Lines 2011 2011
=======================================
Hits 1471 1471
Misses 540 540 Continue to review full report at Codecov.
|
Alright the forced flow test runs now. Explicit time-stepping at Re = 1 is painful though. Next I need to check that it's actually setting up the forced flow solution and do a convergence test. Also to compare the model's pressure against the analytic expression for pressure, not just velocity. |
This PR aims to add the forced flow analytic test as a verification experiment. The test is described in section 6.1 of Brown, Cortez, & Minion (2001) and is used to test various projection methods for the incompressible Navier-Stokes equations.
The reason for implementing this test is to investigate the accuracy of Oceananigans' projection (or fractional step) method following concerns brought up by @sandreza. In particular, we can test whether Oceananigans' time-stepping is indeed second-order accurate in velocity and pressure.
A couple of points regarding the accuracy of projection methods for us:
Right now the test blows up (no matter how small the time step). Not sure why. I'll have to investigate and plots things a bit. Most likely I just set things up incorrectly.