From 4c570ba4b023a1e34c46a9e7833dff70862f3d2b Mon Sep 17 00:00:00 2001 From: Helge Gehring <42973196+HelgeGehring@users.noreply.github.com> Date: Wed, 11 Oct 2023 15:11:11 -0700 Subject: [PATCH] add thermal simple to toc --- docs/_toc.yml | 1 + docs/julia/thermal_simple.jl | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/_toc.yml b/docs/_toc.yml index d0f172c5..7ffd77e2 100644 --- a/docs/_toc.yml +++ b/docs/_toc.yml @@ -45,6 +45,7 @@ parts: - file: julia/waveguide_anisotropic.jl - file: julia/waveguide_overlap_integral.jl - file: julia/lithium_niobate_phase_shifter.jl + - file: photonics/examples/thermal_simple.jl - caption: Benchmarks chapters: diff --git a/docs/julia/thermal_simple.jl b/docs/julia/thermal_simple.jl index 998ba4b1..a9ea7164 100644 --- a/docs/julia/thermal_simple.jl +++ b/docs/julia/thermal_simple.jl @@ -15,7 +15,7 @@ # --- # %% [markdown] -# # Mode solving +# # Match theoretical model for electro-optic simulation # %% tags=["hide-input", "thebe-init"] using Gridap @@ -24,6 +24,11 @@ using Gridap.Geometry using Femwell.Maxwell.Electrostatic using Femwell.Thermal +# %% [markdown] +# We start with setting up a square domain. +# For the boundary conditions, we tag the left and the right side of the model. +# Furthermore, we create a function which returns 1 indipendent of the tag which is the parameter to descrie the constants of the simplified model. + # %% tags=["hide-output"] domain = (0, 1, 0, 1) partition = (20, 20) @@ -37,6 +42,13 @@ dΩ = Measure(Ω, 1) τ = CellField(tags, Ω) constant = tag -> 1 +# %% [markdown] +# ## Electrostatic +# The first step ist to calculate the potential. +# For this we solve the electrostatic equation $Δϕ = 0$ and define the voltage at two oppositing boundaries to 0V at $x=0$ and 1V at $x=1$. +# The theoretical solution of this function is a linear function. +# $$ ϕ(x)=x $$ + # %% tags=["hide-input"] p0 = compute_potential(constant ∘ τ, Dict("left" => 0.0, "right" => 1.0)) @@ -65,7 +77,7 @@ T_transient = calculate_temperature_transient( Dict("boundary" => 0.0), temperature(T0), 1e-4, - 1.e-3, + 1e-3, ) sums = [(t, ∑(∫(u)dΩ) / ∑(∫(1)dΩ)) for (u, t) in T_transient] println(sums)