refactor : correction fan
This commit is contained in:
@@ -3,19 +3,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 ;
|
||||
parameter Modelica.Units.SI.MassFlowRate m_flow = 10 ;
|
||||
//INTERNAL VARIABLES
|
||||
Medium.ThermodynamicState state ;
|
||||
Modelica.Units.SI.SpecificHeatCapacity cp ;
|
||||
|
||||
//IMPORTED COMPONENTS
|
||||
|
||||
|
||||
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 * (-dT) ;
|
||||
Q_flow = m_flow * cp * (port_b.T - port_a.T) ;
|
||||
port_b.Q_flow = Q_flow;
|
||||
port_a.Q_flow = 0 ;
|
||||
end Fan;
|
||||
Reference in New Issue
Block a user