{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 7.3 L, L over D, K, and Kv for Conventional Type Valves"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "A 100 mm class 600 steel angle valve, has a full area seat.\n",
    "\n",
    "Calculate its resistance coefficient K, flow coefficient Kv, the equivalent length of it L/D, and the length for complete turbulent L."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Loss coefficient = 2.47296378211 dimensionless\n",
      "Valve flow coefficient = 240.316529308 meter ** 3 / hour\n",
      "Equivalent length = 149.876592855 dimensionless\n",
      "Length for complete turbulence = 14.5680048255 meter\n"
     ]
    }
   ],
   "source": [
    "from fluids.units import *\n",
    "NPS, Di, Do, t = nearest_pipe(Do=0.103*u.m, schedule='80')\n",
    "fd = 0.0165 # provided - note equivalent length is proportional to this value\n",
    "d = 0.0972*u.m # diameter of seat\n",
    "K = K_angle_valve_Crane(D1=d, D2=Di, fd=fd, style=1)\n",
    "Kv = K_to_Kv(K, d)\n",
    "L_D = L_equiv_from_K(K, fd)\n",
    "L = L_D*d\n",
    "\n",
    "print('Loss coefficient = %s' %K)\n",
    "print('Valve flow coefficient = %s' %Kv)\n",
    "print('Equivalent length = %s' % L_D)\n",
    "print('Length for complete turbulence = %s' %L)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The values given in the solution are K=2.475, Kv = 240.2, L/D=150, and L = 14.6."
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
