Water Change
Sudden or gradual change in pipe diameter, contraction and enlargement
Description
Equations
Variables
Connections
Parameters
See Also
The Water Change component models sudden or gradual changes in the diameter of a pipe and covers both contraction and enlargement which is automatically identified based on the ratio of diameters and flow direction. This component calculates mainly pressure difference and mass flow rate.
The calculation is changed based on parameter values of Loss model type, and Dynamics of mass in the Water Settings component, and the diameters at port_a and port_b.
The ratio of diameters are calculated with:
β=d__bd__ad__a>d__bd__ad__botherwise
The definition of loss coefficients are defined as follow:
Loss model type = Crane
This is for Crane model [1] [2].
If d__a>d__b,
Loss coefficient of Contraction at Inlet (at port_a):
K__c={0.8⋅sinθ2⋅1−β2β4θ≤45180⋅Pi0.5⋅1−β2⋅sinθ2β4otherwise
Loss coefficient of Enlargement at Outlet (at port_a):
K__e={2.6⋅sinθ2⋅1−β22β4θ≤45180⋅Pi1−β22β4otherwise
Thus, the total loss coefficient is defined by using the linear approximation for the transition between Contraction and Enlargement:
K=K__edp<−dp__transitionK__c−K__e2⋅dp__transition⋅dp+K__c+K__e2−dp__transition≤dp≤dp__transitionK__cdp>dp__transition
And, if d__a≤d__b,
Loss coefficient of Enlargement at Inlet (at port_a):
K__e={2.6⋅sinθ2⋅1−β22θ≤45180⋅Pi1−β22otherwise
K__c={0.8⋅sinθ2⋅1−β2θ≤45180⋅Pi0.5⋅1−β2⋅sinθ2otherwise
K=K__cdp<−dp__transitionK__e−K__c2⋅dp__transition⋅dp+K__e+K__c2−dp__transition≤dp≤dp__transitionK__edp>dp__transition
Loss model type = Hooper
This is for Hooper model [2].
Reynolds number for Friction factor calculation is defined with:
Re__target=max({ρ__adp≥0ρ__bothers⋅v__b⋅d__bd__a2⋅d__a{μ__adp≥0μ__bothers,10)
ⅆReⅆt=Re__target−ReT__const
The friction factor of flow is calculated with:
λ=`HeatTransfer.Functions.lambda_Re`Re,roughness,d__a,Re__CoT,IF__speed,1
(*) The above function `HeatTransfer.Functions.lambda_Re` is to calculated friction factor for Laminar and Turbulent flow. The fundamental implementation is based on the following equations. Especially, the equation of Turbulent flow is Swamee and Jain's approximation[1] .
Intermittencies for transition between Laminar and Turbulent flow are defined with:
κ__K_c=tanhIF__speed⋅Re−Re__CoT_c2+12
κ__K_e=tanhIF__speed⋅Re−Re__CoT_e2+12
K__c=1−κ__K_c⋅K__c_l+κ__K_c⋅K__c_t
Laminar:
K__c_l={1.2+160Re⋅1β4−1⋅1.6⋅sinθ2θ≤45180⋅Pi1.2+160Re⋅1β4−1⋅sinθ2otherwise
Turbulent:
K__c_t={0.6+0.48⋅λ⋅1−β2β4⋅1.6⋅sinθ2θ≤45180⋅Pi0.6+0.48⋅λ⋅1−β2β4⋅sinθ2otherwise
K__e=1−κ__K_e⋅K__e_l+κ__K_e⋅K__e_t
K__e_l={2⋅1−β4⋅1β4⋅2.6⋅sinθ2θ≤45180⋅Pi2⋅1−β4⋅1β4otherwise
K__e_t={1.0+0.8⋅λ⋅1−β22⋅1β4⋅2.6⋅sinθ2θ≤45180⋅Pi1.0+0.8⋅λ⋅1−β22⋅1β4otherwise
K__e_l={2⋅1−β4⋅2.6⋅sinθ2θ≤45180⋅Pi2⋅1−β4otherwise
K__e_t={1.0+0.8⋅λ⋅1−β22⋅2.6⋅sinθ2θ≤45180⋅Pi1.0+0.8⋅λ⋅1−β22otherwise
K__c_l={1.2+160Re⋅1β4−1⋅β4⋅1.6⋅sinθ2θ≤45180⋅Pi1.2+160Re⋅1β4−1⋅β4⋅sinθ2otherwise
K__c_t={0.6+0.48⋅λ⋅1−β2⋅1.6⋅sinθ2θ≤45180⋅Pi0.6+0.48⋅λ⋅1−β2⋅sinθ2otherwise
(Reference) Detailed implementation of Friction factor calculation
Friction factor of Laminar flow is calculated with:
λ__lam=64Re
And, Turbulent flow's friction factor is defined with (Swamee and Jain's approximation):
λ__tur=0.25logroughnessd__a3.7+5.74Re0.92
Intermittency is defined with:
κ=tanhIF__speed⋅Re−Re__CoT2+12
So, the friction factor is calculated with:
λ=1−κ⋅λ__lam+κ⋅λ__tur
The following plot is Reynolds number vs Friction factor, and roughnessd__a=0.001, IF__speed=0.007, Re__CoT=3500.
The definition of Flow calculation is the following and:
Dynamics of mass = Static
Pressure difference and flow velocities are calculated with the following equations:
v__a=mflow{ρ__adp≥0ρ__bothers⋅d__a22⋅π
v__b=mflow{ρ__adp≥0ρ__bothers⋅d__b22⋅π
dp=K⋅{ρ__adp≥0ρ__bothers⋅⋅v__a2⋅signv__a2
Dynamics of mass = Dynamic
In theory, Mass flow rate and flow velocities are calculated with the following equations with Loss coefficient:
v__a=2K⋅{1ρ__adp≥01ρ__bothers⋅dp⋅signdp
mflow=d__a22⋅π⋅{ρ__adp≥0ρ__bothers⋅v__a
v__b=mflow{ρ__adp≥0ρ__bothers⋅d__b22⋅π
In the Heat Transfer Library, the equation for v__a is used to resolve difficulties of the numerical calculation:
v__a=2K⋅`HeatTransfer.Functions.regRoot2`dp,dp_small,1ρ__a,1ρ__b,true,sharpness
(*) `HeatTransfer.Functions.regRoot2` is the same function as `Modelica.Fluid.Utilities.regRoot2`. To check the details of the package and view the original documentation, which includes author and copyright information, click here.
Definitions related to Mass flow rate and pressure:
dp=`port_a.p`−`port_b.p`
`port_a.mflow`=mflow
`port_b.mflow`=−mflow
Density is calculated with:
ρ__a=inStream`port_a.rho`
ρ__b=inStream`port_b.rho`
If Fidelity of properties = Constant, properties μ and c__p and k are constants and properties at each ports are:
μ__a=μ
μ__b=μ
(*) Regarding the value of properties for Constant, see more in Water Settings.
If Fidelity of properties = Liquid water (Lookup table of IAPWS/IF97), properties are calculated with:
μ__a=LUT__μ__a`port_a.rho`,inStream`port_a.T`
μ__b=LUT__μ__b`port_b.rho`,inStream`port_b.T`
(*) The properties are defined with Liquid water (Lookup table of IAPWS/IF97), see more in Water Settings.
If Fidelity of properties = IAPWS/IF97 standard, properties are calculated with:
μ__a=Function__μ__a`port_a.rho`,inStream`port_a.T`,`port_a.p`
μ__b=Function__μ__b`port_b.rho`,inStream`port_b.T`,`port_b.p`
(*) The properties are defined with IAPWS/IF97 standard, see more in Water Settings.
Port's variables are defined with:
`port_a.hflow`=inStream`port_b.hflow`
`port_b.hflow`=inStream`port_a.hflow`
`port_a.rho`=inStream`port_b.rho`
`port_b.rho`=inStream`port_a.rho`
`port_a.T`=inStream`port_b.T`
`port_b.T`=inStream`port_a.T`
References
[1] : Flow of Fluids Through Valves, Fittings, and Pipe, Crane Valves North America, Technical Paper No. 410M. 1979, p A-26
[2] : Ron Darby, Chemical Engineering Fluid Mechanics 2nd edition, Marcel Dekker, 2001
[3] : William B. Hooper, Calculate Head loss caused by change in pipe size, Chemical Engineering November 1988, p 89
Symbol
Units
Modelica ID
dp
Pa
Pressure difference
mflow
kgs
Mass flow rate
v__a
ms
Velocity of flow at port a
v_a
v__b
Velocity of flow at port b
v_b
K
−
Loss coefficient
K__c
Loss coefficient, Contraction
K_c
K__e
Loss coefficient, Enlargement
K_e
K__c_l
Loss coefficient, Contraction, Laminar (only for Hooper model)
K_c_l
K__c_t
Loss coefficient, Contraction, Turbulent (only for Hooper model)
K_c_t
K__e_l
Loss coefficient, Enlargement, Laminar (only for Hooper model)
K_e_l
K__e_t
Loss coefficient, Enlargement, Turbulent (only for Hooper model)
K_e_t
Re
Reynolds number for Friction factor calculation
Re__target
Targeted Reynolds number for Friction factor calculation
Re_target
λ
Friction factor
lambda
κ__K_c
Intermittency factor to calculate Transition zone, Contraction, Loss coefficient (Only for Hooper)
kappa_K_c
κ__K_e
Intermittency factor to calculate Transition zone, Enlargement, Loss coefficient (Only for Hooper)
kappa_K_e
ρ__a
kgm3
Density at port_a
rho_a
ρ__b
Density at port_b
rho_b
μ__a
Pa⋅s
Dynamic viscosity at port_a
vis_a
μ__b
Dynamic viscosity at port_b
vis_b
Name
Condition
port__a
Water Port
port_a
port__b
port_b
Default
Watersimulationsettings
WaterSettings1
Specify a component of Water simulation settings
Settings
Loss model type
Crane
Select loss calculation model type
- Crane
- Hooper
TypeOfModel
d__a
0.05
m
Diameter, port_a
d_a
d__b
0.02
Diameter, port_b
d_b
θ
20180⋅Pi
rad
Angle of Contraction/Enlargement
theta
roughness
0.000025
Absolute roughness of pipe, with a default for a smooth steel pipe
dp__transition
10
Pressure difference for Transition zone |dp| <= dp_transition
dp_transition
dp__small
0.1
Approximation of function for |dp| <= dp_small
dp_small
sharpness
1.0
Sharpness of approximation for sqrt(dp) and sqrt(rho * dp)
T__const
0.001
s
Time constant for Reynolds number calculation
T_const
Re__CoT
3500
Reynolds number of the center of Transition zone
Re_CoT
Re__CoT_c
2500
Reynolds number of the center of Transition zone, Contraction
Re_CoT_c
Re__CoT_e
4000
Reynolds number of the center of Transition zone, Enlargement
Re_CoT_e
Spread ofIntermittencyfactor
0.007
Changing rate of Intermittency factor
IF_spread
Heat Transfer Library Overview
Water Overview
Water Shapes Overview
Download Help Document