Skip to content

Commit

Permalink
update heater sim
Browse files Browse the repository at this point in the history
  • Loading branch information
HelgeGehring committed Oct 24, 2023
1 parent 0954749 commit c7cdbcc
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions docs/julia/heater_3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,23 @@ thermal_diffisitivities =
# The next step is to define the boundary conditions, this can be done simply via julia-dicts:

# %% tags=["remove-stderr", "hide-output"]
boundary_conditions = Dict(["metal3#e1___None" => 0.4, "metal3#e2___None" => 0.0])
boundary_potentials = Dict(["metal3#e1___None" => 0.4, "metal3#e2___None" => 0.0])
boundary_temperatures = Dict("box___None" => 0.0)

# %% [markdown]
# Now we're ready to do the simulations! First we simulate the electrical potential,
# then we go on with the temperature

# %% tags=["remove-stderr", "hide-output"]
p0 = compute_potential(ϵ_electrical_conductivity τ, boundary_conditions)
# %% tags=["remove-stderr"]
p0 = compute_potential(ϵ_electrical_conductivity τ, boundary_potentials)
voltage = abs(sum(values(boundary_potentials) .* [-1, 1]))
power = abs(sum((power_density(p0))dΩ))
current = power / voltage
println("Voltage: ", @sprintf("%.2f V", voltage))
println("Current: ", @sprintf("%.2f mA", current * 1e3))
println("Power: ", @sprintf("%.2f mW", power * 1e3))

# %% tags=["remove-stderr"]
T0 = calculate_temperature(ϵ_conductivities τ, power_density(p0), boundary_temperatures)

# %% [markdown]
Expand Down

0 comments on commit c7cdbcc

Please sign in to comment.