From 1cfb2f1127d68c1fbac7887db16f79e3eca5cfeb Mon Sep 17 00:00:00 2001 From: Helge Gehring <42973196+HelgeGehring@users.noreply.github.com> Date: Wed, 11 Oct 2023 18:16:43 -0700 Subject: [PATCH] improve plots --- docs/julia/thermal_simple.jl | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/docs/julia/thermal_simple.jl b/docs/julia/thermal_simple.jl index 7af8c3c2..16c0f9b7 100644 --- a/docs/julia/thermal_simple.jl +++ b/docs/julia/thermal_simple.jl @@ -103,6 +103,7 @@ println("The computed value for the average current density is $average_power_de # %% tags=[] T0 = calculate_temperature(constant_21 ∘ τ, power_density(p0), Dict("boundary" => 0.0)) +T_average = ∑(∫(temperature(T0))dΩ) / ∑(∫(1)dΩ) fig, _, plt = plot(Ω, temperature(T0), colormap = :hot) Colorbar(fig[1, 2], plt) display(fig) @@ -130,10 +131,23 @@ T_transient = calculate_temperature_transient( power_density(p0), Dict("boundary" => 0.0), temperature(T0), - 1e-4, + 1e-5, 1e-3, ) -sums = [(t, ∑(∫(u)dΩ) / ∑(∫(1)dΩ)) for (u, t) in T_transient] +sums = [(t, ∑(∫(u)dΩ) / ∑(∫(1)dΩ) / T_average) for (u, t) in T_transient] +display(lines(sums)) + +# %% tags=[] +T_transient = calculate_temperature_transient( + constant_21 ∘ τ, + constant_42 ∘ τ, + power_density(p0) * 0, + Dict("boundary" => 0.0), + temperature(T0), + 1e-5, + 2e-2, +) +sums = [(t, ∑(∫(u)dΩ) / ∑(∫(1)dΩ) / T_average) for (u, t) in T_transient] display(lines(sums)) # %% tags=[] @@ -143,9 +157,8 @@ T_transient = calculate_temperature_transient( power_density(p0), Dict{String,Float64}(), temperature(T0) * 0, - 1e-1, + 1e-5, 1.0, ) sums = [(t, ∑(∫(u)dΩ) / ∑(∫(1)dΩ)) for (u, t) in T_transient] -println(sums) display(lines(sums))