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

WIP: 2D covariant form using P4estMesh #31

Draft
wants to merge 60 commits into
base: main
Choose a base branch
from

Conversation

tristanmontoya
Copy link
Member

@tristanmontoya tristanmontoya commented Aug 17, 2024

This PR contains a preliminary implementation of a two-dimensional DG solver for PDEs on surfaces in covariant form, starting here with the variable-coefficient linear advection equation on the sphere. It should be merged after #34.

I defined a new P4estElementContainerCovariant type to carry the specific geometric information needed for the covariant form. Since only the scalar advection equation is supported so far, I didn't add Christoffel symbols as part of this PR.

Trixi.jl's rhs!, weak_form_kernel!, flux_differencing_kernel!, compute_coefficients!, calc_interface_flux!, max_dt, and calc_error_norms functions are specialized in dg_2d_manifold_in_3d_covariant.jl so as to dispatch on the new type AbstractCovariantEquations{NDIMS, NVARS}. The physical and numerical fluxes called by those functions take in the container, elements, as well as the node and element indices, so that all the geometric information can be accessed by these fluxes. This way, we do not need to store the spatially varying geometric quantities that the contravariant fluxes depend upon as auxiliary solution variables as I did in an earlier implementation of my spherical shallow water solver.

The initial condition is prescribed with zonal and meridional velocity or momentum components, which then get transformed in compute_coefficients! to get the local contravariant components. An additional elixir elixir_spherical_advection_covariant.jl has been added as an example of this, using a smooth Gaussian bell test case adapted from the standard Cosine bell case (Case 1 from the Williamson et al. test suite). Standard values of geophysical parameters are provided as constants in src/equations/equations.jl.

This PR also includes tests for the new weak-form and flux-differencing solvers, which give the same results when the arithmetic mean is used for the two-point volume flux.

tristanmontoya and others added 28 commits July 18, 2024 21:57
…tion in Trixi.jl (cherry-picked from f45378e)

Co-authored-by: Tristan Montoya <[email protected]>
…ltype() and ndims() functions for new struct
@tristanmontoya tristanmontoya marked this pull request as draft August 17, 2024 22:48
Copy link

codecov bot commented Aug 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.56%. Comparing base (223fefe) to head (7d7ec99).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #31      +/-   ##
==========================================
+ Coverage   81.78%   86.56%   +4.77%     
==========================================
  Files           8       11       +3     
  Lines         829     1109     +280     
==========================================
+ Hits          678      960     +282     
+ Misses        151      149       -2     

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

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