Formation Otrera #2
4
Formation/OTRERA_formation/Cases/package.mo
Normal file
4
Formation/OTRERA_formation/Cases/package.mo
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
within OTRERA_formation;
|
||||||
|
|
||||||
|
package Cases
|
||||||
|
end Cases;
|
||||||
0
Formation/OTRERA_formation/Cases/package.order
Normal file
0
Formation/OTRERA_formation/Cases/package.order
Normal file
20
Formation/OTRERA_formation/Components/Heatflow.mo
Normal file
20
Formation/OTRERA_formation/Components/Heatflow.mo
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
within OTRERA_formation.Components;
|
||||||
|
|
||||||
|
model Heatflow
|
||||||
|
|
||||||
|
//USER DEFINED PARAMETERS
|
||||||
|
parameter Modelica.Units.SI.HeatFlowRate Q_flow;
|
||||||
|
|
||||||
|
//INTERNAL VARIABLES
|
||||||
|
|
||||||
|
//IMPORTED COMPONENTS
|
||||||
|
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_b port annotation(
|
||||||
|
Placement(transformation(origin = {0, 2}, extent = {{-10, -10}, {10, 10}}), iconTransformation(origin = {4, -2}, extent = {{-10, -10}, {10, 10}})));
|
||||||
|
|
||||||
|
equation
|
||||||
|
|
||||||
|
Q_flow = -port.Q_flow ;
|
||||||
|
|
||||||
|
annotation(
|
||||||
|
Icon(graphics = {Line(origin = {-53, 0}, points = {{-43, 0}, {43, 0}}, color = {246, 97, 81}, thickness = 3, arrow = {Arrow.None, Arrow.Filled}), Rectangle(origin = {-50, 0}, extent = {{-50, 100}, {50, -100}})}));
|
||||||
|
end Heatflow;
|
||||||
17
Formation/OTRERA_formation/Components/Temperature.mo
Normal file
17
Formation/OTRERA_formation/Components/Temperature.mo
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
within OTRERA_formation.Components;
|
||||||
|
|
||||||
|
model Temperature
|
||||||
|
|
||||||
|
//USER DEFINED PARAMETERS
|
||||||
|
parameter Modelica.Units.SI.Temperature T ;
|
||||||
|
//INTERNAL VARIABLES
|
||||||
|
|
||||||
|
//IMPORTED COMPONENTS
|
||||||
|
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a port annotation(
|
||||||
|
Placement(transformation(extent = {{-10, -10}, {10, 10}}), iconTransformation(origin = {-2, 0}, extent = {{-10, -10}, {10, 10}})));
|
||||||
|
equation
|
||||||
|
T = port.T;
|
||||||
|
annotation(
|
||||||
|
Diagram(graphics),
|
||||||
|
Icon(graphics = {Rectangle(origin = {-50, 0}, extent = {{-50, 100}, {50, -100}}), Text(origin = {-45, 21}, extent = {{27, -23}, {-27, 23}}, textString = "T°")}));
|
||||||
|
end Temperature;
|
||||||
30
Formation/OTRERA_formation/Components/ThermalCapacity.mo
Normal file
30
Formation/OTRERA_formation/Components/ThermalCapacity.mo
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
within OTRERA_formation.Components;
|
||||||
|
|
||||||
|
model ThermalCapacity
|
||||||
|
//USER DEFINED PARAMETERS
|
||||||
|
parameter Modelica.Units.SI.Mass m = 10 "Object mass";
|
||||||
|
parameter Modelica.Units.SI.SpecificHeatCapacity cp(min=0) = 1000 ;
|
||||||
|
parameter Modelica.Units.SI.Temperature T_start = 283.15 ;
|
||||||
|
|
||||||
|
//INTERNAL VARIABLES
|
||||||
|
Modelica.Units.SI.Temperature T ;
|
||||||
|
Modelica.Units.SI.HeatFlowRate Q_flow ;
|
||||||
|
|
||||||
|
//IMPORTED COMPONENTS
|
||||||
|
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a port annotation(
|
||||||
|
Placement(transformation(extent = {{-10, -10}, {10, 10}}), iconTransformation(origin = {-2, -4}, extent = {{-10, -10}, {10, 10}})));
|
||||||
|
initial equation
|
||||||
|
|
||||||
|
T = T_start ;
|
||||||
|
|
||||||
|
equation
|
||||||
|
|
||||||
|
Q_flow = m * cp * der(T) ;
|
||||||
|
|
||||||
|
//PORT HANDOVER
|
||||||
|
Q_flow = port.Q_flow ;
|
||||||
|
T = port.T ;
|
||||||
|
|
||||||
|
annotation(
|
||||||
|
Icon(graphics = {Ellipse(origin = {-2, 3}, fillColor = {134, 94, 60}, fillPattern = FillPattern.Solid, extent = {{-92, -85}, {92, 85}})}));
|
||||||
|
end ThermalCapacity;
|
||||||
4
Formation/OTRERA_formation/Components/package.mo
Normal file
4
Formation/OTRERA_formation/Components/package.mo
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
within OTRERA_formation;
|
||||||
|
|
||||||
|
package Components
|
||||||
|
end Components;
|
||||||
3
Formation/OTRERA_formation/Components/package.order
Normal file
3
Formation/OTRERA_formation/Components/package.order
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
ThermalCapacity
|
||||||
|
Heatflow
|
||||||
|
Temperature
|
||||||
19
Formation/OTRERA_formation/Models/Coupled_model.mo
Normal file
19
Formation/OTRERA_formation/Models/Coupled_model.mo
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
within OTRERA_formation.Models;
|
||||||
|
|
||||||
|
model Coupled_model
|
||||||
|
|
||||||
|
Components.ThermalCapacity thermalCapacity(m = 30, cp = 2000) annotation(
|
||||||
|
Placement(transformation(origin = {-10, 10}, extent = {{-10, -10}, {10, 10}})));
|
||||||
|
Components.Heatflow heatflow(Q_flow = 1000) annotation(
|
||||||
|
Placement(transformation(origin = {-46, 10}, extent = {{-10, -10}, {10, 10}})));
|
||||||
|
Components.Heatflow heatflow1(Q_flow = 2000) annotation(
|
||||||
|
Placement(transformation(origin = {-46, -20}, extent = {{-10, -10}, {10, 10}})));
|
||||||
|
equation
|
||||||
|
connect(heatflow.port, thermalCapacity.port) annotation(
|
||||||
|
Line(points = {{-46, 10}, {-10, 10}}, color = {191, 0, 0}));
|
||||||
|
connect(heatflow1.port, heatflow.port) annotation(
|
||||||
|
Line(points = {{-46, -20}, {-30, -20}, {-30, 10}, {-46, 10}}, color = {191, 0, 0}));
|
||||||
|
|
||||||
|
annotation(
|
||||||
|
Diagram(coordinateSystem(extent = {{-100, -100}, {100, 100}})));
|
||||||
|
end Coupled_model;
|
||||||
4
Formation/OTRERA_formation/Models/package.mo
Normal file
4
Formation/OTRERA_formation/Models/package.mo
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
within OTRERA_formation;
|
||||||
|
|
||||||
|
package Models
|
||||||
|
end Models;
|
||||||
1
Formation/OTRERA_formation/Models/package.order
Normal file
1
Formation/OTRERA_formation/Models/package.order
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Coupled_model
|
||||||
9
Formation/OTRERA_formation/package.mo
Normal file
9
Formation/OTRERA_formation/package.mo
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
package OTRERA_formation
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
annotation(
|
||||||
|
uses(Modelica(version = "4.1.0")));
|
||||||
|
end OTRERA_formation;
|
||||||
3
Formation/OTRERA_formation/package.order
Normal file
3
Formation/OTRERA_formation/package.order
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
Components
|
||||||
|
Models
|
||||||
|
Cases
|
||||||
Reference in New Issue
Block a user