{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 7.4 Venturi Type Valves"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "A 150 by 100 mm class 600 steel gate valve, conically tapered ports, length 550 mm, back of seat ring ~150 mm. The valve is connected to 146 mm schedule 80 pipe. The angle can be calculated to be 13 degrees. The valve is specified to be operating in turbulent conditions."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false,
    "execution": {
     "iopub.execute_input": "2022-08-22T01:20:24.154448Z",
     "iopub.status.busy": "2022-08-22T01:20:24.153316Z",
     "iopub.status.idle": "2022-08-22T01:20:24.843644Z",
     "shell.execute_reply": "2022-08-22T01:20:24.842865Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Darcy friction factor = 0.02015036859256496 dimensionless\n",
      "K2 = 1.3330449717924238 dimensionless\n",
      "Equivalent length L_D = 66.15486787096728 dimensionless\n",
      "Length for flow in complete turbulence = 9.658610709161223 meter\n"
     ]
    }
   ],
   "source": [
    "from fluids.units import *\n",
    "D1 = 100*u.mm\n",
    "D2 = 146*u.mm\n",
    "angle = 13.115*u.degrees\n",
    "fd = friction_factor(Re=1E5, eD=.0018*u.inch/D1)\n",
    "\n",
    "K2 = K_gate_valve_Crane(D1, D2, angle, fd)\n",
    "L_D = L_equiv_from_K(K2, fd)\n",
    "L = (L_D*D2).to(u.m)\n",
    "\n",
    "print('Darcy friction factor = %s' %fd)\n",
    "print('K2 = %s' %K2)\n",
    "print('Equivalent length L_D = %s' %L_D)\n",
    "print('Length for flow in complete turbulence = %s' %L)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "The values calculated in the problem use a friction factor of 0.015; this is the source of the discrepancies. Their procedure for loss in valves and fittings is based around the roughness of commercial steel pipe with a roughness of 0.0018 inches, but in their examples they simply look their friction factors up in a table which does not consider the diameter of the pipe.\n",
    "Their calculated values are K2 = 1.22, L/D=81.3, and L = 11.9."
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
