-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Documenter.jl
committed
Oct 22, 2024
0 parents
commit 94815ec
Showing
3,264 changed files
with
3,019,152 additions
and
0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-10-22T22:52:33","documenter_version":"1.7.0"}} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
import ForwardDiff | ||
import ClimaParams as CP | ||
|
||
import Thermodynamics as TD | ||
using Thermodynamics.TestedProfiles | ||
import Thermodynamics.Parameters as TP | ||
|
||
ArrayType = Array{Float64} | ||
FT = eltype(ArrayType) | ||
|
||
param_set = TP.ThermodynamicsParameters(FT) | ||
profiles = TestedProfiles.PhaseEquilProfiles(param_set, ArrayType) | ||
(; T, p, e_int, ρ, θ_liq_ice, phase_type) = profiles | ||
(; q_tot, q_liq, q_ice, q_pt, RH, e_kin, e_pot) = profiles | ||
|
||
k = findfirst(q -> q > 0.01, q_tot) # test for one value with q_tot above some threshhold | ||
ts_sol = TD.PhaseEquil_ρTq(param_set, ρ[k], T[k], q_tot[k]) | ||
|
||
function q_vap_sat(_T::FT) where {FT} | ||
_ρ = TD.air_density(param_set, ts_sol) | ||
_q_tot = TD.total_specific_humidity(param_set, ts_sol) | ||
_phase_type = TD.PhaseEquil{FT} | ||
_q_pt = TD.PhasePartition_equil( | ||
param_set, | ||
_T, | ||
oftype(_T, _ρ), | ||
oftype(_T, _q_tot), | ||
_phase_type, | ||
) | ||
return TD.q_vap_saturation( | ||
param_set, | ||
_T, | ||
oftype(_T, _ρ), | ||
_phase_type, | ||
_q_pt, | ||
) | ||
end | ||
|
||
function ∂q_vap_sat_∂T_vs_T(_T::FT) where {FT} | ||
_ρ = TD.air_density(param_set, ts_sol) | ||
_q_tot = TD.total_specific_humidity(param_set, ts_sol) | ||
_λ = TD.liquid_fraction(param_set, ts_sol) | ||
_phase_type = TD.PhaseEquil{FT} | ||
_q_pt = TD.PhasePartition_equil( | ||
param_set, | ||
_T, | ||
oftype(_T, _ρ), | ||
oftype(_T, _q_tot), | ||
_phase_type, | ||
) | ||
_q_vap_sat = TD.q_vap_saturation(param_set, _T, _ρ, _phase_type, _q_pt) | ||
return TD.∂q_vap_sat_∂T( | ||
param_set, | ||
oftype(_T, _λ), | ||
_T, | ||
oftype(_T, _q_vap_sat), | ||
) | ||
end | ||
|
||
∂q_vap_sat_∂T_fd = _T -> ForwardDiff.derivative(q_vap_sat, _T) | ||
|
||
_ρ = TD.air_density(param_set, ts_sol) | ||
_q_tot = TD.total_specific_humidity(param_set, ts_sol) | ||
|
||
T_sorted = sort(T) | ||
import Plots | ||
p1 = Plots.plot() | ||
Plots.plot!( | ||
T_sorted, | ||
∂q_vap_sat_∂T_fd.(T_sorted); | ||
label = "∂qvsat_∂T ForwardDiff", | ||
yaxis = :log, | ||
) | ||
Plots.plot!( | ||
T_sorted, | ||
∂q_vap_sat_∂T_vs_T.(T_sorted); | ||
label = "∂qvsat_∂T Analytic", | ||
yaxis = :log, | ||
) | ||
Plots.plot!(; xlabel = "T [K]", legend = :topleft) | ||
|
||
p2 = Plots.plot() | ||
Plots.plot!( | ||
T_sorted, | ||
∂q_vap_sat_∂T_fd.(T_sorted) .- ∂q_vap_sat_∂T_vs_T.(T_sorted); | ||
label = "error", | ||
) | ||
Plots.plot!(; xlabel = "T [K]", legend = :topleft) | ||
|
||
p3 = Plots.plot() | ||
Plots.plot!(T_sorted, q_vap_sat.(T_sorted); label = "q_vap_sat") | ||
Plots.plot!(; xlabel = "T [K]") | ||
ρq_vals = "ρ=$_ρ, q_tot=$_q_tot" | ||
Plots.plot( | ||
p1, | ||
p2, | ||
p3; | ||
layout = Plots.grid(3, 1), | ||
plot_title = "$ρq_vals", | ||
titlefontsizes = 5, | ||
) | ||
|
||
Plots.savefig("Clausius_Clapeyron.svg") |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<!DOCTYPE html> | ||
<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/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><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><input class="collapse-toggle" id="menuitem-5" type="checkbox"/><label class="tocitem" for="menuitem-5"><span class="docs-label">Examples</span><i class="docs-chevron"></i></label><ul class="collapsed"><li><a class="tocitem" href="../literated/density_from_temperature_pressure_humidity/">Density from temperature, pressure, and humidity</a></li></ul></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("Clausius_Clapeyron.jl")</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">"/home/runner/work/Thermodynamics.jl/Thermodynamics.jl/docs/build/Clausius_Clapeyron.svg"</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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Tuesday 22 October 2024 22:52">Tuesday 22 October 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> |
Oops, something went wrong.