-
Notifications
You must be signed in to change notification settings - Fork 16
Add documentation for 1D Column Hydrostatic Balance and Ekman Layer examplesExpdoc #2325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Hello, following up on the idea I previously shared in the issue, I've added documentation [docs/src/examples.md](https://github.com/CliMA/ClimaCore.jl/blob/main/docs/src/examples.md) for the two 1D column examples: the hydrostatic balance and the Ekman layer. Please let me know if this contribution aligns with your goals for the documentation or if any revisions are needed. I'd be happy to make changes!
Add 1D Column Examples for Hydrostatic Balance and Ekman Layer
@valeriabarra I've reordered the examples and removed the root-level file as requested. Please let me know if anything else needs adjustment. |
docs/src/examples.md
Outdated
The application of boundary conditions is implemented through the operators: | ||
|
||
1. For the u-momentum equation: | ||
- Top boundary: `Operators.SetValue(FT(ug))` sets u to the geostrophic value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Top boundary: `Operators.SetValue(FT(ug))` sets u to the geostrophic value | |
- Top boundary: `Operators.SetValue(FT(ug))` sets $u$ to the geostrophic value |
docs/src/examples.md
Outdated
- Bottom boundary: `Operators.SetValue(Geometry.WVector(Cd * u_wind * u_1))` applies the drag condition | ||
|
||
2. For the v-momentum equation: | ||
- Top boundary: `Operators.SetValue(FT(vg))` sets v to the geostrophic value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Top boundary: `Operators.SetValue(FT(vg))` sets v to the geostrophic value | |
- Top boundary: `Operators.SetValue(FT(vg))` sets $v$ to the geostrophic value |
docs/src/examples.md
Outdated
- Top boundary: `Operators.SetValue(FT(vg))` sets v to the geostrophic value | ||
- Bottom boundary: `Operators.SetValue(Geometry.WVector(Cd * u_wind * v_1))` applies the drag condition | ||
|
||
3. DSS (Direct Stiffness Summation) is applied implicitly through the operators to ensure continuity of the solution at element boundaries and reduction of unnecessary multiplicity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3. DSS (Direct Stiffness Summation) is applied implicitly through the operators to ensure continuity of the solution at element boundaries and reduction of unnecessary multiplicity |
docs/src/examples.md
Outdated
|
||
This test case is set up in a vertical column domain from $z=0$ m to $z=30$ km with 30 vertical elements. The column is initialized with a decaying temperature profile, where: | ||
|
||
- The virtual temperature starts at $T_{virt\_surf} = 280$ K at the surface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The virtual temperature starts at $T_{virt\_surf} = 280$ K at the surface | |
- The virtual temperature starts at $T_{\textrm{virt}\_\textrm{surf}} = 280$ K at the surface |
Please double check that the suggested \textrm syntax works as intended in the subscript mode.
Also, please post screenshot of the rendered built docs to ease reviews. Thank you
docs/src/examples.md
Outdated
This test case is set up in a vertical column domain from $z=0$ m to $z=30$ km with 30 vertical elements. The column is initialized with a decaying temperature profile, where: | ||
|
||
- The virtual temperature starts at $T_{virt\_surf} = 280$ K at the surface | ||
- It asymptotically approaches $T_{min\_ref} = 230$ K with height |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- It asymptotically approaches $T_{min\_ref} = 230$ K with height | |
- It asymptotically approaches $T_{\textrm{min}\_\textrm{ref}} = 230$ K with height |
Same as above. Thank yoy
docs/src/examples.md
Outdated
\frac{\partial u}{\partial t} &\approx D_{f2c}\left(\nu G_{c2f}(u)\right) + f(v - v_g) - A(w, u) \\ | ||
\frac{\partial v}{\partial t} &\approx D_{f2c}\left(\nu G_{c2f}(v)\right) - f(u - u_g) - A(w, v) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Snowdog85123 , it is best to keep consistent notation with the rest of the document (see examples above and below yours already present in the file) . Hence, here it is best to not use the subscripts specifications for c2f
and f2c
, as they are explained below anyways.
\frac{\partial u}{\partial t} &\approx D_{f2c}\left(\nu G_{c2f}(u)\right) + f(v - v_g) - A(w, u) \\ | |
\frac{\partial v}{\partial t} &\approx D_{f2c}\left(\nu G_{c2f}(v)\right) - f(u - u_g) - A(w, v) | |
\frac{\partial u}{\partial t} &\approx D\left(\nu G(u)\right) + f(v - v_g) - A(w, u) \\ | |
\frac{\partial v}{\partial t} &\approx D\left(\nu G(v)\right) - f(u - u_g) - A(w, v) |
docs/src/examples.md
Outdated
- `G_{c2f}` is the [gradient operator from cell centers to faces](https://clima.github.io/ClimaCore.jl/stable/operators/#ClimaCore.Operators.GradientC2F), called `gradc2f` in the example code. | ||
- `D_{f2c}` is the [divergence operator from faces to centers](https://clima.github.io/ClimaCore.jl/stable/operators/#ClimaCore.Operators.DivergenceF2C), called `divf2c` in the example code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to my above comment.
- `G_{c2f}` is the [gradient operator from cell centers to faces](https://clima.github.io/ClimaCore.jl/stable/operators/#ClimaCore.Operators.GradientC2F), called `gradc2f` in the example code. | |
- `D_{f2c}` is the [divergence operator from faces to centers](https://clima.github.io/ClimaCore.jl/stable/operators/#ClimaCore.Operators.DivergenceF2C), called `divf2c` in the example code. | |
- ``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 | |
- ``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 | |
docs/src/examples.md
Outdated
|
||
- `G_{c2f}` is the [gradient operator from cell centers to faces](https://clima.github.io/ClimaCore.jl/stable/operators/#ClimaCore.Operators.GradientC2F), called `gradc2f` in the example code. | ||
- `D_{f2c}` is the [divergence operator from faces to centers](https://clima.github.io/ClimaCore.jl/stable/operators/#ClimaCore.Operators.DivergenceF2C), called `divf2c` in the example code. | ||
- `A` is the [advection operator](https://clima.github.io/ClimaCore.jl/stable/operators/#ClimaCore.Operators.AdvectionC2C), called `A` in the example code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `A` is the [advection operator](https://clima.github.io/ClimaCore.jl/stable/operators/#ClimaCore.Operators.AdvectionC2C), called `A` in the example code. | |
- ``A`` is the [center-to-center vertical advection](https://clima.github.io/ClimaCore.jl/stable/operators/#ClimaCore.Operators.AdvectionC2C) operator, called `A` in the example code. |
docs/src/examples.md
Outdated
|
||
##### Reconstructions | ||
|
||
**$I^f$** is the [center-to-face reconstruction operator](https://clima.github.io/ClimaCore.jl/stable/operators/#ClimaCore.Operators.InterpolateC2F), called `If` in the example code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**$I^f$** is the [center-to-face reconstruction operator](https://clima.github.io/ClimaCore.jl/stable/operators/#ClimaCore.Operators.InterpolateC2F), called `If` in the example code. | |
**$I^f$** is the [center-to-face reconstruction](https://clima.github.io/ClimaCore.jl/stable/operators/#ClimaCore.Operators.InterpolateC2F) operator, called `If` in the example code. |
Hi @valeriabarra , I just modified as you suggested. |
They complement the existing 1D column examples and provide more atmospheric physics use cases.
This new PR replaces the previous one and includes only the intended changes.