Skip to content

Commit

Permalink
add thermal simple to toc
Browse files Browse the repository at this point in the history
  • Loading branch information
HelgeGehring committed Oct 11, 2023
1 parent 35e58a6 commit 4c570ba
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
16 changes: 14 additions & 2 deletions docs/julia/thermal_simple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# ---

# %% [markdown]
# # Mode solving
# # Match theoretical model for electro-optic simulation

# %% tags=["hide-input", "thebe-init"]
using Gridap
Expand All @@ -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)
Expand All @@ -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))

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 4c570ba

Please sign in to comment.