Skip to content

B grid dynamics #55

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

Open
wants to merge 121 commits into
base: main
Choose a base branch
from
Open

B grid dynamics #55

wants to merge 121 commits into from

Conversation

simone-silvestri
Copy link
Collaborator

This PR will require quite some time because it is experimental and here just for documentation purposes.

@simone-silvestri simone-silvestri changed the title B grid dynamics and BBM rheology B grid dynamics May 5, 2025
@simone-silvestri
Copy link
Collaborator Author

simone-silvestri commented May 6, 2025

Difference between C-grid and B-grid dynamics in the cyclone case showing the advantage of less interpolation for rheology in the B-grid:

This PR:
https://clima.github.io/ClimaSeaIceDocumentation/previews/PR55/literated/ice_advected_by_anticyclone/

C-grid (main)
https://clima.github.io/ClimaSeaIceDocumentation/dev/literated/ice_advected_by_anticyclone/

These results are expected and shown in
https://agupubs.onlinelibrary.wiley.com/doi/pdfdirect/10.1029/2021ms002523

Edit: The resolutions are different! I will produce new plots

Down here the videos of the cgrid cyclone case (main)

cgrid_anticyclone.mp4

and the bgrid case (this PR)

bgrid_anticyclone.mp4

@simone-silvestri
Copy link
Collaborator Author

Also, looking at the immersed example https://clima.github.io/ClimaSeaIceDocumentation/previews/PR55/literated/ice_advected_on_coastline/ the behavior is the expected one: given that we have impenetrable conditions on immersed boundaries, there is a small ice block that remains attached downstream the triangular element, in a physical shape. The same is not possible to obtain on c-grid without messing up quite significantly with the rheology and the momentum tendencies

@simone-silvestri
Copy link
Collaborator Author

Also noteworthy to mention, on CPUs the b-grid EVP formulation is about twice as fast as the C-grid because it avoids computing the viscosity on both cca and ffa points.

@glwagner
Copy link
Member

glwagner commented May 6, 2025

How do you select B- vs C-grid dynamics? Can you give an example of the user interface + abstractions implemented?

@simone-silvestri
Copy link
Collaborator Author

The user interface would not change, only the numerical discretization of the rheology, so the user does not necessarily "see" this change, but has to keep it into account (the u and v are not on edges anymore but on nodes).

I think it would be quite messy to allow both B and C grid (it effectively duplicates a lot of the code) so my idea was just stick with one discretization.

@simone-silvestri simone-silvestri mentioned this pull request May 14, 2025
Copy link

codecov bot commented May 21, 2025

Codecov Report

Attention: Patch coverage is 80.83333% with 23 lines in your changes missing coverage. Please review.

Project coverage is 74.00%. Comparing base (a922f71) to head (9c6c6a0).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/sea_ice_advection.jl 50.00% 11 Missing ⚠️
...SeaIceMomentumEquations/sea_ice_external_stress.jl 0.00% 6 Missing ⚠️
src/Rheologies/viscous_rheology.jl 60.00% 4 Missing ⚠️
src/Rheologies/elasto_visco_plastic_rheology.jl 95.65% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #55      +/-   ##
==========================================
+ Coverage   70.44%   74.00%   +3.55%     
==========================================
  Files          27       27              
  Lines         829      777      -52     
==========================================
- Hits          584      575       -9     
+ Misses        245      202      -43     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants