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

[2D manifold in 3D] Add routines to plot the vorticity for the 3D Cartesian SWE #57

Merged
merged 3 commits into from
Dec 3, 2024

Conversation

amrueda
Copy link
Collaborator

@amrueda amrueda commented Dec 3, 2024

This PR introduces the functionality to export solution variables to the hdf5 solution file, which do not only depend on the local numerical solution solution but may depend on the solution variables at other nodes and on the normal vector. The strategy is similar to the one implemented in #51.

In general, the SaveSolutionCallback can be initialized as

save_solution = SaveSolutionCallback(interval = 10,
                                     solution_variables = solution_variables)

where solution_variables is a function that is called at each node (i, j) of each element, which can have the signatures:

  • solution_variables(u, normal_vector_node, equations, dg, cache, i, j, element): Used to compute fields that depend on the entire solution array u, such as the relative vorticity or the Schlieren quantity.
  • solution_variables(u_node, equations): Kept for compatibility with the current version of Trixi, which can use cons2cons, cons2prim, cons2entropy, etc.

To test this functionality, we add the function cons2prim_and_vorticity for the 3D Cartesian SWE, which can be used to export the primitive variables and the relative vorticity. The function is called by default with normal_vector_node= $J \vec{a}^3$, but the user can also set other normal vectors for plotting.

The figure below shows the vorticity at time $t=5$ days for a barotropic instability simulation: computed with normal_vector_node= $\vec{x}$ (left), computed with normal_vector_node= $J \vec{a}^3$ (middle), and computed using the filters of paraview (right).

vorticity

Copy link

codecov bot commented Dec 3, 2024

Codecov Report

Attention: Patch coverage is 86.51685% with 12 lines in your changes missing coverage. Please review.

Project coverage is 89.41%. Comparing base (4f26789) to head (fcef9a2).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
..._step/save_solution_2d_manifold_in_3d_cartesian.jl 86.51% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #57      +/-   ##
==========================================
- Coverage   89.56%   89.41%   -0.16%     
==========================================
  Files          19       20       +1     
  Lines        1706     1795      +89     
==========================================
+ Hits         1528     1605      +77     
- Misses        178      190      +12     

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

@amrueda amrueda changed the title WIP: [2D manifold in 3D] Add routines to plot the vorticity for the 3D Cartesian SWE [2D manifold in 3D] Add routines to plot the vorticity for the 3D Cartesian SWE Dec 3, 2024
tristanmontoya
tristanmontoya previously approved these changes Dec 3, 2024
Copy link
Member

@tristanmontoya tristanmontoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@amrueda amrueda merged commit 8d2dc5a into main Dec 3, 2024
6 of 10 checks passed
@amrueda amrueda deleted the arr/plot_vorticity branch December 3, 2024 14:44
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