Skip to content

Commit

Permalink
rework pump model and sensor #790
Browse files Browse the repository at this point in the history
  • Loading branch information
DaJansenGit committed Oct 24, 2019
1 parent 2cad670 commit 0876c5a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 24 deletions.
16 changes: 5 additions & 11 deletions AixLib/FastHVAC/BaseClasses/EnergyBalance.mo
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ model EnergyBalance "Base class depicts energy and mass balances"
"Heat port includes the parameter temperature and heat flow" annotation (Placement(
transformation(extent={{-20,60},{20,100}}), iconTransformation(extent={{
-20,60},{20,100}})));
Modelica.SIunits.EnthalpyFlowRate H_a "Enthalpy flow rate at port a";
Modelica.SIunits.EnthalpyFlowRate H_b "Enthalpy flow rate at port b";
protected
parameter Modelica.SIunits.SpecificHeatCapacity cp = medium.c
"medium's specific heat capacity";
Expand All @@ -26,20 +24,16 @@ equation
// Mass and energy balances
m_flow = enthalpyPort_a.m_flow;
enthalpyPort_a.m_flow + enthalpyPort_b.m_flow = 0;
// H_a = port_a.m_flow * actualStream(port_a.h_outflow);
// H_b = port_b.m_flow * actualStream(port_b.h_outflow);
// H_a + H_b = heatPort_a.Q_flow

enthalpyPort_b.T_outflow = heatPort_a.T;
enthalpyPort_a.T_outflow = heatPort_a.T;
// enthalpyPort_b.T_outflow = heatPort_a.T;
// enthalpyPort_a.T_outflow = heatPort_a.T;
enthalpyPort_b.h_outflow = cp * heatPort_a.T;
enthalpyPort_a.h_outflow = cp * heatPort_a.T;
enthalpyPort_a.h_outflow = 0;

// enthalpyPort_b.c_outflow = inStream(enthalpyPort_a.c_outflow);
// enthalpyPort_a.c_outflow = inStream(enthalpyPort_b.c_outflow);

enthalpyPort_a.dummy_potential = 1;
enthalpyPort_b.dummy_potential = 1;
enthalpyPort_a.dummy_potential = enthalpyPort_b.dummy_potential;


heatPort_a.Q_flow = - m_flow * (actualStream(enthalpyPort_a.h_outflow) - actualStream(enthalpyPort_b.h_outflow))
annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,
Expand Down
2 changes: 1 addition & 1 deletion AixLib/FastHVAC/Pipes/BaseClasses/PipeBase.mo
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ equation
color={176,0,0},
smooth=Smooth.None));
for i in 1:nNodes loop
connect(massFlowRate.dotm,heatConvPipeInside[i].m_flow);
connect(massFlowRate.m_flow, heatConvPipeInside[i].m_flow);
end for;
connect(pipeFluid.heatPort, heatConvPipeInside.port_b)
annotation (Line(points={{0,18.8},{0,28}}, color={191,0,0}));
Expand Down
2 changes: 1 addition & 1 deletion AixLib/FastHVAC/Pumps/Examples/Pump.mo
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ model Pump
DataBase.Radiators.Standard_MFD_WSchV1984_OneAppartment.Radiator_Livingroom())
annotation (Placement(transformation(extent={{60,-2},{80,16}})));
AixLib.FastHVAC.HeatGenerators.Boiler.Boiler boilerBase(paramBoiler=
Data.Boiler.General.Boiler_Vitogas200F_11kW(), T_start=333.15)
DataBase.Boiler.General.Boiler_Vitogas200F_11kW(), T_start=333.15)
annotation (Placement(transformation(extent={{-68,-4},{-46,18}})));
Modelica.Blocks.Sources.BooleanExpression booleanOnOffBoiler(y=true)
annotation (Placement(transformation(extent={{-90,20},{-70,40}})));
Expand Down
2 changes: 0 additions & 2 deletions AixLib/FastHVAC/Pumps/Pump.mo
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ equation

// constant values

enthalpyPort_b.T_outflow = inStream(enthalpyPort_a.T_outflow);
enthalpyPort_b.h_outflow = inStream(enthalpyPort_a.h_outflow);
enthalpyPort_a.h_outflow = 0;
enthalpyPort_a.T_outflow = 273.15;
enthalpyPort_b.dummy_potential = 1;
annotation (
defaultComponentName="pump",
Expand Down
13 changes: 4 additions & 9 deletions AixLib/FastHVAC/Sensors/MassFlowSensor.mo
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
within AixLib.FastHVAC.Sensors;
model MassFlowSensor "Mass flow sensor"

Modelica.Blocks.Interfaces.RealOutput dotm( unit="kg/s")
Modelica.Blocks.Interfaces.RealOutput m_flow(unit="kg/s")
"Output value which contains the measured mass flow of the fluid"
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=90,
origin={0,90}), iconTransformation(
extent={{-10,-10},{10,10}},
rotation=90,
origin={10,90})));
annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=
90)));
Interfaces.EnthalpyPort_a enthalpyPort_a "Input connector"
annotation (Placement(transformation(extent={{-100,-12},{-78,10}}),
iconTransformation(extent={{-100,-12},{-76,10}})));
Interfaces.EnthalpyPort_b enthalpyPort_b "Output connector"
annotation (Placement(transformation(extent={{80,-12},{102,10}}),
iconTransformation(extent={{78,-12},{102,10}})));
equation
dotm = enthalpyPort_a.m_flow;
m_flow = enthalpyPort_a.m_flow;

connect(enthalpyPort_a, enthalpyPort_b) annotation (Line(
points={{-89,-1},{91,-1}},
Expand Down

0 comments on commit 0876c5a

Please sign in to comment.