Skip to content

Commit 4e43e7f

Browse files
authored
Merge pull request #43 from FourierFlows/UpdateDocs
Update docs
2 parents 9d234b7 + 740c594 commit 4e43e7f

File tree

16 files changed

+280
-85
lines changed

16 files changed

+280
-85
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@ fastest possible code.
8282

8383
## Future work
8484

85-
The code is in the chaos stage of development. A main goal for the future
85+
The code is in the chaotic stage of development. A main goal for the future
8686
is to permit the use of shared memory parallelism in the compute-intensive
8787
routines (shared-memory parallelism provided already by FFTW/MKLFFT, but
8888
is not yet native to Julia for things like element-wise matrix multiplication,
8989
addition, and assignment). This feature may possibly be enabled by
9090
Intel Lab's [ParallelAccelerator][] package.
9191

9292

93-
# Authors
93+
# Developers
9494

9595
FourierFlows is currently being developed by [Gregory L. Wagner][] (@glwagner)
9696
and [Navid C. Constantinou][] (@navidcy).

docs/make.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ makedocs(modules=[FourierFlows],
55
sitename = "FourierFlows.jl",
66
pages = Any[
77
"Home" => "index.md",
8+
"Modules" => Any[
9+
"modules/twodturb.md",
10+
"modules/barotropicqg.md"
11+
],
812
"DocStrings" => Any[
913
"man/docstrings.md"
1014
]

docs/src/index.md

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ The code solves partial differential equations of the general form:
2828

2929
$\partial_t u = \mathcal{L}u + \mathcal{N}(u)\ .$
3030

31-
The $\mathcal{L}u$ part is time-stepped forward using an implicit scheme; the
32-
$\mathcal{N}(u)$ part is time-stepped forward using an explicit scheme.
31+
We decompose the right hand side of the above in a linear part ($\mathcal{L}u$)
32+
and a nonlinear part ($\mathcal{N}(u)$). The time steppers treat the linear and
33+
nonlinear parts differently.
3334

3435
The coefficients for the linear operator $\mathcal{L}$ are stored in array `LC`.
35-
The term $\mathcal{N}(u)$ is computed for by calling the function `calcN`.
36+
The term $\mathcal{N}(u)$ is computed for by calling the function `calcN!`.
3637

3738

3839
## Source code organization
@@ -56,7 +57,7 @@ Here's an overview of the code structure:
5657
various time-steppers. Current implemented time-steppers are:
5758
- Forward Euler (+ Filtered Forward Euler)
5859
- 3rd-order Adams-Bashforth (AB3)
59-
- 4th-order Runge-Kutta (RK4)
60+
- 4th-order Runge-Kutta (RK4) (+ Filtered ETDRK4)
6061
- 4th-order Runge-Kutta Exponential Time Differencing (ETDRK4)
6162
(+ Filtered ETDRK4)
6263
- `physics/`
@@ -86,18 +87,32 @@ fastest possible code.
8687

8788
## Examples
8889

89-
An example script that simulates decaying two-dimensional turbulence reproducing
90-
the results of the paper by
90+
- `examples/twodturb/McWilliams.jl`: A script that simulates decaying two-dimensional turbulence reproducing the results of the paper by
9191

92-
> McWilliams, J. C. (1984). The emergence of isolated coherent vortices in turbulent flow. *J. Fluid Mech.*, **146**, 21-43.
92+
> McWilliams, J. C. (1984). The emergence of isolated coherent vortices in turbulent flow. *J. Fluid Mech.*, **146**, 21-43
9393
94-
is found in `examples/twodturb/McWilliams.jl`.
94+
- `examples/barotropicqg/decayingbetaturb.jl`: An example script that simulates decaying quasi-geostrophic flow on a beta-plane.
9595

96+
- `examples/barotropicqg/ACConelayer.jl`: A script that simulates barotropic quasi-geostrophic flow above topography reproducing the results of the paper by
97+
98+
> Constantinou, N. C. (2018). A barotropic model of eddy saturation. *J. Phys. Oceanogr.*, in press, doi:10.1175/JPO-D-17-0182.1
99+
100+
101+
102+
## Tutorials
103+
104+
```@contents
105+
Pages = [
106+
"modules/twodturb.md",
107+
"modules/barotropicqg.md"
108+
]
109+
Depth = 1
110+
```
96111

97112

98113
## Future work
99114

100-
The code is in the chaos stage of development. A main goal for the future
115+
The code is in the chaotic stage of development. A main goal for the future
101116
is to permit the use of shared memory parallelism in the compute-intensive
102117
routines (shared-memory parallelism provided already by FFTW/MKLFFT, but
103118
is not yet native to Julia for things like element-wise matrix multiplication,
@@ -106,14 +121,16 @@ Intel Lab's
106121
[ParallelAccelerator](https://github.com/IntelLabs/ParallelAccelerator.jl)
107122
package.
108123

109-
## Authors
124+
## Developers
110125

111126
FourierFlows is currently being developed by [Gregory L. Wagner](https://glwagner.github.io) and [Navid C. Constantinou](http://www.navidconstantinou.com).
112127

113128
## DocStrings
114129

115130
```@contents
116131
Pages = [
132+
"modules/twodturb.md",
133+
"modules/barotropicqg.md",
117134
"man/docstrings.md",
118135
]
119136
Depth = 2
@@ -123,6 +140,8 @@ Depth = 2
123140

124141
```@index
125142
Pages = [
143+
"modules/twodturb.md",
144+
"modules/barotropicqg.md",
126145
"man/docstrings.md",
127146
]
128147
```

docs/src/modules/barotropicqg.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# BarotropicQG Modules
2+
3+
This module solves the quasi-geostrophic barotropic vorticity equation on a
4+
beta-plane of variable fluid depth $H-h(x,y)$. The flow is obtained through a
5+
streamfunction $\psi$ as $(u,v) = (-\partial_y\psi, \partial_x\psi)$. All flow
6+
fields can be obtained from the quasi-geostrophic potential vorticity (QGPV).
7+
Here the QGPV is
8+
9+
$$\underbrace{f_0 + \beta y}_{\text{planetary PV}} + \underbrace{(\partial_x v
10+
- \partial_y u)}_{\text{relative vorticity}} +
11+
\underbrace{\frac{f_0 h}{H}}_{\text{topographic PV}}.$$
12+
13+
The dynamical variable is the component of the vorticity of the flow normal to
14+
the plane of motion, $\zeta\equiv \partial_x v- \partial_y u = \nabla^2\psi$.
15+
Also, we denote the topographic PV with $\eta\equiv f_0 h/H$. Thus, the
16+
equation solved by the module is:
17+
18+
$$\partial_t \zeta + J(\psi, \underbrace{\zeta + \eta}_{\equiv q}) +
19+
\beta\partial_x\psi = \underbrace{-\left[\mu + \nu(-1)^{n_\nu} \nabla^{2n_\nu}
20+
\right] \zeta }_{\textrm{dissipation}} + f\ .$$
21+
22+
where $J(f,g) = (\partial_xf)(\partial_y g)-(\partial_x g)(\partial_y f)$. On
23+
the right hand side, $f(x,y,t)$ is forcing, $\mu$ is linear drag, and $\nu$ is
24+
hyperviscosity. Plain old viscosity corresponds to $n_{\nu}=1$. The sum of
25+
relative vorticity and topographic PV is denoted with $q\equiv\zeta+\eta$.
26+
27+
28+
The equation is time-stepped forward in Fourier space:
29+
30+
$$\partial_t \widehat{\zeta} = - \widehat{J(\psi, q)} +\beta\frac{\mathrm{i}k_x}{k^2}\widehat{\zeta} -\left(\mu
31+
+\nu k^{2n_\nu}\right) \widehat{\zeta} + \widehat{f}\ .$$
32+
33+
In doing so the Jacobian is computed in the conservative form: $J(f,g) =
34+
\partial_y [ (\partial_x f) g] -\partial_x[ (\partial_y f) g]$.
35+
36+
Thus:
37+
38+
$$\mathcal{L} = \beta\frac{\mathrm{i}k_x}{k^2} - \mu - \nu k^{2n_\nu}\ ,$$
39+
$$\mathcal{N}(\widehat{\zeta}) = - \mathrm{i}k_x \mathrm{FFT}(u q)-
40+
\mathrm{i}k_y \mathrm{FFT}(v q)\ .$$

docs/src/modules/twodturb.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# TwoDTurb Module
2+
3+
This module solves two-dimensional incompressible turbulence. The flow is given
4+
through a streamfunction $\psi$ as $(u,v) = (-\partial_y\psi, \partial_x\psi)$.
5+
The dynamical variable used here is the component of the vorticity of the flow
6+
normal to the plane of motion, $q=\partial_x v- \partial_y u = \nabla^2\psi$.
7+
The equation solved by the module is:
8+
9+
$$\partial_t q + J(\psi, q) = \underbrace{-\left[\mu(-1)^{n_\mu} \nabla^{2n_\mu}
10+
+\nu(-1)^{n_\nu} \nabla^{2n_\nu}\right] q}_{\textrm{dissipation}} + f\ .$$
11+
12+
where $J(f,g) = (\partial_xf)(\partial_y g)-(\partial_x g)(\partial_y f)$. On
13+
the right hand side, $f(x,y,t)$ is forcing, $\mu$ is hypoviscosity, and $\nu$ is
14+
hyperviscosity. Plain old linear drag corresponds to $n_{\mu}=0$, while normal
15+
viscosity corresponds to $n_{\nu}=1$.
16+
17+
The equation is time-stepped forward in Fourier space:
18+
19+
$$\partial_t \widehat{q} = - \widehat{J(\psi, q)} -\left[\mu k^{2n_\mu}
20+
+\nu k^{2n_\nu}\right] \widehat{q} + \widehat{f}\ .$$
21+
22+
In doing so the Jacobian is computed in the conservative form: $J(f,g) =
23+
\partial_y [ (\partial_x f) g] -\partial_x[ (\partial_y f) g]$.
24+
25+
Thus:
26+
27+
$$\mathcal{L} = -\mu k^{-2n_\mu} - \nu k^{2n_\nu}\ ,$$
28+
$$\mathcal{N}(\widehat{q}) = - \mathrm{i}k_x \mathrm{FFT}(u q)-
29+
\mathrm{i}k_y \mathrm{FFT}(v q)\ .$$

docs/src/sec2/page1.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

docs/src/sec2/page2.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

docs/src/sec2/page3.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

docs/src/tutorials/page1.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

docs/src/tutorials/page2.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)