Add util calculating the streamfunction for a velocity field#5367
Open
mncrowe wants to merge 1 commit intoCliMA:mainfrom
Open
Add util calculating the streamfunction for a velocity field#5367mncrowe wants to merge 1 commit intoCliMA:mainfrom
util calculating the streamfunction for a velocity field#5367mncrowe wants to merge 1 commit intoCliMA:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently a blank PR. The ultimate goal is to implement a streamfunction calculation for the flow, using poisson inversion (and hopefully re-using the current pressure inversion code).
If the flow is purely 2D, we can get a nice streamfunction$(u, v) = (\partial_y \psi, -\partial_x \psi)$ by solving $\nabla^2\psi = -\zeta$ where $\zeta$ is vertial vorticity.
If the flow is 3D, we can't necessarily get a 2D streamfunction at each height,$z$ , as the streamfunction implicitly assumes the flow is divergence free. E.g. Consider the strain flow $(u, v, w) = (\alpha x, \alpha y, -2\alpha z)$ . A streamfunction would have $\partial_x \psi = -\alpha y$ and $\partial_y \psi = \alpha x$ so second order mixed derivatives ($\partial_x\partial_y \psi$ ) are inconsistent.
Instead we'd need a full Helmholtz decomposition:$\textbf{u} = \nabla \phi + \nabla \times \textbf{A}$ . This is non-unique so we'd need to think about a gauge condition. It's probably best to use a Coulomb condition (set $\nabla\cdot \textbf{A} = 0$ ) so the inversion is $\nabla^2 \textbf{A} = -\nabla\times\textbf{u}$ .
Things to note: