From ca37ad165b5323ac0f15d1000b0c91a798d9ba4b Mon Sep 17 00:00:00 2001 From: Matthieu Descombes Date: Thu, 12 Feb 2026 18:05:17 +0100 Subject: [PATCH] feat : dev fan --- Formation/OTRERA_formation/Components/Fan.mo | 21 +++++++++++++++++++ .../OTRERA_formation/Components/package.order | 1 + 2 files changed, 22 insertions(+) create mode 100644 Formation/OTRERA_formation/Components/Fan.mo diff --git a/Formation/OTRERA_formation/Components/Fan.mo b/Formation/OTRERA_formation/Components/Fan.mo new file mode 100644 index 0000000..3846c5c --- /dev/null +++ b/Formation/OTRERA_formation/Components/Fan.mo @@ -0,0 +1,21 @@ +within OTRERA_formation.Components; + +model Fan +replaceable package Medium = Modelica.Media.Air.ReferenceAir.Air_pT constrainedby Modelica.Media.Interfaces.PartialMedium annotation(choicesAllMatching = true) ; + +extends Modelica.Thermal.HeatTransfer.Interfaces.Element1D ; + +//USER DEFINED PARAMETERS + parameter Modelica.Units.SI.MassFlowRate m_flow ; +//INTERNAL VARIABLES + Medium.ThermodynamicState state ; + Modelica.Units.SI.SpecificHeatCapacity cp ; + +//IMPORTED COMPONENTS + + +equation + state = Medium.setState_pT(p=Medium.p_default,T=port_a.T); + cp = Medium.specificHeatCapacityCp(state) ; + Q_flow = m_flow * cp * (-dT) ; +end Fan; \ No newline at end of file diff --git a/Formation/OTRERA_formation/Components/package.order b/Formation/OTRERA_formation/Components/package.order index d1251cc..7299c0f 100644 --- a/Formation/OTRERA_formation/Components/package.order +++ b/Formation/OTRERA_formation/Components/package.order @@ -3,3 +3,4 @@ Heatflow Temperature Convection Convection_with_Element1D +Fan