Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
cbegeman committed Oct 5, 2023
1 parent 101ffd9 commit 9fe4332
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/developers_guide/ocean/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
init.Init
init.Init.run
init.cosine_bell
forward.Forward
forward.Forward.compute_cell_count
Expand Down
11 changes: 8 additions & 3 deletions docs/users_guide/ocean/tasks/cosine_bell.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Bell test case as first described in
but using the variant from Sec. 3a of
[Skamarock and Gassmann](https://doi.org/10.1175/MWR-D-10-05056.1). A flow
field representing solid-body rotation transports a bell-shaped perturbation
in a tracer $psi$ once around the sphere, returning to its initial location.
in a tracer $\psi$ once around the sphere, returning to its initial location.

The task is a convergence test with time step varying proportionately to grid
size. The result of the `analysis` step of the task is a plot like the
Expand Down Expand Up @@ -133,6 +133,11 @@ sphere. `psi_0` and `radius`, $R$, are given as config options and may be
altered by the user. In the `init` step we assign `debug_tracers_1`
to $\psi$.

```{image} images/cosine_bell_init.png
:align: center
:width: 500 px
```

The initial velocity is equatorial:

$$
Expand Down Expand Up @@ -172,8 +177,8 @@ time_integrator = RK4
rk4_dt_per_km = 3.0
```

The convergence_eval_time, run duration and output interval are the period for
advection to make a full rotation around the globe, 24 days:
The `convergence_eval_time`, `run_duration` and `output_interval` are the
period for advection to make a full rotation around the globe, 24 days:

```cfg
# config options for spherical convergence tests
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions polaris/ocean/tasks/cosine_bell/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,18 @@ def run(self):


def cosine_bell(max_value, ri, r):
"""
Compute values according to cosine bell function
Parameters
----------
max_value : float
Maximum value of the cosine bell function
ri : np.ndarray of type float
Distance from the center of the cosine bell in meters
r : float
Radius of the cosine bell in meters
"""
return max_value / 2.0 * (1.0 + np.cos(np.pi * np.divide(ri, r)))

0 comments on commit 9fe4332

Please sign in to comment.