feat : end initialization

This commit is contained in:
2026-02-12 17:09:05 +01:00
parent 288758e467
commit f97e3ce41d
3 changed files with 43 additions and 8 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;