Skip to content

Fix the barotropic streamfunction calculation#621

Merged
xylar merged 2 commits into
MPAS-Dev:masterfrom
xylar:fix-bsf-boundary-conditions
Apr 13, 2025
Merged

Fix the barotropic streamfunction calculation#621
xylar merged 2 commits into
MPAS-Dev:masterfrom
xylar:fix-bsf-boundary-conditions

Conversation

@xylar
Copy link
Copy Markdown
Collaborator

@xylar xylar commented Apr 13, 2025

The fix involves:

  • detecting boundary edges
  • finding all the unique loops for each continent or island
  • finding a unique list of pairs (excluding the edge that
    would close the loop
  • creating a sparse matrix with:
    • A Poisson equation for the BSF in terms of the vertically
      integrated vorticity at each vertex
    • Adding a constraint on each pair of boundary vertices found
      above ensuring that their values are equal
    • Adding a constraint that the BSF at the first vertext is
      zero
    • Adding the transpose of these boundary conditions so that
      the matrix is square
  • the right-hand side involves the vertically integrated vorticity
    and zeros for the boundary conditions
  • the solution involves the BSF and a Lagrange multiplier (dropped)
    for each boundary condition

xylar added 2 commits April 12, 2025 21:11
The fix involves:
* detecting boundary edges
* finding all the unique loops for each continent or island
* finding a unique list of pairs (excluding the edge that
  would close the loop
* creating a sparse matrix with:
  * A Poisson equation for the BSF in terms of the vertically
    integrated vorticity at each vertex
  * Adding a constraint on each pair of boundary vertices found
    above ensuring that their values are equal
  * Adding a constraint that the BSF at the first vertext is
    zero
  * Adding the transpose of these boundary conditions so that
    the matrix is square
* the right-hand side involves the vertically integrated vorticity
  and zeros for the boundary conditions
* the solution involves the BSF and a Lagrange multiplier (dropped)
  for each boundary condition
@xylar
Copy link
Copy Markdown
Collaborator Author

xylar commented Apr 13, 2025

I'm now seeing constant values along boundaries in ParaView in cases that didn't have them before the fix. I'll post MPAS-Analysis plots once I have them.

@xylar xylar marked this pull request as ready for review April 13, 2025 17:16
@xylar
Copy link
Copy Markdown
Collaborator Author

xylar commented Apr 13, 2025

This worked as expected in testing in MPAS-Dev/MPAS-Analysis#1074.

@xylar xylar merged commit 3435ae7 into MPAS-Dev:master Apr 13, 2025
6 checks passed
@xylar xylar deleted the fix-bsf-boundary-conditions branch April 13, 2025 17:17
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.

1 participant