summaryrefslogtreecommitdiff
path: root/sample_notebooks/kartiksankhla/Chapter2.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'sample_notebooks/kartiksankhla/Chapter2.ipynb')
-rw-r--r--[-rwxr-xr-x]sample_notebooks/kartiksankhla/Chapter2.ipynb217
1 files changed, 154 insertions, 63 deletions
diff --git a/sample_notebooks/kartiksankhla/Chapter2.ipynb b/sample_notebooks/kartiksankhla/Chapter2.ipynb
index 21f2d4c4..f12ee152 100755..100644
--- a/sample_notebooks/kartiksankhla/Chapter2.ipynb
+++ b/sample_notebooks/kartiksankhla/Chapter2.ipynb
@@ -1,7 +1,7 @@
{
"metadata": {
"name": "",
- "signature": "sha256:e984fee9b841dd6e9b7eedf1533b0a0d297cd9f484c047f051ce48a09b156826"
+ "signature": "sha256:44c6b2962e60454059ed8ab0f850fa5cf7fde8b83f0146551b8d869bf0ff197f"
},
"nbformat": 3,
"nbformat_minor": 0,
@@ -13,7 +13,9 @@
"level": 1,
"metadata": {},
"source": [
- "Chapter2-Nuclear Engineering"
+ "Chapter2-Basic Thermodynamics, Fluid\n",
+ "Mechanics: Definitions\n",
+ "of Efficiency"
]
},
{
@@ -21,25 +23,32 @@
"level": 2,
"metadata": {},
"source": [
- "Ex1-pg54"
+ "Ex1-pg39"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
- "## Example 2.1\n",
"import math\n",
- "#determine atoms in deuterium\n",
- "## Given data\n",
- "atom_h = 6.6*10**24; ## Number of atoms in Hydrogen\n",
- "## Using the data given in Table II.2, Appendix II for isotropic abundance of deuterium\n",
- "isoab_H2 = 0.015; ## Isotropic abundance of deuterium\n",
- "## Calculation\n",
- "totatom_d=(isoab_H2*atom_h)/100.;\n",
- "## Result\n",
- "print\"%s %.2e %s \"%('\\n Number of deuterium atoms = ',totatom_d,'');\n",
- "\n"
+ "#calculate the polyefficency and overall total to total efficiency\n",
+ "\n",
+ "##given data\n",
+ "gamma = 1.4;\n",
+ "pi = 8.;##pressure ratio\n",
+ "T01 = 300.;##inlet temperature in K\n",
+ "T02 = 586.4;##outlet temperature in K\n",
+ "\n",
+ "##Calculations\n",
+ "##Calculation of Overall Total to Total efficiency\n",
+ "Tot_eff = ((pi**((gamma-1.)/gamma))-1.)/((T02/T01)-1.);\n",
+ "\n",
+ "##Calculation of polytropic efficiency\n",
+ "Poly_eff = ((gamma-1.)/gamma)*((math.log(pi))/math.log(T02/T01));\n",
+ "\n",
+ "##Results\n",
+ "print'%s %.2f %s'%('The Overall total-to-total efficiency is ',Tot_eff,'');\n",
+ "print'%s %.2f %s'%('The polytropic efficiency is ',Poly_eff,'');\n"
],
"language": "python",
"metadata": {},
@@ -48,41 +57,42 @@
"output_type": "stream",
"stream": "stdout",
"text": [
- "\n",
- " Number of deuterium atoms = 9.90e+20 \n"
+ "The Overall total-to-total efficiency is 0.85 \n",
+ "The polytropic efficiency is 0.89 \n"
]
}
],
- "prompt_number": 5
+ "prompt_number": 1
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
- "Ex2-pg54"
+ "Ex2-pg44"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
- "## Example 2.2\n",
"import math\n",
- "#determine atomic weight of oxygen\n",
- "## Given data \n",
- "## Using the data given in the example 2.2\n",
- "atwt_O16 = 15.99492; ## Atomic weight of O-16 isotope\n",
- "isoab_O16 = 99.759; ## Abundance of O-16 isotope\n",
- "atwt_O17 = 16.99913; ## Atomic weight of O-17 isotope\n",
- "isoab_O17 = 0.037; ## Abundance of O-17 isotope\n",
- "atwt_O18 = 17.99916; ## Atomic weight of O-18 isotope\n",
- "isoab_O18 = 0.204; ## Abundance of O-18 isotope\n",
- "## Calculation\n",
- "atwt_O=(isoab_O16*atwt_O16 + isoab_O17*atwt_O17 + isoab_O18*atwt_O18)/100.;\n",
- "## Result\n",
- "print\"%s %.2f %s \"%('\\n Atomic Weight of Oxygen = ',atwt_O,'');\n",
- "\n"
+ "#calculate the\n",
+ "\n",
+ "##given data\n",
+ "T01 = 1200.;##Stagnation temperature at which gas enters in K\n",
+ "p01 = 4.;##Stagnation pressure at which gas enters in bar\n",
+ "c2 = 572.;##exit velocity in m/s\n",
+ "p2 = 2.36;##exit pressure in bar\n",
+ "Cp = 1.160*1000.;##in J/kgK\n",
+ "gamma = 1.33\n",
+ "\n",
+ "##calculations\n",
+ "T2 = T01 - 0.5*(c2**2)/Cp;##Calculation of exit temperature in K\n",
+ "Noz_eff = ((1.-(T2/T01))/(1.-(p2/p01)**((gamma-1.)/gamma)));##Nozzle efficiency\n",
+ "\n",
+ "##Results\n",
+ "print'%s %.2f %s'%('Nozzle efficiency is ',Noz_eff,'');\n"
],
"language": "python",
"metadata": {},
@@ -91,8 +101,7 @@
"output_type": "stream",
"stream": "stdout",
"text": [
- "\n",
- " Atomic Weight of Oxygen = 16.00 \n"
+ "Nozzle efficiency is 0.96 \n"
]
}
],
@@ -103,31 +112,31 @@
"level": 2,
"metadata": {},
"source": [
- "Ex3-pg55"
+ "Ex3-pg51"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
- "## Example 2.3\n",
"import math\n",
- "#determine rest mass energy of electron\n",
- "## Given data\n",
- "me = 9.1095*10**(-28); ## Mass of electron in grams\n",
- "c = 2.9979*10**10; ## Speed of light in vacuum in cm/sec\n",
- "## Calculation\n",
- "rest_mass = me*c**2;\n",
- "## Result\n",
- "print\"%s %.2e %s \"%('\\n Rest mass energy of electron = ',rest_mass,' ergs\\n');\n",
- "print('Expressing the result in joules')\n",
- "## 1 Joule = 10^(-7)ergs\n",
- "rest_mass_j = rest_mass*10**(-7);\n",
- "print\"%s %.2e %s \"%('\\n Rest mass energy of electron = ',rest_mass_j,' joules\\n');\n",
- "print('Expressing the result in MeV')\n",
- "## 1 MeV = 1.6022*10^(-13)joules\n",
- "rest_mass_mev = rest_mass_j/(1.6022*10**(-13));\n",
- "print\"%s %.2f %s \"%('\\n Rest mass energy of electron = ',rest_mass_mev,' MeV\\n');\n"
+ "#calculate the\n",
+ "\n",
+ "##given data\n",
+ "cp = 0.6;##coefficient of pressure\n",
+ "AR = 2.13;##Area ratio\n",
+ "N_R1 = 4.66;\n",
+ "\n",
+ "##calculations\n",
+ "cpi = 1. - (1./(AR**2));\n",
+ "Diff_eff = cp/cpi;##diffuser efficiency\n",
+ "theta = 2.*(180./math.pi)*math.atan((AR**0.5 - 1.)/(N_R1));##included cone angle\n",
+ "\n",
+ "##Results\n",
+ "print'%s %.2f %s'%('cpi = \\n',cpi,'');\n",
+ "print'%s %.2f %s'%('The included cone angle can be found = ',theta,' deg.');\n",
+ "\n",
+ "\n"
],
"language": "python",
"metadata": {},
@@ -136,21 +145,103 @@
"output_type": "stream",
"stream": "stdout",
"text": [
+ "cpi = \n",
+ " 0.78 \n",
+ "The included cone angle can be found = 11.26 deg.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg52"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate the\n",
+ "\n",
+ "##given data\n",
+ "AR = 1.8;##Area ratio\n",
+ "cp = 0.6;##coefficient of pressure\n",
+ "N_R1 = 7.85;\n",
+ "\n",
+ "##calculations\n",
+ "Theta = 2.*(180./math.pi)*math.atan((AR**0.5 - 1.)/(N_R1));##included cone angle\n",
+ "cpi = 1.-(1./(AR**2));\n",
+ "Diff_eff = cp/cpi;##diffuser efficeincy\n",
+ "\n",
+ "##Results\n",
+ "print'%s %.2f %s'%('The included cone angle can be found = ',Theta,' deg.\\n');\n",
+ "print'%s %.2f %s'%('cpi = \\n',cpi,'');\n",
+ "print'%s %.2f %s'%('Diffuser efficiency = ',Diff_eff,'');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The included cone angle can be found = 4.98 deg.\n",
"\n",
- " Rest mass energy of electron = 8.19e-07 ergs\n",
- " \n",
- "Expressing the result in joules\n",
- "\n",
- " Rest mass energy of electron = 8.19e-14 joules\n",
- " \n",
- "Expressing the result in MeV\n",
- "\n",
- " Rest mass energy of electron = 0.51 MeV\n",
- " \n"
+ "cpi = \n",
+ " 0.69 \n",
+ "Diffuser efficiency = 0.87 \n"
]
}
],
"prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg53"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate the\n",
+ "\n",
+ "##given data\n",
+ "AR = 2.0;##Area ratio\n",
+ "alpha1 = 1.059;\n",
+ "B1 = 0.109;\n",
+ "alpha2 = 1.543;\n",
+ "B2 = 0.364;\n",
+ "cp = 0.577;##coefficient of pressure\n",
+ "\n",
+ "##calculations\n",
+ "cp = (alpha1 - (alpha2/(AR**2))) - 0.09;\n",
+ "Diff_eff = cp/(1.-(1./(AR**2)));##Diffuser efficiency\n",
+ "\n",
+ "##Results\n",
+ "print'%s %.2f %s'%('The diffuser efficiency = ',Diff_eff,'');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The diffuser efficiency = 0.78 \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
}
],
"metadata": {}