Skip to content

Commit

Permalink
build based on 8c32300
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Oct 22, 2024
0 parents commit 94815ec
Show file tree
Hide file tree
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.
1 change: 1 addition & 0 deletions dev/.documenter-siteinfo.json
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"}}
1,883 changes: 1,883 additions & 0 deletions dev/2DSlice_converged_NewtonsMethod.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,944 changes: 1,944 additions & 0 deletions dev/2DSlice_converged_SecantMethod.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
482 changes: 482 additions & 0 deletions dev/2DSlice_non_converged_NewtonsMethod.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
421 changes: 421 additions & 0 deletions dev/2DSlice_non_converged_SecantMethod.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,675 changes: 1,675 additions & 0 deletions dev/3DSpace_converged_NewtonsMethod.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,735 changes: 1,735 additions & 0 deletions dev/3DSpace_converged_SecantMethod.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,659 changes: 1,659 additions & 0 deletions dev/3DSpace_non_converged_NewtonsMethod.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,599 changes: 1,599 additions & 0 deletions dev/3DSpace_non_converged_SecantMethod.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions dev/API/index.html

Large diffs are not rendered by default.

103 changes: 103 additions & 0 deletions dev/Clausius_Clapeyron.jl
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")
104 changes: 104 additions & 0 deletions dev/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.
2 changes: 2 additions & 0 deletions dev/Clausius_Clapeyron/index.html
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(&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="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>
Loading

0 comments on commit 94815ec

Please sign in to comment.