diff --git a/Formation/Feuille_evaluation.docx b/Formation/Feuille_evaluation.docx new file mode 100644 index 0000000..f4a109c Binary files /dev/null and b/Formation/Feuille_evaluation.docx differ diff --git a/Formation/OTRERA_formation/Cases/package.mo b/Formation/OTRERA_formation/Cases/package.mo new file mode 100644 index 0000000..c012cb4 --- /dev/null +++ b/Formation/OTRERA_formation/Cases/package.mo @@ -0,0 +1,4 @@ +within OTRERA_formation; + +package Cases +end Cases; \ No newline at end of file diff --git a/Formation/OTRERA_formation/Cases/package.order b/Formation/OTRERA_formation/Cases/package.order new file mode 100644 index 0000000..e69de29 diff --git a/Formation/OTRERA_formation/Components/Convection.mo b/Formation/OTRERA_formation/Components/Convection.mo new file mode 100644 index 0000000..4d3045f --- /dev/null +++ b/Formation/OTRERA_formation/Components/Convection.mo @@ -0,0 +1,32 @@ +within OTRERA_formation.Components; + +model Convection + + //USER DEFINED PARAMETERS + parameter Modelica.Units.SI.Area S=0.0 "Exchange area between fluid and solid" ; + parameter Modelica.Units.SI.CoefficientOfHeatTransfer h = 0.0 "Convective heat transfer coefficient"; + + + //INTERNAL VARIABLES + Modelica.Units.SI.HeatFlowRate Q_flow ; + Modelica.Units.SI.Temperature T_wall ; + Modelica.Units.SI.Temperature T_fluid ; + //IMPORTED COMPONENTS + Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a port_wall annotation( + Placement(transformation(origin = {-96, 2}, extent = {{-10, -10}, {10, 10}}), iconTransformation(origin = {-90, 0}, extent = {{-10, -10}, {10, 10}}))); + Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_b port_fluid annotation( + Placement(transformation(origin = {96, 0}, extent = {{-10, -10}, {10, 10}}), iconTransformation(origin = {90, 0}, extent = {{-10, -10}, {10, 10}}))); +equation + + Q_flow = h * S * (T_wall - T_fluid) ; + + //Port handover + + port_fluid.Q_flow + port_wall.Q_flow = 0.0 ; + port_fluid.Q_flow = -Q_flow ; + T_wall = port_wall.T ; + T_fluid = port_fluid.T ; + + + +end Convection; \ No newline at end of file diff --git a/Formation/OTRERA_formation/Components/Convection_with_Element1D.mo b/Formation/OTRERA_formation/Components/Convection_with_Element1D.mo new file mode 100644 index 0000000..62a9e1e --- /dev/null +++ b/Formation/OTRERA_formation/Components/Convection_with_Element1D.mo @@ -0,0 +1,21 @@ +within OTRERA_formation.Components; + +model Convection_with_Element1D + extends Modelica.Thermal.HeatTransfer.Interfaces.Element1D ; + //USER DEFINED PARAMETERS + parameter Modelica.Units.SI.Area S=0.0 "Exchange area between fluid and solid" ; + parameter Modelica.Units.SI.CoefficientOfHeatTransfer h = 0.0 "Convective heat transfer coefficient"; + + + //INTERNAL VARIABLES + + //IMPORTED COMPONENTS + +equation + + Q_flow = h * S * dT ; + + //Port handover + + +end Convection_with_Element1D; \ No newline at end of file diff --git a/Formation/OTRERA_formation/Components/Fan.mo b/Formation/OTRERA_formation/Components/Fan.mo new file mode 100644 index 0000000..cabc6b8 --- /dev/null +++ b/Formation/OTRERA_formation/Components/Fan.mo @@ -0,0 +1,23 @@ +within OTRERA_formation.Components; + +model Fan +replaceable package Medium = Modelica.Media.Air.ReferenceAir.Air_pT constrainedby Modelica.Media.Interfaces.PartialMedium annotation(choicesAllMatching = true) ; + +//USER DEFINED PARAMETERS + parameter Modelica.Units.SI.MassFlowRate m_flow = 10 ; +//INTERNAL VARIABLES + Medium.ThermodynamicState state ; + Modelica.Units.SI.SpecificHeatCapacity cp ; + Modelica.Units.SI.HeatFlowRate Q_flow ; + //IMPORTED COMPONENTS + Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a port_a annotation( + Placement(transformation(origin = {-96, 0}, extent = {{-10, -10}, {10, 10}}), iconTransformation(origin = {-88, 6}, extent = {{-10, -10}, {10, 10}}))); + Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_b port_b annotation( + Placement(transformation(origin = {96, 0}, extent = {{-10, -10}, {10, 10}}), iconTransformation(origin = {90, 2}, extent = {{-10, -10}, {10, 10}}))); +equation + state = Medium.setState_pT(p=Medium.p_default,T=port_a.T); + cp = Medium.specificHeatCapacityCp(state) ; + Q_flow = m_flow * cp * (port_b.T - port_a.T) ; + port_b.Q_flow = Q_flow; + port_a.Q_flow = 0 ; +end Fan; \ No newline at end of file diff --git a/Formation/OTRERA_formation/Components/Heatflow.mo b/Formation/OTRERA_formation/Components/Heatflow.mo new file mode 100644 index 0000000..6107dd0 --- /dev/null +++ b/Formation/OTRERA_formation/Components/Heatflow.mo @@ -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; \ No newline at end of file diff --git a/Formation/OTRERA_formation/Components/Temperature.mo b/Formation/OTRERA_formation/Components/Temperature.mo new file mode 100644 index 0000000..c65dcb7 --- /dev/null +++ b/Formation/OTRERA_formation/Components/Temperature.mo @@ -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; \ No newline at end of file diff --git a/Formation/OTRERA_formation/Components/ThermalCapacity.mo b/Formation/OTRERA_formation/Components/ThermalCapacity.mo new file mode 100644 index 0000000..9f7a198 --- /dev/null +++ b/Formation/OTRERA_formation/Components/ThermalCapacity.mo @@ -0,0 +1,39 @@ +within OTRERA_formation.Components; + +model ThermalCapacity + import Modelica.Fluid.Types.Dynamics ; + //USER DEFINED PARAMETERS + + parameter Dynamics energyDynamics = Dynamics.FixedInitial ; + 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 + if energyDynamics == Dynamics.SteadyStateInitial then + der(T) = 0 ; + elseif energyDynamics == Dynamics.FixedInitial then + T = T_start ; + end if ; +equation + + if energyDynamics == Dynamics.SteadyState then + Q_flow = 0 ; + else + Q_flow = m * cp * der(T) ; + end if ; + + //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; \ No newline at end of file diff --git a/Formation/OTRERA_formation/Components/package.mo b/Formation/OTRERA_formation/Components/package.mo new file mode 100644 index 0000000..2a4d34d --- /dev/null +++ b/Formation/OTRERA_formation/Components/package.mo @@ -0,0 +1,4 @@ +within OTRERA_formation; + +package Components +end Components; \ No newline at end of file diff --git a/Formation/OTRERA_formation/Components/package.order b/Formation/OTRERA_formation/Components/package.order new file mode 100644 index 0000000..7299c0f --- /dev/null +++ b/Formation/OTRERA_formation/Components/package.order @@ -0,0 +1,6 @@ +ThermalCapacity +Heatflow +Temperature +Convection +Convection_with_Element1D +Fan diff --git a/Formation/OTRERA_formation/Models/Coupled_model.mo b/Formation/OTRERA_formation/Models/Coupled_model.mo new file mode 100644 index 0000000..e61160f --- /dev/null +++ b/Formation/OTRERA_formation/Models/Coupled_model.mo @@ -0,0 +1,17 @@ +within OTRERA_formation.Models; + +model Coupled_model + 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(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}}), 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 diff --git a/Formation/OTRERA_formation/Models/Test_Media.mo b/Formation/OTRERA_formation/Models/Test_Media.mo new file mode 100644 index 0000000..4437d82 --- /dev/null +++ b/Formation/OTRERA_formation/Models/Test_Media.mo @@ -0,0 +1,20 @@ +within OTRERA_formation.Models; + + +model Test_Media + replaceable package Medium = Modelica.Media.Air.MoistAir constrainedby Modelica.Media.Interfaces.PartialMedium annotation(choicesAllMatching = true) ; + //USER DEFINED PARAMETERS + parameter Modelica.Units.SI.Temperature T = 573.15 ; + parameter Modelica.Units.SI.Pressure p = 155e5 ; + //INTERNAL VARIABLES + Medium.ThermodynamicState state ; + Medium.Density d ; + + //IMPORTED COMPONENTS + +equation + state = Medium.setState_pTX(p=p,T=T); + d = Medium.density(state) ; + + +end Test_Media; \ No newline at end of file diff --git a/Formation/OTRERA_formation/Models/Test_fan.mo b/Formation/OTRERA_formation/Models/Test_fan.mo new file mode 100644 index 0000000..da3d8a6 --- /dev/null +++ b/Formation/OTRERA_formation/Models/Test_fan.mo @@ -0,0 +1,15 @@ +within OTRERA_formation.Models; + +model Test_fan + Components.Fan fan(m_flow = 10) annotation( + Placement(transformation(origin = {2, 10}, extent = {{-10, -10}, {10, 10}}))); + Components.ThermalCapacity thermalCapacity(T_start = 293.15) annotation( + Placement(transformation(origin = {50, 10}, extent = {{-10, -10}, {10, 10}}))); + Components.Temperature temperature(T = 303.15) annotation( + Placement(transformation(origin = {-46, 10}, extent = {{-10, -10}, {10, 10}}))); +equation + connect(temperature.port, fan.port_a) annotation( + Line(points = {{-46, 10}, {-8, 10}}, color = {191, 0, 0})); + connect(fan.port_b, thermalCapacity.port) annotation( + Line(points = {{12, 10}, {50, 10}}, color = {191, 0, 0})); +end Test_fan; \ No newline at end of file diff --git a/Formation/OTRERA_formation/Models/Test_replaceable_media.mo b/Formation/OTRERA_formation/Models/Test_replaceable_media.mo new file mode 100644 index 0000000..07b10e6 --- /dev/null +++ b/Formation/OTRERA_formation/Models/Test_replaceable_media.mo @@ -0,0 +1,8 @@ +within OTRERA_formation.Models; + +model Test_replaceable_media + Test_Media test_Media(T = 623.15, p = 1.4e7, redeclare package Medium = Modelica.Media.Water.WaterIF97_R1pT) annotation( + Placement(transformation(origin = {2, 6}, extent = {{-10, -10}, {10, 10}}))); +equation + +end Test_replaceable_media; \ No newline at end of file diff --git a/Formation/OTRERA_formation/Models/package.mo b/Formation/OTRERA_formation/Models/package.mo new file mode 100644 index 0000000..46c0116 --- /dev/null +++ b/Formation/OTRERA_formation/Models/package.mo @@ -0,0 +1,4 @@ +within OTRERA_formation; + +package Models +end Models; \ No newline at end of file diff --git a/Formation/OTRERA_formation/Models/package.order b/Formation/OTRERA_formation/Models/package.order new file mode 100644 index 0000000..6b0a60b --- /dev/null +++ b/Formation/OTRERA_formation/Models/package.order @@ -0,0 +1,7 @@ +Coupled_model +Coupled_model_prescribed +Coupled_model_prescribed_variable +Test_Media +Test_replaceable_media +Test_fan +Test_wall diff --git a/Formation/OTRERA_formation/package.mo b/Formation/OTRERA_formation/package.mo new file mode 100644 index 0000000..2958882 --- /dev/null +++ b/Formation/OTRERA_formation/package.mo @@ -0,0 +1,9 @@ +package OTRERA_formation + + + + + + annotation( + uses(Modelica(version = "4.1.0"), TAeZoSysPro(version = "4.0-main"))); +end OTRERA_formation; \ No newline at end of file diff --git a/Formation/OTRERA_formation/package.order b/Formation/OTRERA_formation/package.order new file mode 100644 index 0000000..22ef4e7 --- /dev/null +++ b/Formation/OTRERA_formation/package.order @@ -0,0 +1,3 @@ +Components +Models +Cases