Skip to content

Commit e90d0fc

Browse files
author
Documenter.jl
committed
build based on 3d342cc
0 parents  commit e90d0fc

File tree

2,984 files changed

+2860888
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,984 files changed

+2860888
-0
lines changed

dev/.documenter-siteinfo.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"documenter":{"julia_version":"1.10.1","generation_timestamp":"2024-02-28T15:26:52","documenter_version":"1.2.1"}}

dev/2DSlice_converged_NewtonsMethod.svg

+1,883
Loading

dev/2DSlice_converged_SecantMethod.svg

+1,944
Loading

dev/2DSlice_non_converged_NewtonsMethod.svg

+482
Loading

dev/2DSlice_non_converged_SecantMethod.svg

+421
Loading

dev/3DSpace_converged_NewtonsMethod.svg

+1,675
Loading

dev/3DSpace_converged_SecantMethod.svg

+1,735
Loading

dev/3DSpace_non_converged_NewtonsMethod.svg

+1,659
Loading

dev/3DSpace_non_converged_SecantMethod.svg

+1,599
Loading

dev/API/index.html

+46
Large diffs are not rendered by default.

dev/Clausius_Clapeyron.jl

+103
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
import ForwardDiff
2+
import ClimaParams as CP
3+
4+
import Thermodynamics as TD
5+
using Thermodynamics.TestedProfiles
6+
import Thermodynamics.Parameters as TP
7+
8+
ArrayType = Array{Float64}
9+
FT = eltype(ArrayType)
10+
11+
param_set = TP.ThermodynamicsParameters(FT)
12+
profiles = TestedProfiles.PhaseEquilProfiles(param_set, ArrayType)
13+
(; T, p, e_int, ρ, θ_liq_ice, phase_type) = profiles
14+
(; q_tot, q_liq, q_ice, q_pt, RH, e_kin, e_pot) = profiles
15+
16+
k = findfirst(q -> q > 0.01, q_tot) # test for one value with q_tot above some threshhold
17+
ts_sol = TD.PhaseEquil_ρTq(param_set, ρ[k], T[k], q_tot[k])
18+
19+
function q_vap_sat(_T::FT) where {FT}
20+
= TD.air_density(param_set, ts_sol)
21+
_q_tot = TD.total_specific_humidity(param_set, ts_sol)
22+
_phase_type = TD.PhaseEquil{FT}
23+
_q_pt = TD.PhasePartition_equil(
24+
param_set,
25+
_T,
26+
oftype(_T, _ρ),
27+
oftype(_T, _q_tot),
28+
_phase_type,
29+
)
30+
return TD.q_vap_saturation(
31+
param_set,
32+
_T,
33+
oftype(_T, _ρ),
34+
_phase_type,
35+
_q_pt,
36+
)
37+
end
38+
39+
function ∂q_vap_sat_∂T_vs_T(_T::FT) where {FT}
40+
= TD.air_density(param_set, ts_sol)
41+
_q_tot = TD.total_specific_humidity(param_set, ts_sol)
42+
= TD.liquid_fraction(param_set, ts_sol)
43+
_phase_type = TD.PhaseEquil{FT}
44+
_q_pt = TD.PhasePartition_equil(
45+
param_set,
46+
_T,
47+
oftype(_T, _ρ),
48+
oftype(_T, _q_tot),
49+
_phase_type,
50+
)
51+
_q_vap_sat = TD.q_vap_saturation(param_set, _T, _ρ, _phase_type, _q_pt)
52+
return TD.∂q_vap_sat_∂T(
53+
param_set,
54+
oftype(_T, _λ),
55+
_T,
56+
oftype(_T, _q_vap_sat),
57+
)
58+
end
59+
60+
∂q_vap_sat_∂T_fd = _T -> ForwardDiff.derivative(q_vap_sat, _T)
61+
62+
= TD.air_density(param_set, ts_sol)
63+
_q_tot = TD.total_specific_humidity(param_set, ts_sol)
64+
65+
T_sorted = sort(T)
66+
import Plots
67+
p1 = Plots.plot()
68+
Plots.plot!(
69+
T_sorted,
70+
∂q_vap_sat_∂T_fd.(T_sorted);
71+
label = "∂qvsat_∂T ForwardDiff",
72+
yaxis = :log,
73+
)
74+
Plots.plot!(
75+
T_sorted,
76+
∂q_vap_sat_∂T_vs_T.(T_sorted);
77+
label = "∂qvsat_∂T Analytic",
78+
yaxis = :log,
79+
)
80+
Plots.plot!(; xlabel = "T [K]", legend = :topleft)
81+
82+
p2 = Plots.plot()
83+
Plots.plot!(
84+
T_sorted,
85+
∂q_vap_sat_∂T_fd.(T_sorted) .- ∂q_vap_sat_∂T_vs_T.(T_sorted);
86+
label = "error",
87+
)
88+
Plots.plot!(; xlabel = "T [K]", legend = :topleft)
89+
90+
p3 = Plots.plot()
91+
Plots.plot!(T_sorted, q_vap_sat.(T_sorted); label = "q_vap_sat")
92+
Plots.plot!(; xlabel = "T [K]")
93+
ρq_vals = "ρ=$_ρ, q_tot=$_q_tot"
94+
Plots.plot(
95+
p1,
96+
p2,
97+
p3;
98+
layout = Plots.grid(3, 1),
99+
plot_title = "$ρq_vals",
100+
titlefontsizes = 5,
101+
)
102+
103+
Plots.savefig("Clausius_Clapeyron.svg")

dev/Clausius_Clapeyron.svg

+104
Loading

dev/Clausius_Clapeyron/index.html

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<!DOCTYPE html>
2+
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Clausius Clapeyron relation · Thermodynamics.jl</title><meta name="title" content="Clausius Clapeyron relation · Thermodynamics.jl"/><meta property="og:title" content="Clausius Clapeyron relation · Thermodynamics.jl"/><meta property="twitter:title" content="Clausius Clapeyron relation · Thermodynamics.jl"/><meta name="description" content="Documentation for Thermodynamics.jl."/><meta property="og:description" content="Documentation for Thermodynamics.jl."/><meta property="twitter:description" content="Documentation for Thermodynamics.jl."/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="../"><img src="../assets/logo.svg" alt="Thermodynamics.jl logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../">Thermodynamics.jl</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><a class="tocitem" href="../Installation/">Installation</a></li><li><a class="tocitem" href="../API/">API</a></li><li><a class="tocitem" href="../HowToGuide/">How-to-guide</a></li><li><a class="tocitem" href="../TestedProfiles/">Tested profiles</a></li><li><a class="tocitem" href="../TemperatureProfiles/">Temperature profiles</a></li><li><a class="tocitem" href="../DevDocs/">Developer docs</a></li><li class="is-active"><a class="tocitem" href>Clausius Clapeyron relation</a></li><li><a class="tocitem" href="../Formulation/">Thermodynamics overview</a></li><li><a class="tocitem" href="../References/">References</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Clausius Clapeyron relation</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Clausius Clapeyron relation</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://github.com/CliMA/Thermodynamics.jl" title="View the repository on GitHub"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">GitHub</span></a><a class="docs-navbar-link" href="https://github.com/CliMA/Thermodynamics.jl/blob/main/docs/src/Clausius_Clapeyron.md" title="Edit source on GitHub"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Clausius-Clapeyron-relation"><a class="docs-heading-anchor" href="#Clausius-Clapeyron-relation">Clausius Clapeyron relation</a><a id="Clausius-Clapeyron-relation-1"></a><a class="docs-heading-anchor-permalink" href="#Clausius-Clapeyron-relation" title="Permalink"></a></h1><p>This script plots the Clausius Clapeyron relation for a range of temperatures. The analytically derived expression is compared with a solution computed using ForwardDiff.jl.</p><div class="admonition is-category-warn"><header class="admonition-header">Warn</header><div class="admonition-body"><p>This script is decoupled from the implementation in the test suite, and should be unified to ensure that tests and plots stay.</p></div></div><pre><code class="language-julia hljs">include(&quot;Clausius_Clapeyron.jl&quot;)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">&quot;/home/runner/work/Thermodynamics.jl/Thermodynamics.jl/docs/build/Clausius_Clapeyron.svg&quot;</code></pre><p><img src="../Clausius_Clapeyron.svg" alt/></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../DevDocs/">« Developer docs</a><a class="docs-footer-nextpage" href="../Formulation/">Thermodynamics overview »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Wednesday 28 February 2024 15:26">Wednesday 28 February 2024</span>. Using Julia version 1.10.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

0 commit comments

Comments
 (0)