diff --git a/OpenHPL/ElectroMech/Turbines/Francis.mo b/OpenHPL/ElectroMech/Turbines/Francis.mo index fe22681..f86471e 100644 --- a/OpenHPL/ElectroMech/Turbines/Francis.mo +++ b/OpenHPL/ElectroMech/Turbines/Francis.mo @@ -60,6 +60,7 @@ model Francis "Model of the Francis turbine" SI.Area A_1 "Runner inlet cross section", A_0 "Turbine inlet cross section", A_v "Guide vane cross section", A_2 "Runner outlet cross section"; SI.EnergyFlowRate Wdot_s "Shaft power", Wdot_ft "Total runner losses", W_t1 "Euler first term", W_t2 "Euler second term", Wdot_ft_s "Shock losses", Wdot_ft_w "Whirl losses", Wdot_ft_l "Friction losses", Wdot_t "Total power"; SI.VolumeFlowRate Vdot "Flow rate"; + SI.MassFlowRate mdot "Mass flow rate"; SI.AngularVelocity w=w_in "Angular velocity"; SI.Velocity u_2 "Outlet reference velocity", c_m2 "Outlet meridional velocity", c_m1 "Inlet meridional velocity", u_1 "Inlet reference velocity", c_u1 "Inlet tangential velocity"; Modelica.Units.NonSI.Angle_deg beta1 "Inlet blade angle"; @@ -202,6 +203,8 @@ equation coef = Wdot_s / Wdot_t; // connectors p_tr2 = o.p; + i.mdot+o.mdot=0; + mdot=i.mdot; // output mechanical power P_out = Wdot_s; annotation ( diff --git a/OpenHPL/ElectroMech/Turbines/Pelton.mo b/OpenHPL/ElectroMech/Turbines/Pelton.mo index 2f0a1b3..4ce1f79 100644 --- a/OpenHPL/ElectroMech/Turbines/Pelton.mo +++ b/OpenHPL/ElectroMech/Turbines/Pelton.mo @@ -16,6 +16,7 @@ model Pelton "Model of the Pelton turbine" SI.Area A_1, A_0 = pi * D_0 ^ 2 / 4; SI.EnergyFlowRate Wdot_s "Shaft power"; SI.VolumeFlowRate Vdot "Flow rate"; + SI.MassFlowRate mdot "Mass flow rate"; SI.Velocity v_R, v_1; SI.AngularVelocity w=w_in "Angular velocity"; Real cos_b = Modelica.Math.cos(Modelica.Units.Conversions.from_deg(beta)); @@ -45,6 +46,9 @@ equation p_tr1 = i.p; // + dp_n; p_tr2 = o.p; + // Flow rate connectors + i.mdot+o.mdot=0; + mdot=i.mdot; // output mechanical power P_out = Wdot_s; annotation ( diff --git a/OpenHPL/ElectroMech/Turbines/Turbine.mo b/OpenHPL/ElectroMech/Turbines/Turbine.mo index 07e7cc5..935fd19 100644 --- a/OpenHPL/ElectroMech/Turbines/Turbine.mo +++ b/OpenHPL/ElectroMech/Turbines/Turbine.mo @@ -31,6 +31,7 @@ model Turbine "Simple turbine model with mechanical connectors" extends OpenHPL.Interfaces.TurbineContacts; SI.Pressure dp "Turbine pressure drop"; + SI.MassFlowRate mdot "Turbine pressure drop"; SI.EnergyFlowRate Kdot_i_tr "Kinetic energy flow"; SI.VolumeFlowRate Vdot "Flow rate"; Real C_v_ "Guide vane 'valve capacity'"; @@ -46,6 +47,8 @@ equation "Define guide vane 'valve capacity' base on the Nominal turbine parameters"; dp = Vdot ^ 2 * data.p_a / (C_v_ * max(1e-6, u_t)) ^ 2 "Turbine valve equation for pressure drop"; dp = i.p - o.p "Link the pressure drop to the ports"; + i.mdot+o.mdot=0 "Mass balance"; + mdot = i.mdot "Flow direction"; Kdot_i_tr = dp * Vdot "Turbine energy balance"; if ConstEfficiency then Wdot_s = eta_h * Kdot_i_tr; diff --git a/OpenHPL/Interfaces/ContactNode.mo b/OpenHPL/Interfaces/ContactNode.mo deleted file mode 100644 index d647800..0000000 --- a/OpenHPL/Interfaces/ContactNode.mo +++ /dev/null @@ -1,20 +0,0 @@ -within OpenHPL.Interfaces; -partial model ContactNode "Model of two connectors and node pressure" - SI.Pressure p_n "Node pressure"; - //SI.Temperature T_n "Node temperature"; - SI.MassFlowRate mdot "Mass flow rate"; - extends TwoContact; -equation - p_n = i.p; - i.p = o.p; - //T_n = i.T; - //i.T = o.T; - mdot = i.mdot + o.mdot; - annotation ( - Documentation(info = " -
ContactNode is a superclass, which has two Contacts i, o and assumes
- that inlet pressure of i is equal to outlet at o.
- This node pressure is determined by p_n.
- Also the mass flow rate in this node is mdot.
ContactPort is a superclass, which has two Contacts i, o and
- assumes that the inlet mass flow rate of i is identical to the outlet
- mass flow rate of o. This mass flow rate is determined as mdot.