From 57c94fcfbe8b4a30085d33e181f1d460f47cacc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Miclu=C8=9Ba-C=C3=A2mpeanu?= Date: Tue, 24 Sep 2024 18:39:06 +0300 Subject: [PATCH 1/3] fix: fix typo in `Spring` --- src/Mechanical/TranslationalPosition/components.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mechanical/TranslationalPosition/components.jl b/src/Mechanical/TranslationalPosition/components.jl index 84c76206d..8d8896458 100644 --- a/src/Mechanical/TranslationalPosition/components.jl +++ b/src/Mechanical/TranslationalPosition/components.jl @@ -133,7 +133,7 @@ end #default function end @named flange_a = Flange(; s = flange_a__s, f = k * (flange_a__s - flange_b__s - l)) - @named flange_b = Flange(; s = flange_a__s, f = -k * (flange_a__s - flange_b__s - l)) + @named flange_b = Flange(; s = flange_b__s, f = -k * (flange_a__s - flange_b__s - l)) eqs = [ # delta_s ~ flange_a.s - flange_b.s From 364ad58ad4f54bb779f1a1e7b27388d5ecefb8a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Miclu=C8=9Ba-C=C3=A2mpeanu?= Date: Tue, 24 Sep 2024 18:39:26 +0300 Subject: [PATCH 2/3] refactor: remove default in `AccelerationSensor` --- src/Mechanical/TranslationalPosition/sensors.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mechanical/TranslationalPosition/sensors.jl b/src/Mechanical/TranslationalPosition/sensors.jl index cdaf8bcbe..8e264dbb1 100644 --- a/src/Mechanical/TranslationalPosition/sensors.jl +++ b/src/Mechanical/TranslationalPosition/sensors.jl @@ -70,7 +70,7 @@ Linear 1D acceleration sensor. end @variables begin - a(t) = 0.0 + a(t) end @equations begin From 4dcf38ab83f0dd089fa38adeebc9bcbe55653bc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Miclu=C8=9Ba-C=C3=A2mpeanu?= Date: Tue, 24 Sep 2024 18:40:51 +0300 Subject: [PATCH 3/3] refactor: change defaults to guesses in `Thermal` --- src/Thermal/HeatTransfer/ideal_components.jl | 4 ++-- src/Thermal/utils.jl | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Thermal/HeatTransfer/ideal_components.jl b/src/Thermal/HeatTransfer/ideal_components.jl index fc6858bbf..70dfe446c 100644 --- a/src/Thermal/HeatTransfer/ideal_components.jl +++ b/src/Thermal/HeatTransfer/ideal_components.jl @@ -24,8 +24,8 @@ Lumped thermal element storing heat C, [description = "Heat capacity of element"] end @variables begin - T(t) = 273.15 + 20 - der_T(t) + T(t), [guess = 273.15 + 20] + der_T(t), [guess = 0.0] end @equations begin diff --git a/src/Thermal/utils.jl b/src/Thermal/utils.jl index e2a991494..8408acf2f 100644 --- a/src/Thermal/utils.jl +++ b/src/Thermal/utils.jl @@ -1,6 +1,6 @@ @connector HeatPort begin - T(t) = 273.15 + 20.0 - Q_flow(t), [connect = Flow] + T(t), [guess = 273.15 + 20.0] + Q_flow(t), [guess = 0.0, connect = Flow] end Base.@doc """ HeatPort(; name, T = 273.15 + 20.0, Q_flow = 0.0) @@ -35,8 +35,8 @@ flow rate through the element from `port_a` to `port_b`, `Q_flow`. port_b = HeatPort() end @variables begin - dT(t) - Q_flow(t) + dT(t), [guess = 0.0] + Q_flow(t), [guess = 0.0] end @equations begin dT ~ port_a.T - port_b.T @@ -69,8 +69,8 @@ flow rate through the element from `solid` to `fluid`, `Q_flow`. fluid = HeatPort() end @variables begin - dT(t) - Q_flow(t) + dT(t), [guess = 0.0] + Q_flow(t), [guess = 0.0] end @equations begin dT ~ solid.T - fluid.T