{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# CHAPTER 2:The Refrigeration Cycle"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 2.1,PAGE NUMBER:21"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The Carnot COP for the process is 9.0\n",
      "The Carnot COP for the refrigeration cycle is 6.0\n",
      "The Carnot COP for the ideal vapour compression cycle  is 5.4\n"
     ]
    }
   ],
   "source": [
    "# Variable Declaration\n",
    "T_l=0+273;# The required cooling temperature of room in °C\n",
    "T_h=30+273;# The temperature of outside air in °C\n",
    "T_e=-5+273;# The evaporating temperature of Refrigeration cycle in °C\n",
    "T_c=35+273;# The Condensing temperature of Refrigeration cycle in °C\n",
    "deltaT=5;# The temperature difference at the evaporator and the condenser in K\n",
    "h_i=249.7;# Enthalpy of fl uid entering evaporator in kJ/kg\n",
    "h_e=395.6;# Enthalpy of saturated vapour leaving evaporator in kJ/kg\n",
    "h_sup=422.5;# Enthalpy of superheated vapour leaving compressor in kJ/kg\n",
    "\n",
    "# Calculation\n",
    "CarnotCOP=T_l/(T_h-T_l);\n",
    "print\"The Carnot COP for the process is\",round(CarnotCOP,1)\n",
    "# For Refrigeration cycle,\n",
    "CarnotCOP=T_e/(T_c-T_e);\n",
    "print\"The Carnot COP for the refrigeration cycle is\",round(CarnotCOP,1)\n",
    "# For R134a,\n",
    "Q=h_e-h_i;# Cooling effect in kJ/kg\n",
    "W_in=h_sup-h_e;# Compressor energy input in kJ/kg\n",
    "COP=Q/W_in;# Ideal R134a vapour compression cycle COP\n",
    "print\"The Carnot COP for the ideal vapour compression cycle  is\",round(COP,1)\n",
    "\n"
   ]
  }
 ],
 "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.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
