Skip to content
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

Add tests and plots for steady-state velocity #3593

Merged
merged 1 commit into from
Feb 22, 2025

Conversation

dennisYatunin
Copy link
Member

@dennisYatunin dennisYatunin commented Feb 5, 2025

Purpose

This PR adds tests for the steady-state velocity in box setups with analytically-defined topography, as well as plots of errors and level/column averages. Together with #3552, this supercedes #3182.

The changes to the driver are:

  • Add a "check_steady_state" flag to the config, which is false by default
  • When the flag is true and the topography has a well-defined Fourier transform, compute the predicted steady-state velocity by integrating the Fourier transform of the frist-order velocity perturbation across all wavenumbers
    • The steady-state velocity on centers and faces is stored in the AtmosCache
  • Generalize the topography elevation functions so that their parameters can be reused to compute analytic solutions
  • Add two new types of horizontally periodic topography (2D and 3D cosine hills)
  • Add a ConstantBuoyancyFrequencyProfile initial condition, which is currently required to compute analytic solutions
  • Include the face velocity field ᶠu in the precomputed quantities, and use this value in comparisons against analytic solutions
    • Update the diagnostics to save the vertical component of velocity using ᶠu instead of ᶜu, in order to accurately capture behavior at the boundaries
  • Add plots that show slices of velocity components as they approach steady-state, plots of the errors relative to analytic solutions, and plots of row-wise/column-wise RMS averages of the errors
    • Tests that involve a single mountain (Schar or Agnesi) also have plots that are zoomed in on the mountain
  • Add an @test for simulations that run for longer than 1 day and can reach steady-state
    • For vertical velocity, check that the error is less than 0.05%
    • For horizontal velocity, check that the error is less than 0.5% for Float64 and 5% for Float32 (we should figure out why horizontal velocity diverges with Float32 at some point)

The changes to CI are:

  • The Schar mountain test case is added back to our CI with the ConstantBuoyancyFrequencyProfile initial condition and the discretization outlined in the dycore paper
    • It is also split into separate Float32 and Float64 tests
  • The Agnesi mountain test case is updated to use the same initial condition and discretization as the Schar mountain tests cases, with Float64 precision
  • To test the topographic forcing for a specific wavenumber, I am also adding 3 tests with cosine topography
    • One test is 2D, another is extruded 2D, and the third is full 3D
  • To test general issues with our steady-state solution, I am also adding a test with no topography
    • The gradual divergence of horizontal velocity observed in this test seems to be greatly exacerbated by the presence of topography and the use of Float32 precision
  • All of these tests are run on GPUs because they have very small grid spacing
    • The analytic solutions for the Schar and Agnesi mountains also take a very long time to compute on CPUs

I'm planning to eventually remove the cosine topography tests, and instead use 3D and extruded 2D versions of the Schar mountain. However, these will take a while to run, so I will add them to the longruns in a future PR.


  • I have read and checked the items on the review checklist.

@dennisYatunin dennisYatunin force-pushed the dy/steady_state_tests branch 9 times, most recently from 5d942f0 to 6dd993b Compare February 5, 2025 17:17
@dennisYatunin dennisYatunin force-pushed the dy/steady_state_tests branch 5 times, most recently from 5eb9b48 to 9d7a2b6 Compare February 6, 2025 04:45
@dennisYatunin dennisYatunin force-pushed the dy/steady_state_tests branch 11 times, most recently from a5f1c6e to 04de999 Compare February 14, 2025 22:27
@dennisYatunin dennisYatunin force-pushed the dy/steady_state_tests branch 2 times, most recently from a5d5fb3 to 0475433 Compare February 15, 2025 01:09
@dennisYatunin dennisYatunin force-pushed the dy/steady_state_tests branch 21 times, most recently from 74fe4ae to e566906 Compare February 22, 2025 01:45
@dennisYatunin dennisYatunin force-pushed the dy/steady_state_tests branch 2 times, most recently from f6c7e22 to 35e9477 Compare February 22, 2025 02:35
@dennisYatunin dennisYatunin added this pull request to the merge queue Feb 22, 2025
Merged via the queue into main with commit 33d6032 Feb 22, 2025
15 of 20 checks passed
@dennisYatunin dennisYatunin deleted the dy/steady_state_tests branch February 22, 2025 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants