|
4 | 4 | % The governing partial differential equation that is discretized is, |
5 | 5 | % |
6 | 6 | % $$ |
7 | | - % Δψ_t = -J(ψ,ω) - {Ro}^{-1} ψ_x -{Re}^{-1} Δω - {Ro}^{-1} F, \\ |
| 7 | + % Δψ_t = -J(ψ,ω) - {Ro}^{-1} \partial_x ψ -{Re}^{-1} Δω - {Ro}^{-1} F, |
8 | 8 | % $$ |
9 | 9 | % where the Jacobian term is a quadratic function, |
10 | 10 | % $$ |
11 | | - % J(ψ,ω) \equiv ψ_x ω_y - ψ_y ω_x, |
| 11 | + % J(ψ,ω) \equiv \partial_x ψ \partial_x ω - \partial_x ψ \partial_x ω, |
12 | 12 | % $$ |
13 | 13 | % the relationship between the vorticity $ω$ and the stream function $ψ$ is |
14 | 14 | % $$ |
15 | 15 | % ω = -Δψ, |
16 | 16 | % $$ |
17 | 17 | % the term $Δ$ is the two dimensional Laplacian over the |
18 | | - % discretization, $Ro$ is the Rossby number, $Re$ is the Reynolds |
| 18 | + % discretization, the terms $\partial_x$ and $\partial_y$ are the first derivatives |
| 19 | + % in the $x$ and $y$ directions respectively, $Ro$ is the Rossby number, $Re$ is the Reynolds |
19 | 20 | % number, and $F$ is a forcing term. |
20 | 21 | % The spatial domain is fixed to $x ∈ [0, 1]$ and $y ∈ [0, 2]$, and |
21 | 22 | % the boundary conditions of the PDE are assumed to be zero dirichlet |
22 | 23 | % everywhere. |
23 | 24 | % |
24 | 25 | % A second order finite difference approximation is performed on the |
25 | 26 | % grid to create the first derivative operators and the Laplacian |
26 | | - % operator. The Jacobian is discretized using the Arakawa approximation |
| 27 | + % operator. |
| 28 | + % |
| 29 | + % The Laplacian is defined using the 5-point stencil |
| 30 | + % $$ |
| 31 | + % Δ = \begin{bmatrix} & 1 & \\ 1 & -4 & 1\\ & 1 & \end{bmatrix}, |
| 32 | + % $$ |
| 33 | + % which is scaled with respect to the square of the step size in each |
| 34 | + % respective direction. |
| 35 | + % The first derivatives, |
| 36 | + % $$ |
| 37 | + % \partial_x &= \begin{bmatrix} & 0 & \\ 1/2 & 0 & 1/2\\ & 0 & \end{bmatrix},\\ |
| 38 | + % \partial_y &= \begin{bmatrix} & 1/2 & \\ 0 & 0 & 0\\ & 1/2 & \end{bmatrix}, |
| 39 | + % $$ |
| 40 | + % are the standard second order central finite difference operators in |
| 41 | + % the $x$ and $y$ directions. |
| 42 | + % |
| 43 | + % The Jacobian is discretized using the Arakawa approximation |
27 | 44 | % CITEME |
28 | 45 | % $$ |
29 | 46 | % J(ψ,ω) = \frac{1}{3}[ψ_x ω_y - ψ_y ω_x + (ψ ω_y)_x - (ψ ω_x)_y + (ψ_x ω)_y - (ψ_y ω)_x], |
|
0 commit comments