Skip to content

Commit

Permalink
Merge pull request #41 from FourierFlows/FixTwoDTurbDocs
Browse files Browse the repository at this point in the history
Fixes typos and notation in TwoDTurb docs
  • Loading branch information
navidcy authored Jan 3, 2020
2 parents 4036d84 + 1700aa5 commit 08a0f9f
Showing 1 changed file with 8 additions and 11 deletions.
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.
- ``: Integer$>0$; the order of viscosity $n_\nu$. Case $n_\nu=1$ give normal viscosity.
- ``: Integer$>0$; the order of viscosity $n_\nu$. Case $n_\nu=1$ gives normal viscosity.
- `μ`: Float; bottom drag or hypoviscosity coefficient.
- ``: Integer$\ge 0$; the order of hypodrag $n_\mu$. Case $n_\mu=0$ give plain linear drag $\mu$.
- ``: 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

0 comments on commit 08a0f9f

Please sign in to comment.