You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Hydraulic/IsothermalCompressible/components.jl
+7-14Lines changed: 7 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,17 @@
1
1
2
2
"""
3
-
Cap(; p_int, name)
3
+
Cap(; name)
4
4
5
5
Caps a hydraulic port to prevent mass flow in or out.
6
6
7
-
# Parameters:
8
-
- `p_int`: [Pa] initial pressure (set by `p_int` argument)
9
-
10
7
# Connectors:
11
8
- `port`: hydraulic port
12
9
"""
13
10
@mtkmodel Cap begin
14
11
15
12
@variablesbegin
16
13
p(t), [guess =0]
17
-
end
14
+
end
18
15
19
16
@componentsbegin
20
17
port =HydraulicPort()
@@ -28,12 +25,9 @@ Caps a hydraulic port to prevent mass flow in or out.
28
25
end
29
26
30
27
"""
31
-
Open(; p_int, name)
28
+
Open(; name)
32
29
33
-
Provides an "open" boundary condition for a hydraulic port such that mass flow `dm` is non-zero. This is opposite from an un-connected hydraulic port or the `Cap` boundary component which sets the mass flow `dm` to zero.
34
-
35
-
# Parameters:
36
-
- `p_int`: [Pa] initial pressure (set by `p_int` argument)
30
+
Provides an "open" boundary condition for a hydraulic port such that mass flow `dm` is non-zero. This is opposite from an un-connected hydraulic port or the `Cap` boundary component which sets the mass flow `dm` to zero.
37
31
38
32
# Connectors:
39
33
- `port`: hydraulic port
@@ -230,12 +224,11 @@ end
230
224
@deprecate Pipe Tube
231
225
232
226
"""
233
-
FlowDivider(;p_int, n, name)
227
+
FlowDivider(; n, name)
234
228
235
229
Reduces the flow from `port_a` to `port_b` by `n`. Useful for modeling parallel tubes efficiently by placing a `FlowDivider` on each end of a tube.
236
230
237
231
# Parameters:
238
-
- `p_int`: [Pa] initial pressure
239
232
- `n`: divide flow from `port_a` to `port_b` by `n`
Fluid parameter setter for isothermal compressible fluid domain. Defaults given for water at 20°C and 0Pa gage (1atm absolute) reference pressure. Density is modeled using the Tait equation of state. For pressures below the reference pressure, density is linearly interpolated to the gas state (when `let_gas` is set to 1), this helps prevent pressures from going below the reference pressure.
37
+
Fluid parameter setter for isothermal compressible fluid domain. Defaults given for water at 20°C and 0Pa gage (1atm absolute) reference pressure. Density is modeled using the Tait equation of state. For pressures below the reference pressure, density is linearly interpolated to the gas state (when `let_gas` is set to 1), this helps prevent pressures from going below the reference pressure.
42
38
43
39
# Parameters:
44
40
45
41
- `ρ`: [kg/m^3] fluid density at 0Pa reference gage pressure (set by `density` argument)
46
42
- `Β`: [Pa] fluid bulk modulus describing the compressibility (set by `bulk_modulus` argument)
47
43
- `μ`: [Pa*s] or [kg/m-s] fluid dynamic viscosity (set by `viscosity` argument)
48
44
- `n`: density exponent
49
-
- `let_gas`: set to 1 to allow fluid to transition from liquid to gas (for density calculation only)
45
+
- `let_gas`: set to 1 to allow fluid to transition from liquid to gas (for density calculation only)
50
46
- `ρ_gas`: [kg/m^3] density of fluid in gas state at reference gage pressure `p_gas` (set by `gas_density` argument)
51
47
- `p_gas`: [Pa] reference pressure (set by `gas_pressure` argument)
Calculates the friction factor ``f`` for fully developed flow in a tube such that ``Δp = f \\cdot \\rho \\frac{u^2}{2} \\frac{l}{d_h}`` where
79
+
Calculates the friction factor ``f`` for fully developed flow in a tube such that ``Δp = f \\cdot \\rho \\frac{u^2}{2} \\frac{l}{d_h}`` where
84
80
85
81
- ``Δp``: [Pa] is the pressure difference over the tube length ``l``
86
82
- ``\\rho``: [kg/m^3] is the average fluid density
87
83
- ``u``: [m/s] is the average fluid velocity
88
-
- ``l``: [m] is the tube length
84
+
- ``l``: [m] is the tube length
89
85
90
86
The friction factor is calculated for laminar and turbulent flow with a transition region between Reynolds number 2000 to 3000. Turbulent flow equation is for smooth tubes, valid for the Reynolds number range up to 5e6.
0 commit comments