From f97e3ce41da870b179709e6d585e49bdcf4fb3e3 Mon Sep 17 00:00:00 2001 From: Matthieu Descombes Date: Thu, 12 Feb 2026 17:09:05 +0100 Subject: [PATCH] feat : end initialization --- .../OTRERA_formation/Models/Coupled_model.mo | 19 +++++++++++-------- .../Models/Coupled_model_prescribed.mo | 16 ++++++++++++++++ .../Coupled_model_prescribed_variable.mo | 16 ++++++++++++++++ 3 files changed, 43 insertions(+), 8 deletions(-) create mode 100644 Formation/OTRERA_formation/Models/Coupled_model_prescribed.mo create mode 100644 Formation/OTRERA_formation/Models/Coupled_model_prescribed_variable.mo diff --git a/Formation/OTRERA_formation/Models/Coupled_model.mo b/Formation/OTRERA_formation/Models/Coupled_model.mo index f84692c..e61160f 100644 --- a/Formation/OTRERA_formation/Models/Coupled_model.mo +++ b/Formation/OTRERA_formation/Models/Coupled_model.mo @@ -1,14 +1,17 @@ within OTRERA_formation.Models; model Coupled_model - - Components.ThermalCapacity thermalCapacity(m = 30, cp = 2000) annotation( - Placement(transformation(origin = {-30, 30}, extent = {{-10, -10}, {10, 10}}))); - Components.Heatflow heatflow(Q_flow = 1000) annotation( - Placement(transformation(origin = {-66, 30}, extent = {{-10, -10}, {10, 10}}))); + Components.ThermalCapacity M1(m = 10, cp = 1000, energyDynamics = Modelica.Fluid.Types.Dynamics.SteadyState, T_start = 283.15) annotation( + Placement(transformation(origin = {-32, 30}, extent = {{-10, -10}, {10, 10}}))); + OTRERA_formation.Components.ThermalCapacity M2(cp = 1000, m = 10, T_start = 283.15, energyDynamics = Modelica.Fluid.Types.Dynamics.FixedInitial) annotation( + Placement(transformation(origin = {28, 30}, extent = {{-10, -10}, {10, 10}}))); + Components.Convection convection(S = 10, h = 1000) annotation( + Placement(transformation(origin = {-2, 30}, extent = {{-10, -10}, {10, 10}}))); equation - connect(heatflow.port, thermalCapacity.port) annotation( - Line(points = {{-66, 30}, {-30, 30}}, color = {191, 0, 0})); + connect(M1.port, convection.port_wall) annotation( + Line(points = {{-32.2, 29.6}, {-10.2, 29.6}}, color = {191, 0, 0})); + connect(convection.port_fluid, M2.port) annotation( + Line(points = {{7, 30}, {27, 30}}, color = {191, 0, 0})); annotation( - Diagram(coordinateSystem(extent = {{-100, -100}, {100, 100}}))); + Diagram(coordinateSystem(extent = {{-100, -100}, {100, 100}}), graphics = {Text(origin = {-30, 50}, extent = {{-16, -8}, {16, 8}}, textString = "M1"), Text(origin = {28, 52}, extent = {{-16, -8}, {16, 8}}, textString = "M2")})); end Coupled_model; \ No newline at end of file diff --git a/Formation/OTRERA_formation/Models/Coupled_model_prescribed.mo b/Formation/OTRERA_formation/Models/Coupled_model_prescribed.mo new file mode 100644 index 0000000..2561022 --- /dev/null +++ b/Formation/OTRERA_formation/Models/Coupled_model_prescribed.mo @@ -0,0 +1,16 @@ +within OTRERA_formation.Models; + +model Coupled_model_prescribed + extends OTRERA_formation.Models.Coupled_model (M1(m = 100)); + Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow prescribedHeatFlow annotation( + Placement(transformation(origin = {-62, 30}, extent = {{-10, -10}, {10, 10}}))); + Modelica.Blocks.Sources.Constant const(k = 1000) annotation( + Placement(transformation(origin = {-90, 30}, extent = {{-10, -10}, {10, 10}}))); +equation + connect(const.y, prescribedHeatFlow.Q_flow) annotation( + Line(points = {{-78, 30}, {-72, 30}}, color = {0, 0, 127})); + connect(prescribedHeatFlow.port, M1.port) annotation( + Line(points = {{-52, 30}, {-32, 30}}, color = {191, 0, 0})); + annotation( + Diagram(coordinateSystem(extent = {{-100, -100}, {100, 100}}))); +end Coupled_model_prescribed; \ No newline at end of file diff --git a/Formation/OTRERA_formation/Models/Coupled_model_prescribed_variable.mo b/Formation/OTRERA_formation/Models/Coupled_model_prescribed_variable.mo new file mode 100644 index 0000000..d75f14f --- /dev/null +++ b/Formation/OTRERA_formation/Models/Coupled_model_prescribed_variable.mo @@ -0,0 +1,16 @@ +within OTRERA_formation.Models; + +model Coupled_model_prescribed_variable + extends Models.Coupled_model; + Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow prescribedHeatFlow annotation( + Placement(transformation(origin = {-62, 30}, extent = {{-10, -10}, {10, 10}}))); + Modelica.Blocks.Sources.Ramp ramp annotation( + Placement(transformation(origin = {-94, 28}, extent = {{-10, -10}, {10, 10}}))); +equation + connect(ramp.y, prescribedHeatFlow.Q_flow) annotation( + Line(points = {{-82, 28}, {-72, 28}, {-72, 30}}, color = {0, 0, 127})); + connect(prescribedHeatFlow.port, M1.port) annotation( + Line(points = {{-52, 30}, {-32, 30}}, color = {191, 0, 0})); + annotation( + Diagram(coordinateSystem(extent = {{-100, -100}, {100, 100}}))); +end Coupled_model_prescribed_variable; \ No newline at end of file