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

Fixes typos and notation in TwoDTurb docs #41

Merged
merged 1 commit into from
Jan 3, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions docs/src/modules/twodturb.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# TwoDTurb Module

```math
\newcommand{\J}{\mathsf{J}}
```

### Basic Equations

Expand All @@ -12,10 +9,10 @@ The dynamical variable used here is the component of the vorticity of the flow
normal to the plane of motion, $\zeta=\partial_x \upsilon- \partial_y u = \nabla^2\psi$.
The equation solved by the module is:

$$\partial_t \zeta + \J(\psi, \zeta) = \underbrace{-\left[\mu(-1)^{n_\mu} \nabla^{2n_\mu}
$$\partial_t \zeta + \mathsf{J}(\psi, \zeta) = \underbrace{-\left[\mu(-1)^{n_\mu} \nabla^{2n_\mu}
+\nu(-1)^{n_\nu} \nabla^{2n_\nu}\right] \zeta}_{\textrm{dissipation}} + f\ .$$

where $\J(a, b) = (\partial_x a)(\partial_y b)-(\partial_y a)(\partial_x b)$. On
where $\mathsf{J}(a, b) = (\partial_x a)(\partial_y b)-(\partial_y a)(\partial_x b)$. On
the right hand side, $f(x,y,t)$ is forcing, $\mu$ is hypoviscosity, and $\nu$ is
hyperviscosity. Plain old linear drag corresponds to $n_{\mu}=0$, while normal
viscosity corresponds to $n_{\nu}=1$.
Expand All @@ -24,10 +21,10 @@ viscosity corresponds to $n_{\nu}=1$.

The equation is time-stepped forward in Fourier space:

$$\partial_t \widehat{\zeta} = - \widehat{J(\psi, \zeta)} -\left(\mu k^{2n_\mu}
$$\partial_t \widehat{\zeta} = - \widehat{\mathsf{J}(\psi, \zeta)} -\left(\mu k^{2n_\mu}
+\nu k^{2n_\nu}\right) \widehat{\zeta} + \widehat{f}\ .$$

In doing so the Jacobian is computed in the conservative form: $\J(a,b) =
In doing so the Jacobian is computed in the conservative form: $\mathsf{J}(a,b) =
\partial_y [ (\partial_x a) b] -\partial_x[ (\partial_y a) b]$.

Thus:
Expand All @@ -43,9 +40,9 @@ $$\mathcal{N}(\widehat{\zeta}) = - \mathrm{i}k_x \mathrm{FFT}(u \zeta)-

For the unforced case ($f=0$) parameters AbstractType is build with `Params` and it includes:
- `ν`: Float; viscosity or hyperviscosity coefficient.
- `nν`: Integer$>0$; the order of viscosity $n_\nu$. Case $n_\nu=1$ give normal viscosity.
- `nν`: Integer$>0$; the order of viscosity $n_\nu$. Case $n_\nu=1$ gives normal viscosity.
- `μ`: Float; bottom drag or hypoviscosity coefficient.
- `nμ`: Integer$\ge 0$; the order of hypodrag $n_\mu$. Case $n_\mu=0$ give plain linear drag $\mu$.
- `nμ`: Integer$\ge 0$; the order of hypodrag $n_\mu$. Case $n_\mu=0$ gives plain linear drag $\mu$.

For the forced case ($f\ne 0$) parameters AbstractType is build with `ForcedParams`. It includes all parameters in `Params` and additionally:
- `calcF!`: Function that calculates the forcing $\widehat{f}$
Expand All @@ -72,9 +69,9 @@ For the forced case ($f\ne 0$) variables AbstractType is build with `ForcedVars`

The nonlinear term $\mathcal{N}(\widehat{\zeta})$ is computed via functions:

- `calcN_advection!`: computes $- \widehat{J(\psi, \zeta)}$ and stores it in array `N`.
- `calcN_advection!`: computes $- \widehat{\mathsf{J}(\psi, \zeta)}$ and stores it in array `N`.

- `calcN_forced!`: computes $- \widehat{J(\psi, \zeta)}$ via `calcN_advection!` and then adds to it the forcing $\widehat{f}$ computed via `calcF!` function. Also saves the solution $\widehat{\zeta}$ of the previous time-step in array `prevsol`.
- `calcN_forced!`: computes $- \widehat{\mathsf{J}(\psi, \zeta)}$ via `calcN_advection!` and then adds to it the forcing $\widehat{f}$ computed via `calcF!` function. Also saves the solution $\widehat{\zeta}$ of the previous time-step in array `prevsol`.

- `updatevars!`: uses `sol` to compute $\zeta$, $u$, $\upsilon$, $\widehat{u}$, and $\widehat{\upsilon}$ and stores them into corresponding arrays of `Vars`/`ForcedVars`.

Expand Down