You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/examples.md
+97Lines changed: 97 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -180,6 +180,103 @@ The initial vertical velocity is set to zero everywhere. To maintain hydrostatic
180
180
181
181
The simulation is run for 10 days to verify that the hydrostatic balance is maintained over time. Results are plotted showing density ($\rho$), vertical velocity ($\boldsymbol{w}$), and potential temperature density ($\rho\theta$) profiles.
182
182
183
+
### Heat equation
184
+
185
+
The 1D Column heat example in [`examples/column/heat.jl`](https://github.com/CliMA/ClimaCore.jl/blob/main/examples/column/heat.jl).
186
+
187
+
#### Equations and discretizations
188
+
189
+
Follows the heat equation
190
+
191
+
```math
192
+
\begin{equation}
193
+
\frac{\partial T}{\partial t} = \alpha \cdot \nabla^2 T.
*``\alpha``: thermal diffusivity measured in $\frac{m^2}{s}$
210
+
*``T``: temperature
211
+
212
+
#### Differentiation Operators
213
+
214
+
*``D`` is the [face-to-center divergence](https://clima.github.io/ClimaCore.jl/dev/operators/#ClimaCore.Operators.DivergenceF2C) operator, called `divf2c` in the example code
215
+
*``G`` is the [center-to-face gradient](https://clima.github.io/ClimaCore.jl/dev/operators/#ClimaCore.Operators.GradientC2F) operator, called `gradc2f` in the example code
216
+
217
+
#### Set Up
218
+
219
+
This test case is set up in a 1D column domain ``z \in [0, 1]`` and discretized into a mesh of 10 elements. A homogeneous Dirichlet boundary condition is set at the bottom boundary, `bcs_bottom`, setting the temperature to 0. A Neumann boundary condition is applied to the top boundary, `bcs_top`, setting the temperature gradient to 1.
220
+
221
+
### Advection equation
222
+
223
+
The 1D Column advection example in [`examples/column/advect.jl`](https://github.com/CliMA/ClimaCore.jl/blob/main/examples/column/advect.jl).
224
+
225
+
#### Equations and Discretizations
226
+
227
+
Follows the advection equation
228
+
229
+
```math
230
+
\begin{equation}
231
+
\frac{\partial \theta}{\partial t} = -\frac{\partial (v \theta)}{\partial z} .
The example code solves the equation for 4 different tendencies with the following discretizations:
252
+
253
+
- Tendency 1:
254
+
255
+
$$D = \partial(UB),$$
256
+
257
+
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 biased product`](https://clima.github.io/ClimaCore.jl/dev/operators/#ClimaCore.Operators.UpwindBiasedProductC2F) operator.
258
+
- Tendency 2:
259
+
260
+
$$D = \partial(UB) + \textrm{fcc}(v, \theta),$$
261
+
262
+
where $\textrm{fcc}(v, \theta)$ is the [`center-to-center flux correction`](https://github.com/CliMA/ClimaCore.jl/blob/main/src/Operators/finitedifference.jl#L2617) operator.
263
+
- Tendency 3:
264
+
265
+
$$D = A,$$
266
+
267
+
where $A$ is the [`center-to-center vertical advection`](https://clima.github.io/ClimaCore.jl/dev/operators/#ClimaCore.Operators.AdvectionC2C) operator.
268
+
- Tendency 4:
269
+
270
+
$$D = A + \textrm{fcc}(v, \theta),$$
271
+
272
+
where $\textrm{fcc}(v, \theta)$ is the [`center-to-center flux correction`](https://github.com/CliMA/ClimaCore.jl/blob/main/src/Operators/finitedifference.jl#L2617) operator.
273
+
274
+
#### Set Up
275
+
276
+
This test case is set up in a 1D column domain ``z \in [0, 4\pi]``, discretized into a mesh of 128 elements. The velocity field is defined as a sinusoidal wave. The boundary conditions are operator dependent, so they depend on the tendency.
277
+
* For tendencies 1 and 2 where the upwind biased operator ``UB`` is used, the left boundary is defined as ``sin(a - t)``. The right boundary is ``sin(b - t)``. Here ``a`` and ``b`` are the left and right bounds of the domain.
278
+
* For tendencies 3 and 4, where the advection operator ``A`` is used, the left boundary is defined as ``sin(-t)``. The right boundary is extrapolated, meaning its value is set to the closest interior point.
0 commit comments