1- within OpenHPL.Waterway;
1+ within OpenHPL.Waterway;
22model Pipe "Model of a pipe"
33 outer Data data "Using standard data set" ;
44 extends OpenHPL.Icons.Pipe;
@@ -15,6 +15,8 @@ model Pipe "Model of a pipe"
1515 Dialog(group = "Geometry" ));
1616 parameter SI.Height p_eps = data.p_eps "Pipe roughness height" annotation (
1717 Dialog(group = "Geometry" ));
18+ parameter Real K_c = 0.1 "Loss coefficient for contraction"
19+ annotation (Dialog(group = "Geometry" ));
1820 // Steady state:
1921 parameter Boolean SteadyState=data.SteadyState "If true, starts in steady state" annotation (Dialog(group="Initialization" ));
2022 parameter SI.VolumeFlowRate Vdot_0=data.Vdot_0 "Initial flow rate of the pipe" annotation (Dialog(group="Initialization" ));
@@ -41,18 +43,32 @@ model Pipe "Model of a pipe"
4143 SI.Temperature T( start = T_0);
4244 */
4345
46+ protected
47+ parameter SI.Diameter D_eff=
48+ if D_i == D_o then
49+ D_i
50+ else
51+ (D_i - D_o) / log (D_i/ D_o) "Effective diameter for a linear taper" ;
52+
4453initial equation
4554 if SteadyState then
4655 der (M) = 0 ;
4756 end if ;
4857equation
4958 Vdot = mdot / data.rho "Volumetric flow rate through the pipe" ;
50- v = Vdot / A_ "Water velocity" ;
59+ v = Vdot / A_ "Average water velocity" ;
60+ v_o = Vdot / A_o "Outlet water velocity" ;
5161 M = data.rho * L * Vdot "Momentum of water" ;
5262 m = data.rho * A_ * L "Mass of water" ;
53- F_f = Functions.DarcyFriction.Friction(v, D_, L, data.rho, data.mu, p_eps) "Friction force" ;
54- der (M) = data.rho * Vdot ^ 2 * (1 / A_i - 1 / A_o) + p_i * A_i - p_o * A_o - F_f + m * data.g * cos_theta
55- "momentum balance" ;
63+ F_f = Functions.DarcyFriction.Friction(v, D_eff, L, data.rho, data.mu, p_eps)
64+ "Friction force" ;
65+ F_taper = K_c * 0.5 * data.rho * A_o * v_o * abs (v_o)
66+ "Tapering (local contraction) loss" ;
67+ der (M) = data.rho * Vdot^ 2 * (1 / A_i - 1 / A_o)
68+ + p_i * A_i - p_o * A_o
69+ - F_f - F_taper
70+ + m * data.g * cos_theta
71+ "Momentum balance including tapering loss" ;
5672 p_i = i.p "Inlet pressure" ;
5773 p_o = o.p "Outlet pressure" ;
5874
@@ -81,6 +97,9 @@ equation
8197 (inlet and outlet pressure from connectors).</p>
8298 <p>It should be noted that this pipe model provides possibilities for modelling
8399 of pipes with both a positive and a negative slopes (positive or negative height difference).</p>
100+ <p>If the pipe is slightly tapered then this can be taken into account by adjusting
101+ <code>K_c</code> based on your taper geometry: 0.05–0.15 for gentle cones,
102+ up to 0.6 for sharp contractions.</p>
84103 <p>More info about the pipe model can be found in
85104 <a href=\" modelica://OpenHPL.UsersGuide.References\">[Vytvytskyi2017]</a>
86105 and <a href=\" modelica://OpenHPL.UsersGuide.References\">[Splavska2017a]</a>.</p>
0 commit comments