23 lines
1.1 KiB
Plaintext
23 lines
1.1 KiB
Plaintext
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; |