{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 7.5 Lift Check Valves"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "A lift check valve of type globe (with a wing-guided disc) is added to a 80 mm Schedule 40 horizontal pipe carrying water at a flow rate of 300 L/min.\n",
    "\n",
    "Calculate the check valve size, and pressure drop. The disc should be fully lifted at the specified flow."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Minimum velocity = 1.5825637790011153 meter / second\n",
      "Velocity in 80 mm valve = 1.0490717871198245 meter / second\n",
      "Minimum velocity = 1.0252301935349282 meter / second\n",
      "Velocity in 60 mm valve = 1.6193660919636594 meter / second\n",
      "Loss coefficient = 24.87967662305315 dimensionless\n",
      "Pressure drop = 13666.040906803597 pascal\n"
     ]
    }
   ],
   "source": [
    "from fluids.units import *\n",
    "from math import *\n",
    "Q = 300*u.L/u.min\n",
    "D_80 = 77.9*u.mm\n",
    "\n",
    "rho = 998.2*u.kg/u.m**3\n",
    "# Try: schedule 40, 80 mm valve\n",
    "D_60 = 62.7*u.mm\n",
    "v_lift = v_lift_valve_Crane(rho=rho, D1=D_80, D2=D_80, style='lift check straight')\n",
    "print('Minimum velocity = %s' %v_lift)\n",
    "\n",
    "v =  Q/(pi/4*D_80**2)\n",
    "print('Velocity in 80 mm valve = %s' %v.to_base_units())\n",
    "\n",
    "# v is lower than the lift velocity; try the 60 mm valve\n",
    "v_lift = v_lift_valve_Crane(rho=rho, D1=D_60, D2=D_80, style='lift check straight')\n",
    "print('Minimum velocity = %s' %v_lift)\n",
    "\n",
    "v =  Q/(pi/4*D_60**2)\n",
    "print('Velocity in 60 mm valve = %s' %v.to_base_units())\n",
    "# The desired velocity is close enough\n",
    "\n",
    "fd = 0.017 # given, 80 mm pipe upstream\n",
    "K2 = K_lift_check_valve_Crane(D_60, D_80, fd=fd, angled=False)\n",
    "print('Loss coefficient = %s'%K2)\n",
    "v_pipe = Q/(pi/4*D_80**2)\n",
    "\n",
    "dP = 0.5*rho*v_pipe**2*K2\n",
    "print('Pressure drop = %s' %dP.to(u.Pa))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "The values calculated in the example are K2 = 26.3 and pressure drop = 14450 Pa. Interestingly, the formula for minimum lift velocity used in their example does not use the ratio of diameters as the formula in their appendix shows. Otherwise the examples match.\n"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
