|
1 | 1 | # Examples
|
2 | 2 |
|
3 |
| -## 1D Column examples |
4 |
| - |
5 |
| -### Heat |
| 3 | +### Advection |
6 | 4 |
|
7 |
| -The 1D Column heat example in [`examples/column/heat.jl`](https://github.com/CliMA/ClimaCore.jl/blob/main/examples/column/heat.jl) in a 1D column domain. |
| 5 | +The 1D Column advection example in [`examples/column/advect.jl`](https://github.com/CliMA/ClimaCore.jl/blob/main/examples/column/advect.jl). |
8 | 6 |
|
9 |
| -#### Equations and discretizations |
| 7 | +#### Equations and Discretizations |
10 | 8 |
|
11 | 9 | Follows the continuity equation
|
12 | 10 |
|
13 | 11 | ```math
|
14 | 12 | \begin{equation}
|
15 |
| - \frac{\partial T}{\partial t} = \alpha \cdot \nabla^2 T. |
16 |
| -\label{eq:1d-column-heat-continuity} |
| 13 | + \frac{\partial \theta}{\partial t} = -\frac{\partial (v \theta)}{\partial z} |
| 14 | +\label{eq:1d-column-advection-continuity} |
17 | 15 | \end{equation}
|
18 | 16 | ```
|
19 |
| - |
20 | 17 | This is discretized using the following
|
21 | 18 |
|
22 | 19 | ```math
|
23 | 20 | \begin{equation}
|
24 |
| - \frac{\partial T}{\partial t} \approx \alpha \cdot D(G(T)). |
25 |
| -\label{eq:1d-column-heat-discrete} |
| 21 | + \frac{\partial \theta}{\partial t} \approx - D(V, \theta) |
| 22 | +\label{eq:1d-column-advection-discrete} |
26 | 23 | \end{equation}
|
27 | 24 | ```
|
28 | 25 |
|
29 | 26 | #### Prognostic Variables
|
30 | 27 |
|
31 |
| -* ``\alpha``: thermal diffusivity measured in $\frac{m^2}{s}$ |
32 |
| -* ``T``: temperature |
| 28 | +* ``\theta``: the scalar field |
| 29 | +* ``v``: the velocity field |
33 | 30 |
|
34 |
| -#### Differentiation Operators |
| 31 | +#### Tendencies |
35 | 32 |
|
36 |
| - * ``D`` is the [face-to-center divergence](https://clima.github.io/ClimaCore.jl/dev/operators/#ClimaCore.Operators.DivergenceF2C), called `divf2c` in the example code |
37 |
| - * ``G`` is the [center-to-face gradient](https://clima.github.io/ClimaCore.jl/dev/operators/#ClimaCore.Operators.GradientC2F), called ``gradc2f`` in the example code |
| 33 | +The example code solves the equation for 4 different tendencies with the following discretizations: |
| 34 | + |
| 35 | +* Tendency 1: ``D = \partial(UB),`` where ``\partial`` is the [`face-to-center divergence`](https://clima.github.io/ClimaCore.jl/dev/operators/#ClimaCore.Operators.DivergenceF2C) and $UB$ is the [`center-to-face upwind product operator`](https://clima.github.io/ClimaCore.jl/dev/operators/#ClimaCore.Operators.UpwindBiasedProductC2F) |
| 36 | +* Tendenct 2: Follows tendency 1 with the addition of flux correction `fcc` |
| 37 | +* Tendency 3: $D = A$, where $A$ is the [`discrete vertical advection`](https://clima.github.io/ClimaCore.jl/dev/operators/#ClimaCore.Operators.AdvectionC2C) |
| 38 | +* Tendency 4: Follows tendency 3 with the addition of flux correction `fcc` |
38 | 39 |
|
39 | 40 | #### Set Up
|
40 | 41 |
|
41 |
| -This test case is set up in a 1D column domain ``z \in [0, 1]``. |
| 42 | +This test case is set up in a 1D column domain ``z \in [0, 4\pi]``. |
42 | 43 |
|
43 |
| -### Advection |
| 44 | +### Heat |
44 | 45 |
|
45 |
| -The 1D Column advection example in [`examples/column/advect.jl`](https://github.com/CliMA/ClimaCore.jl/blob/main/examples/column/advect.jl) in a 1D column domain. |
| 46 | +The 1D Column heat example in [`examples/column/heat.jl`](https://github.com/CliMA/ClimaCore.jl/blob/main/examples/column/heat.jl). |
46 | 47 |
|
47 |
| -#### Equations and Discretizations |
| 48 | +#### Equations and discretizations |
48 | 49 |
|
49 | 50 | Follows the continuity equation
|
50 | 51 |
|
51 | 52 | ```math
|
52 | 53 | \begin{equation}
|
53 |
| - \frac{\partial \theta}{\partial t} = -\frac{\partial (v \theta)}{\partial z} |
54 |
| -\label{eq:1d-column-advection-continuity} |
| 54 | + \frac{\partial T}{\partial t} = \alpha \cdot \nabla^2 T. |
| 55 | +\label{eq:1d-column-heat-continuity} |
55 | 56 | \end{equation}
|
56 | 57 | ```
|
| 58 | + |
57 | 59 | This is discretized using the following
|
58 | 60 |
|
59 | 61 | ```math
|
60 | 62 | \begin{equation}
|
61 |
| - \frac{\partial \theta}{\partial t} \approx - D(V, \theta) |
62 |
| -\label{eq:1d-column-advection-discrete} |
| 63 | + \frac{\partial T}{\partial t} \approx \alpha \cdot D(G(T)). |
| 64 | +\label{eq:1d-column-heat-discrete} |
63 | 65 | \end{equation}
|
64 | 66 | ```
|
65 | 67 |
|
66 | 68 | #### Prognostic Variables
|
67 | 69 |
|
68 |
| -* ``\theta``: the scalar field |
69 |
| -* ``v``: velocity in measured in $\frac{m}{s}$ |
| 70 | +* ``\alpha``: thermal diffusivity measured in $\frac{m^2}{s}$ |
| 71 | +* ``T``: temperature |
70 | 72 |
|
71 |
| -### Tendencies |
72 |
| -The example code solves the equation for 4 different tendencies: |
| 73 | +#### Differentiation Operators |
73 | 74 |
|
74 |
| -* Tendency 1: ``D = \partial(UB), where \partial`` is the [`face-to-center divergence`](https://clima.github.io/ClimaCore.jl/dev/operators/#ClimaCore.Operators.DivergenceF2C) and $UB$ is the [`center-to-face upwind product operator`](https://clima.github.io/ClimaCore.jl/dev/operators/#ClimaCore.Operators.UpwindBiasedProductC2F) |
75 |
| -* Tendenct 2: Follows tendency 1 with the addition of flux correction ``fcc`` |
76 |
| -* Tendency 3: $D = A$, where $A$ is the [`discrete vertical advection`](https://clima.github.io/ClimaCore.jl/dev/operators/#ClimaCore.Operators.AdvectionC2C) |
77 |
| -* Tendency 4: Follows tendency 3 with the addition of flux correction ``fcc`` |
| 75 | + * ``D`` is the [face-to-center divergence](https://clima.github.io/ClimaCore.jl/dev/operators/#ClimaCore.Operators.DivergenceF2C), called `divf2c` in the example code |
| 76 | + * ``G`` is the [center-to-face gradient](https://clima.github.io/ClimaCore.jl/dev/operators/#ClimaCore.Operators.GradientC2F), called `gradc2f` in the example code |
78 | 77 |
|
79 | 78 | #### Set Up
|
80 | 79 |
|
81 |
| -This test case is set up in a 1D column domain ``z \in$ [0, 4\pi]``. |
| 80 | +This test case is set up in a 1D column domain ``z \in [0, 1]``. |
| 81 | + |
82 | 82 |
|
83 | 83 | ## 2D Cartesian examples
|
84 | 84 |
|
|
0 commit comments