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
989 stars 194 forks source link

Incompressibility and pressure projection step test #673

Closed ali-ramadhan closed 4 years ago

ali-ramadhan commented 4 years ago

From call with @glwagner: We should properly test that the pressure projection step produces an incompressible flow field (without computing w from continuity).

Right now the incompressible_in_time test found in test_time_stepping.jl tests for incompressibility after time_step! is done and w has been recomputed from w.

Interestingly, the sum accumulated in time while the sum of the absolute values does not:

[04/03/2020 13:57:51] Velocity divergence after 1 time steps [CPU, Float64]: min=-6.037244272213971e-19, max=-6.037244272213971e-19, sum=-1.9275293505266353e-22, abs_sum=1.284399769586337e-16 ---  Info /home/travis/build/climate-machine/Oceananigans.jl/test/test_time_stepping.jl:106
[04/03/2020 13:57:52] Velocity divergence after 10 time steps [CPU, Float64]: min=-7.735240399597831e-19, max=-7.735240399597831e-19, sum=1.666113807244092e-21, abs_sum=1.5625275138570133e-16 ---  Info /home/travis/build/climate-machine/Oceananigans.jl/test/test_time_stepping.jl:106
[04/03/2020 13:58:06] Velocity divergence after 100 time steps [CPU, Float64]: min=-6.005395833397209e-19, max=-6.005395833397209e-19, sum=8.58925289833789e-20, abs_sum=2.661629631159426e-16 ---  Info /home/travis/build/climate-machine/Oceananigans.jl/test/test_time_stepping.jl:106
ali-ramadhan commented 4 years ago

We should properly test that the pressure projection step produces an incompressible flow field (without computing w from continuity).

This is being done since PR #711.

I believe the convergence tests (see PR #767 and plots in PR #881) do test that the pressure projection method is indeed 2nd-order so I'm closing this issue.