Skip to content

Commit 635e317

Browse files
committed
Not yet completed. Questions regarding how H is implemented
1 parent dd8a3da commit 635e317

File tree

2 files changed

+24
-17
lines changed

2 files changed

+24
-17
lines changed

OpenHPL/Resources/Documents/Developer_docs/OpenHPL_Pipe.tex

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ \subsection{Area change/conical pipe}
7373

7474
\section{Today's implementation}
7575
% ---
76-
\begin{comment}
76+
%\begin{comment}
77+
%
7778
\begin{lstlisting}
7879
within OpenHPL.Waterway;
7980
model Pipe "Model of a pipe"
@@ -150,7 +151,9 @@ \section{Today's implementation}
150151

151152

152153
\end{lstlisting}
153-
\end{comment}
154+
%
155+
156+
%\end{comment}
154157
% ---
155158
%
156159

OpenHPL/Waterway/Pipe.mo

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,54 +15,58 @@ 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"));
18+
2019
// Steady state:
2120
parameter Boolean SteadyState=data.SteadyState "If true, starts in steady state" annotation (Dialog(group="Initialization"));
2221
parameter SI.VolumeFlowRate Vdot_0=data.Vdot_0 "Initial flow rate of the pipe" annotation (Dialog(group="Initialization"));
2322

2423

2524
SI.Velocity v "Average Water velocity";
2625
SI.Force F_f "Friction force";
27-
// SI.Force F_taper "Tape friction force";
28-
SI.Momentum M "Water momentum";
26+
//SI.Momentum M "Water momentum";
2927
SI.Pressure p_i "Inlet pressure";
3028
SI.Pressure p_o "Outlet pressure";
3129
SI.Pressure dp=p_o-p_i "Pressure difference across the pipe";
3230
SI.VolumeFlowRate Vdot(start = Vdot_0) "Volume flow rate";
3331
protected
34-
SI.Velocity v_o;
35-
parameter Real delta=(D_i-D_o)/D_i "Contraction factor";
36-
// parameter Real ddd=;
3732
parameter SI.Diameter D_ = sqrt((4/C.pi)*A_) "Average diameter";
3833
parameter SI.Mass m = data.rho * A_ * L "Mass of water";
3934
parameter SI.Area A_i = D_i ^ 2 * C.pi / 4 "Inlet cross-sectional area";
4035
parameter SI.Area A_o = D_o ^ 2 * C.pi / 4 "Outlet cross-sectional area";
4136
parameter SI.Area A_ = 0.5 * (A_i + A_o) "Average cross-sectional area";
42-
37+
parameter Real delta=(D_i-D_o)/D_i "Contraction factor";
38+
parameter Real cf=((0.5*delta+1)/(delta^2+2*delta+1)) "Conical pipe function";
4339
parameter Real cos_theta = H / L "Slope ratio";
40+
parameter Real phi = Modelica.Units.Conversions.to_deg(Modelica.Math.atan((abs(D_i-D_o)/(2*L)))) "Cone half angle";
4441

4542

4643

4744

4845
initial equation
46+
4947
if SteadyState then
50-
der(M) = 0;
48+
// der(M)= 0;
49+
der(mdot) = 0;
5150
end if;
52-
assert((D_i-D_o)/L > 0.1, "Change in pipe diameter too large",AssertionLevel.warning);
51+
algorithm
52+
Modelica.Utilities.Streams.print("\nD> delta..........= "+String(delta)+"\n");
53+
Modelica.Utilities.Streams.print("\nD> Cone function..= "+String(cf)+"\n");
54+
assert( phi > 1.0 , "Change in pipe diameter is too large. (angle= "+String(phi)+" )",AssertionLevel.warning);
5355
equation
56+
5457
Vdot = mdot / data.rho "Volumetric flow rate through the pipe";
5558
v = Vdot / A_ "Average water velocity";
56-
v_o = Vdot / A_o "Outlet water velocity";
57-
M = data.rho * L * Vdot "Momentum of water";
58-
59-
F_f = Functions.DarcyFriction.Friction(v, D_, L, data.rho, data.mu, p_eps)*((0.5*delta+1)/(delta^2+2*delta+1)) "Friction force";
59+
// v_o = Vdot / A_o "Outlet water velocity";
60+
//M = data.rho * L * Vdot "Momentum of water";
6061

62+
F_f = Functions.DarcyFriction.Friction(v, D_, L, data.rho, data.mu, p_eps)*cf "Friction force";
63+
/*
6164
der(M) = data.rho * Vdot^2 * (1/A_i - 1/A_o)
6265
+ p_i * A_i - p_o * A_o
6366
- F_f
6467
+ m * data.g * cos_theta "Momentum balance including friction loss";
65-
68+
*/
69+
L * der(mdot)=(p_i+ data.rho *data.g * H)*A_i-p_o*A_o -F_f;
6670
p_i = i.p "Inlet pressure";
6771
p_o = o.p "Outlet pressure";
6872

0 commit comments

Comments
 (0)