diff --git a/AixLib/FastHVAC/BaseClasses/EnergyBalance.mo b/AixLib/FastHVAC/BaseClasses/EnergyBalance.mo index 62a6fe1567..a16b640239 100644 --- a/AixLib/FastHVAC/BaseClasses/EnergyBalance.mo +++ b/AixLib/FastHVAC/BaseClasses/EnergyBalance.mo @@ -1,6 +1,6 @@ within AixLib.FastHVAC.BaseClasses; model EnergyBalance "Base class depicts energy and mass balances" - + Modelica.SIunits.MassFlowRate m_flow ""; AixLib.FastHVAC.Interfaces.EnthalpyPort_a enthalpyPort_a "Enthalpie input port includes the parameter temperature, specific enthalpy, specific heat capacity and mass flow" annotation (Placement(transformation(extent={{-100,-20},{-40,38}}), @@ -17,12 +17,19 @@ model EnergyBalance "Base class depicts energy and mass balances" equation // Mass and energy balances - enthalpyPort_a.m_flow - enthalpyPort_b.m_flow = 0; - enthalpyPort_b.T = heatPort_a.T; - enthalpyPort_b.h = enthalpyPort_a.c*heatPort_a.T; - enthalpyPort_b.c = enthalpyPort_a.c; - heatPort_a.Q_flow = -(enthalpyPort_a.h*enthalpyPort_a.m_flow - enthalpyPort_b.h*enthalpyPort_b.m_flow); + m_flow = enthalpyPort_a.m_flow; + enthalpyPort_a.m_flow + enthalpyPort_b.m_flow = 0; + enthalpyPort_b.T_outflow = heatPort_a.T; + enthalpyPort_a.T_outflow = heatPort_a.T; + enthalpyPort_b.h_outflow = inStream(enthalpyPort_a.c_outflow) * heatPort_a.T; + enthalpyPort_a.h_outflow = inStream(enthalpyPort_b.c_outflow) * heatPort_a.T; + + actualStream(enthalpyPort_b.c_outflow) = actualStream(enthalpyPort_a.c_outflow); + enthalpyPort_a.p = 1000; + enthalpyPort_b.p = 1000; + + heatPort_a.Q_flow = - m_flow * (actualStream(enthalpyPort_a.h_outflow) - actualStream(enthalpyPort_b.h_outflow)) annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, -100},{100,100}}), graphics={Rectangle( extent={{-60,60},{60,-60}}, @@ -57,4 +64,5 @@ equation ")); + end EnergyBalance; diff --git a/AixLib/FastHVAC/Interfaces/EnthalpyPort.mo b/AixLib/FastHVAC/Interfaces/EnthalpyPort.mo index fc9ef3882d..b1a5d77152 100644 --- a/AixLib/FastHVAC/Interfaces/EnthalpyPort.mo +++ b/AixLib/FastHVAC/Interfaces/EnthalpyPort.mo @@ -1,12 +1,11 @@ within AixLib.FastHVAC.Interfaces; partial connector EnthalpyPort "Enthalpy port for 1-dim. enthalpy transfer" - - Modelica.SIunits.Temperature T "Port temperature"; - Modelica.SIunits.MassFlowRate m_flow - "Mass flow rate(positive if flowing from outside into the component)"; - Modelica.SIunits.SpecificEnthalpy h "Specific enthalpy of fluid"; - Modelica.SIunits.SpecificHeatCapacity c "Constant specific heat capacity"; - + flow Modelica.SIunits.MassFlowRate m_flow + "Mass flow rate(positive if flowing from outside into the component)"; + Modelica.SIunits.Pressure p "dummy pressure"; + stream Modelica.SIunits.Temperature T_outflow "Port temperature"; + stream Modelica.SIunits.SpecificEnthalpy h_outflow "Specific enthalpy of fluid"; + stream Modelica.SIunits.SpecificHeatCapacity c_outflow "Constant specific heat capacity"; annotation (Documentation(info="This is an interface model for a 1-dimensional enthalpy port to consider enthalpy transfer ", revisions=" diff --git a/AixLib/FastHVAC/Interfaces/EnthalpyPort_b.mo b/AixLib/FastHVAC/Interfaces/EnthalpyPort_b.mo index 40d61bbe86..063ad8a5ee 100644 --- a/AixLib/FastHVAC/Interfaces/EnthalpyPort_b.mo +++ b/AixLib/FastHVAC/Interfaces/EnthalpyPort_b.mo @@ -1,20 +1,22 @@ within AixLib.FastHVAC.Interfaces; connector EnthalpyPort_b "Outlet enthalpy connector non-Fluid models" - extends AixLib.FastHVAC.Interfaces.EnthalpyPort; - annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, - -100},{100,100}}), graphics={Ellipse( - extent={{-100,100},{100,-100}}, - lineColor={176,0,0}, thickness={0.5}, - fillColor={176,0,0}, - fillPattern=FillPattern.Solid), Ellipse( - extent={{-54,50},{52,-52}}, - lineColor={255,255,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid)}), Documentation(info="

+extends AixLib.FastHVAC.Interfaces.EnthalpyPort; + +annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}}), graphics={Ellipse( + extent={{-100,100},{100,-100}}, + lineColor={176,0,0}, thickness={0.5}, + fillColor={176,0,0}, + fillPattern=FillPattern.Solid), Ellipse( + extent={{-54,50},{52,-52}}, + lineColor={255,255,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid)}), Documentation(info="

This model defines a inlet enthalpy port used within the FastHVAC package

-", revisions=" +", + revisions="