{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 7.1 Smooth Pipe (Plastic)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "Water at 30 degrees Celsius flows through a 20 m length of 50 mm plastic (smooth wall) pipe, at a flow rate of 200 L/min.\n",
    "\n",
    "Calculate the Reynolds number and friction factor."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Reynolds number = 101023.65443218236 dimensionless\n",
      "Darcy friction factor = 0.01810798369184942 dimensionless\n"
     ]
    }
   ],
   "source": [
    "from fluids.units import  *\n",
    "from thermo.units import Stream\n",
    "from math import *\n",
    "\n",
    "Q = 0.2*u.m**3/u.min\n",
    "T = 30*u.degC\n",
    "P = 2*u.bar # assumed\n",
    "water = Stream('water', T=T, P=P, Q=Q)\n",
    "\n",
    "NPS, Di, Do, t = nearest_pipe(Di=0.05*u.m)\n",
    "v = Q/(pi/4*Di**2)\n",
    "Re = Reynolds(D=Di, rho=water.rho, mu=water.mu, V=v)\n",
    "print('Reynolds number = %s' %Re)\n",
    "fd = friction_factor(Re=Re, eD=_roughness['Glass']/Di)\n",
    "print('Darcy friction factor = %s' %fd)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The values presented in their solution are Re=100600; and fd=0.0179. The difference in values is due to the precision they used."
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
