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