Skip to content

Commit

Permalink
Add example to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskawczynski committed Sep 6, 2024
1 parent ffbbe72 commit 85b4f6c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Thermodynamics.jl
A package containing a library of moist thermodynamic relations

Thermodynamics.jl provides flexible and performant functions for computing various thermodynamic variables for dry and moist atmospheres.

|||
|---------------------:|:----------------------------------------------|
Expand All @@ -20,3 +21,4 @@ A package containing a library of moist thermodynamic relations
[codecov-img]: https://codecov.io/gh/CliMA/Thermodynamics.jl/branch/main/graph/badge.svg
[codecov-url]: https://codecov.io/gh/CliMA/Thermodynamics.jl

See our documentation [here](https://clima.github.io/Thermodynamics.jl/dev/index).
29 changes: 28 additions & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,31 @@
# How to guide
# Thermodynamics

## Principal design

This package uses an abstraction that leverages the idea of a thermodynamic state:

- given two (or more) independent intrinsic thermodynamic properties, we can establish a thermodynamic state and
- given a thermodynamic state, we can compute any thermodynamic property


## Simple example

For our example, we first load packages, and create a set of thermodynamic parameters, using a convenience constructor, offered through [ClimaParams.jl](https://github.com/CliMA/ClimaParams.jl). Then we create a thermodynamic state using density, liquid-ice potential temperature, and total specific humidity. Finally, we compute air temperature from the thermodynamic state.

```@example
using ClimaParams # needed in environment to load convenience parameter struct wrappers
import Thermodynamics as TD
params = TD.Parameters.ThermodynamicsParameters(Float64);
ts = TD.PhaseEquil_ρθq(params, 1.0, 374.0, 0.01);
T = TD.air_temperature(params, ts)
```

And that's it. See a full list of different thermodynamic state constructors, in case you want to create a thermodynamic state with different variables, [here](https://clima.github.io/Thermodynamics.jl/dev/API/#Thermodynamic-State-Constructors).

See a full list of quantities that you can compute from a thermodynamic state, see our thermodynamic state-compatible methods [here](https://clima.github.io/Thermodynamics.jl/dev/API/#Thermodynamic-state-methods).

## How to guide

Thermodynamics.jl provides all thermodynamic functions needed for the
atmosphere and functions shared across model components. The functions are
Expand Down

0 comments on commit 85b4f6c

Please sign in to comment.