K_GATE_VALVE
Overview
Calculate the loss coefficient (K) for a gate valve using the Crane method.
Excel Usage
=K_GATE_VALVE(D_valve, D_pipe, angle)
D_valve(float, required): Diameter of the valve seat bore [m]D_pipe(float, required): Diameter of the pipe attached to the valve [m]angle(float, required): Angle formed by the reducer in the valve [degrees]
Returns (float): Loss coefficient K for the gate valve [-]
Examples
Example 1: Gate valve with 13 degree angle
Inputs:
| D_valve | D_pipe | angle |
|---|---|---|
| 0.1 | 0.146 | 13.115 |
Excel formula:
=K_GATE_VALVE(0.1, 0.146, 13.115)
Expected output:
| Result |
|---|
| 1.1466 |
Example 2: Full bore gate valve (no reduction)
Inputs:
| D_valve | D_pipe | angle |
|---|---|---|
| 0.1 | 0.1 | 0 |
Excel formula:
=K_GATE_VALVE(0.1, 0.1, 0)
Expected output:
| Result |
|---|
| 0.1303 |
Example 3: Reduced port gate valve
Inputs:
| D_valve | D_pipe | angle |
|---|---|---|
| 0.05 | 0.1 | 30 |
Excel formula:
=K_GATE_VALVE(0.05, 0.1, 30)
Expected output:
| Result |
|---|
| 10.626 |
Example 4: Steep angle gate valve (50 degrees)
Inputs:
| D_valve | D_pipe | angle |
|---|---|---|
| 0.08 | 0.1 | 50 |
Excel formula:
=K_GATE_VALVE(0.08, 0.1, 50)
Expected output:
| Result |
|---|
| 0.9202 |
Python Code
import micropip
await micropip.install(["fluids"])
from fluids.fittings import K_gate_valve_Crane as fluids_k_gate_valve
def k_gate_valve(D_valve, D_pipe, angle):
"""
Calculate the loss coefficient (K) for a gate valve using the Crane method.
See: https://fluids.readthedocs.io/fluids.fittings.html#fluids.fittings.K_gate_valve_Crane
This example function is provided as-is without any representation of accuracy.
Args:
D_valve (float): Diameter of the valve seat bore [m]
D_pipe (float): Diameter of the pipe attached to the valve [m]
angle (float): Angle formed by the reducer in the valve [degrees]
Returns:
float: Loss coefficient K for the gate valve [-]
"""
try:
D1 = float(D_valve)
D2 = float(D_pipe)
angle = float(angle)
except (ValueError, TypeError):
return "Error: D_valve, D_pipe, and angle must be numbers."
if D1 <= 0 or D2 <= 0:
return "Error: Diameters must be positive."
if D1 > D2:
return "Error: D_valve must be <= D_pipe."
if angle < 0:
return "Error: Angle must be non-negative."
try:
result = fluids_k_gate_valve(D1=D1, D2=D2, angle=angle)
return float(result)
except Exception as e:
return f"Error: {str(e)}"