├── Libraries ├── __init__.py ├── foo.txt ├── .DS_Store ├── __init__.pyc ├── Tables │ ├── air.numbers │ ├── Argon.numbers │ ├── water.numbers │ ├── Krypton.numbers │ ├── Air1atm.csv │ └── Water1atm.csv ├── thermodynamics.pyc ├── HT_external_convection.pyc ├── HT_internal_convection.pyc ├── HT_natural_convection.pyc ├── HT_thermal_resistance.pyc ├── HT_conduction_extended_surfaces.pyc ├── HT_natural_convection_enclosure.pyc ├── __pycache__ │ ├── __init__.cpython-310.pyc │ ├── __init__.cpython-35.pyc │ ├── __init__.cpython-36.pyc │ ├── __init__.cpython-38.pyc │ ├── __init__.cpython-39.pyc │ ├── thermodynamics.cpython-35.pyc │ ├── thermodynamics.cpython-36.pyc │ ├── thermodynamics.cpython-38.pyc │ ├── thermodynamics.cpython-39.pyc │ ├── thermodynamics.cpython-310.pyc │ ├── HT_external_convection.cpython-35.pyc │ ├── HT_external_convection.cpython-36.pyc │ ├── HT_external_convection.cpython-38.pyc │ ├── HT_external_convection.cpython-39.pyc │ ├── HT_internal_convection.cpython-35.pyc │ ├── HT_internal_convection.cpython-36.pyc │ ├── HT_internal_convection.cpython-38.pyc │ ├── HT_internal_convection.cpython-39.pyc │ ├── HT_natural_convection.cpython-310.pyc │ ├── HT_natural_convection.cpython-35.pyc │ ├── HT_natural_convection.cpython-36.pyc │ ├── HT_natural_convection.cpython-38.pyc │ ├── HT_natural_convection.cpython-39.pyc │ ├── HT_thermal_resistance.cpython-310.pyc │ ├── HT_thermal_resistance.cpython-35.pyc │ ├── HT_thermal_resistance.cpython-36.pyc │ ├── HT_thermal_resistance.cpython-38.pyc │ ├── HT_thermal_resistance.cpython-39.pyc │ ├── HT_external_convection.cpython-310.pyc │ ├── HT_conduction_extended_surfaces.cpython-35.pyc │ ├── HT_conduction_extended_surfaces.cpython-36.pyc │ └── HT_conduction_extended_surfaces.cpython-38.pyc ├── HT_external_convection_flat_plate.pyc ├── raw.githubusercontent.com │ └── yvesdubief │ │ └── UVM-ME144-Heat-Transfer │ │ └── master │ │ └── Libraries │ │ └── Tables │ │ ├── Air1atm.csv │ │ └── Water1atm.csv ├── HT_conduction_extended_surfaces.py ├── HT_thermal_resistance.py ├── thermodynamics.py ├── HT_internal_convection.py ├── HT_natural_convection.py └── HT_external_convection.py ├── .DS_Store ├── Climate.zip ├── Figures ├── BL.png ├── 2wallspipe.png └── HW1-ThermalCondAir.png ├── Libraries.zip ├── .ipynb_checkpoints ├── ME144-HW-04-11-checkpoint.ipynb ├── HTpy-HW3-solution-checkpoint.ipynb ├── HTpy-HW2-Final-checkpoint.ipynb ├── 02-ThermalCircuits-checkpoint.ipynb ├── HW- April-7-checkpoint.ipynb ├── ME144-HW1-checkpoint.ipynb ├── HT-banks_of_tubes-checkpoint.ipynb ├── HTpy-HW2-checkpoint.ipynb ├── HW-01-checkpoint.ipynb ├── HT-ablation-BL-checkpoint.ipynb └── HTpy-Lecture9-1DConduction-checkpoint.ipynb ├── Climate └── Burlington, VT 2021-01-01 to 2021-12-31.xlsx ├── raw.githubusercontent.com └── yvesdubief │ └── UVM-ME144-Heat-Transfer │ └── master │ └── Libraries │ └── Tables │ └── Air1atm.csv ├── ME144-HW-04-11.ipynb └── HW-01.ipynb /Libraries/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Libraries/foo.txt: -------------------------------------------------------------------------------- 1 | blah 2 | -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/.DS_Store -------------------------------------------------------------------------------- /Climate.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Climate.zip -------------------------------------------------------------------------------- /Figures/BL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Figures/BL.png -------------------------------------------------------------------------------- /Libraries.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries.zip -------------------------------------------------------------------------------- /Libraries/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/.DS_Store -------------------------------------------------------------------------------- /Figures/2wallspipe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Figures/2wallspipe.png -------------------------------------------------------------------------------- /Libraries/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/__init__.pyc -------------------------------------------------------------------------------- /Libraries/Tables/air.numbers: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/Tables/air.numbers -------------------------------------------------------------------------------- /Libraries/thermodynamics.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/thermodynamics.pyc -------------------------------------------------------------------------------- /Figures/HW1-ThermalCondAir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Figures/HW1-ThermalCondAir.png -------------------------------------------------------------------------------- /Libraries/Tables/Argon.numbers: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/Tables/Argon.numbers -------------------------------------------------------------------------------- /Libraries/Tables/water.numbers: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/Tables/water.numbers -------------------------------------------------------------------------------- /Libraries/Tables/Krypton.numbers: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/Tables/Krypton.numbers -------------------------------------------------------------------------------- /Libraries/HT_external_convection.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/HT_external_convection.pyc -------------------------------------------------------------------------------- /Libraries/HT_internal_convection.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/HT_internal_convection.pyc -------------------------------------------------------------------------------- /Libraries/HT_natural_convection.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/HT_natural_convection.pyc -------------------------------------------------------------------------------- /Libraries/HT_thermal_resistance.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/HT_thermal_resistance.pyc -------------------------------------------------------------------------------- /.ipynb_checkpoints/ME144-HW-04-11-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [], 3 | "metadata": {}, 4 | "nbformat": 4, 5 | "nbformat_minor": 4 6 | } 7 | -------------------------------------------------------------------------------- /.ipynb_checkpoints/HTpy-HW3-solution-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [], 3 | "metadata": {}, 4 | "nbformat": 4, 5 | "nbformat_minor": 4 6 | } 7 | -------------------------------------------------------------------------------- /Libraries/HT_conduction_extended_surfaces.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/HT_conduction_extended_surfaces.pyc -------------------------------------------------------------------------------- /Libraries/HT_natural_convection_enclosure.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/HT_natural_convection_enclosure.pyc -------------------------------------------------------------------------------- /Libraries/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /Libraries/__pycache__/__init__.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/__pycache__/__init__.cpython-35.pyc -------------------------------------------------------------------------------- /Libraries/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Libraries/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /Libraries/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /Libraries/HT_external_convection_flat_plate.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/HT_external_convection_flat_plate.pyc -------------------------------------------------------------------------------- /Libraries/__pycache__/thermodynamics.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/__pycache__/thermodynamics.cpython-35.pyc -------------------------------------------------------------------------------- /Libraries/__pycache__/thermodynamics.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/__pycache__/thermodynamics.cpython-36.pyc -------------------------------------------------------------------------------- /Libraries/__pycache__/thermodynamics.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/__pycache__/thermodynamics.cpython-38.pyc -------------------------------------------------------------------------------- /Libraries/__pycache__/thermodynamics.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/__pycache__/thermodynamics.cpython-39.pyc -------------------------------------------------------------------------------- /Climate/Burlington, VT 2021-01-01 to 2021-12-31.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Climate/Burlington, VT 2021-01-01 to 2021-12-31.xlsx -------------------------------------------------------------------------------- /Libraries/__pycache__/thermodynamics.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/__pycache__/thermodynamics.cpython-310.pyc -------------------------------------------------------------------------------- /Libraries/__pycache__/HT_external_convection.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/__pycache__/HT_external_convection.cpython-35.pyc -------------------------------------------------------------------------------- /Libraries/__pycache__/HT_external_convection.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/__pycache__/HT_external_convection.cpython-36.pyc -------------------------------------------------------------------------------- /Libraries/__pycache__/HT_external_convection.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/__pycache__/HT_external_convection.cpython-38.pyc -------------------------------------------------------------------------------- /Libraries/__pycache__/HT_external_convection.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/__pycache__/HT_external_convection.cpython-39.pyc -------------------------------------------------------------------------------- /Libraries/__pycache__/HT_internal_convection.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/__pycache__/HT_internal_convection.cpython-35.pyc -------------------------------------------------------------------------------- /Libraries/__pycache__/HT_internal_convection.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/__pycache__/HT_internal_convection.cpython-36.pyc -------------------------------------------------------------------------------- /Libraries/__pycache__/HT_internal_convection.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/__pycache__/HT_internal_convection.cpython-38.pyc -------------------------------------------------------------------------------- /Libraries/__pycache__/HT_internal_convection.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/__pycache__/HT_internal_convection.cpython-39.pyc -------------------------------------------------------------------------------- /Libraries/__pycache__/HT_natural_convection.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/__pycache__/HT_natural_convection.cpython-310.pyc -------------------------------------------------------------------------------- /Libraries/__pycache__/HT_natural_convection.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/__pycache__/HT_natural_convection.cpython-35.pyc -------------------------------------------------------------------------------- /Libraries/__pycache__/HT_natural_convection.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/__pycache__/HT_natural_convection.cpython-36.pyc -------------------------------------------------------------------------------- /Libraries/__pycache__/HT_natural_convection.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/__pycache__/HT_natural_convection.cpython-38.pyc -------------------------------------------------------------------------------- /Libraries/__pycache__/HT_natural_convection.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/__pycache__/HT_natural_convection.cpython-39.pyc -------------------------------------------------------------------------------- /Libraries/__pycache__/HT_thermal_resistance.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/__pycache__/HT_thermal_resistance.cpython-310.pyc -------------------------------------------------------------------------------- /Libraries/__pycache__/HT_thermal_resistance.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/__pycache__/HT_thermal_resistance.cpython-35.pyc -------------------------------------------------------------------------------- /Libraries/__pycache__/HT_thermal_resistance.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/__pycache__/HT_thermal_resistance.cpython-36.pyc -------------------------------------------------------------------------------- /Libraries/__pycache__/HT_thermal_resistance.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/__pycache__/HT_thermal_resistance.cpython-38.pyc -------------------------------------------------------------------------------- /Libraries/__pycache__/HT_thermal_resistance.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/__pycache__/HT_thermal_resistance.cpython-39.pyc -------------------------------------------------------------------------------- /Libraries/__pycache__/HT_external_convection.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/__pycache__/HT_external_convection.cpython-310.pyc -------------------------------------------------------------------------------- /Libraries/__pycache__/HT_conduction_extended_surfaces.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/__pycache__/HT_conduction_extended_surfaces.cpython-35.pyc -------------------------------------------------------------------------------- /Libraries/__pycache__/HT_conduction_extended_surfaces.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/__pycache__/HT_conduction_extended_surfaces.cpython-36.pyc -------------------------------------------------------------------------------- /Libraries/__pycache__/HT_conduction_extended_surfaces.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/HEAD/Libraries/__pycache__/HT_conduction_extended_surfaces.cpython-38.pyc -------------------------------------------------------------------------------- /Libraries/Tables/Air1atm.csv: -------------------------------------------------------------------------------- 1 | Temperature (C),density (kg/m^3),Cp (kJ/kg.K),k (W/m.K),nu (mm^2/s),beta (1/K),Pr 2 | -150.,2.793,1.026,0.0116,3.08,8.21,0.76 3 | -100.,1.980,1.009,0.0160,5.95,5.82,0.74 4 | -50.0,1.534,1.005,0.0204,9.55,4.51,0.725 5 | 0.000,1.293,1.005,0.0243,13.30,3.67,0.715 6 | 20.00,1.205,1.005,0.0257,15.11,3.43,0.713 7 | 40.00,1.127,1.005,0.0271,16.97,3.20,0.711 8 | 60.00,1.067,1.009,0.0285,18.90,3.00,0.709 9 | 80.00,1.000,1.009,0.0299,20.94,2.83,0.708 10 | 100.0,0.946,1.009,0.0314,23.06,2.68,0.703 11 | 120.0,0.898,1.013,0.0328,25.23,2.55,0.70 12 | 140.0,0.854,1.013,0.0343,27.55,2.43,0.695 13 | 160.0,0.815,1.017,0.0358,29.85,2.32,0.69 14 | 180.0,0.779,1.022,0.0372,32.29,2.21,0.69 15 | 200.0,0.746,1.026,0.0386,34.63,2.11,0.685 16 | 250.0,0.675,1.034,0.0421,41.17,1.91,0.68 17 | 300.0,0.616,1.047,0.0454,47.85,1.75,0.68 18 | 350.0,0.566,1.055,0.0485,55.05,1.61,0.68 19 | 400.0,0.524,1.068,0.0515,62.53,1.49,0.68 20 | -------------------------------------------------------------------------------- /raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/master/Libraries/Tables/Air1atm.csv: -------------------------------------------------------------------------------- 1 | Temperature (C),density (kg/m^3),Cp (kJ/kg.K),k (W/m.K),nu (mm^2/s),beta (1/K),Pr 2 | -150.,2.793,1.026,0.0116,3.08,8.21,0.76 3 | -100.,1.980,1.009,0.0160,5.95,5.82,0.74 4 | -50.0,1.534,1.005,0.0204,9.55,4.51,0.725 5 | 0.000,1.293,1.005,0.0243,13.30,3.67,0.715 6 | 20.00,1.205,1.005,0.0257,15.11,3.43,0.713 7 | 40.00,1.127,1.005,0.0271,16.97,3.20,0.711 8 | 60.00,1.067,1.009,0.0285,18.90,3.00,0.709 9 | 80.00,1.000,1.009,0.0299,20.94,2.83,0.708 10 | 100.0,0.946,1.009,0.0314,23.06,2.68,0.703 11 | 120.0,0.898,1.013,0.0328,25.23,2.55,0.70 12 | 140.0,0.854,1.013,0.0343,27.55,2.43,0.695 13 | 160.0,0.815,1.017,0.0358,29.85,2.32,0.69 14 | 180.0,0.779,1.022,0.0372,32.29,2.21,0.69 15 | 200.0,0.746,1.026,0.0386,34.63,2.11,0.685 16 | 250.0,0.675,1.034,0.0421,41.17,1.91,0.68 17 | 300.0,0.616,1.047,0.0454,47.85,1.75,0.68 18 | 350.0,0.566,1.055,0.0485,55.05,1.61,0.68 19 | 400.0,0.524,1.068,0.0515,62.53,1.49,0.68 20 | -------------------------------------------------------------------------------- /Libraries/raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/master/Libraries/Tables/Air1atm.csv: -------------------------------------------------------------------------------- 1 | Temperature (C),density (kg/m^3),Cp (kJ/kg.K),k (W/m.K),nu (mm^2/s),beta (1/K),Pr 2 | -150.,2.793,1.026,0.0116,3.08,8.21,0.76 3 | -100.,1.980,1.009,0.0160,5.95,5.82,0.74 4 | -50.0,1.534,1.005,0.0204,9.55,4.51,0.725 5 | 0.000,1.293,1.005,0.0243,13.30,3.67,0.715 6 | 20.00,1.205,1.005,0.0257,15.11,3.43,0.713 7 | 40.00,1.127,1.005,0.0271,16.97,3.20,0.711 8 | 60.00,1.067,1.009,0.0285,18.90,3.00,0.709 9 | 80.00,1.000,1.009,0.0299,20.94,2.83,0.708 10 | 100.0,0.946,1.009,0.0314,23.06,2.68,0.703 11 | 120.0,0.898,1.013,0.0328,25.23,2.55,0.70 12 | 140.0,0.854,1.013,0.0343,27.55,2.43,0.695 13 | 160.0,0.815,1.017,0.0358,29.85,2.32,0.69 14 | 180.0,0.779,1.022,0.0372,32.29,2.21,0.69 15 | 200.0,0.746,1.026,0.0386,34.63,2.11,0.685 16 | 250.0,0.675,1.034,0.0421,41.17,1.91,0.68 17 | 300.0,0.616,1.047,0.0454,47.85,1.75,0.68 18 | 350.0,0.566,1.055,0.0485,55.05,1.61,0.68 19 | 400.0,0.524,1.068,0.0515,62.53,1.49,0.68 20 | -------------------------------------------------------------------------------- /.ipynb_checkpoints/HTpy-HW2-Final-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# HW2\n", 8 | "\n", 9 | "\n", 10 | "Before submitting your **HTpy-HW2.ipynb** file, perform the following\n", 11 | "* `Kernel>Restart & Run All`\n", 12 | "* Make sure that there are no errors\n", 13 | "\n", 14 | "The following includes problems that need coding and others that only need to perform simple operations (python as a calculator)." 15 | ] 16 | }, 17 | { 18 | "cell_type": "code", 19 | "execution_count": 1, 20 | "metadata": {}, 21 | "outputs": [], 22 | "source": [ 23 | "from Libraries import thermodynamics as thermo\n", 24 | "import numpy as np\n", 25 | "import matplotlib.pyplot as plt\n", 26 | "import scipy.constants as csts" 27 | ] 28 | }, 29 | { 30 | "cell_type": "markdown", 31 | "metadata": {}, 32 | "source": [ 33 | "## 1 Insulation\n", 34 | "\n", 35 | "This problem is an expansion of PB 3 in `HTpy-HW2.ipynb`\n", 36 | "\n", 37 | "Assuming that the outer surface temperature of the pipe is $150^\\circ C$, find an insulation that works (i.e. an insulation that will not melt, for which you can find the price and thermal conductivity online). Derive the necessary equations that allow for determination of the different costs as a function of the thickness. Generate a plot for at least 3 different thicknesses.\n", 38 | "\n", 39 | "Hint: Derive the heat loss for a variable thickness of insulation, then apply this formula for a range of thicknesses. Compare savings of gas vs cost of insulation." 40 | ] 41 | }, 42 | { 43 | "cell_type": "markdown", 44 | "metadata": {}, 45 | "source": [ 46 | "### Solution\n", 47 | "Assumptions:\n", 48 | "" 51 | ] 52 | }, 53 | { 54 | "cell_type": "code", 55 | "execution_count": null, 56 | "metadata": {}, 57 | "outputs": [], 58 | "source": [] 59 | }, 60 | { 61 | "cell_type": "markdown", 62 | "metadata": {}, 63 | "source": [ 64 | "## 2 Window\n", 65 | "\n", 66 | "Set up equations and apply realistic numerical values to them to discuss heat losses of a single pane window, a single pane window with storm window and a double paned window with air trapped at a vacuum of $10^{-3} \\mathrm{torr}$ ina gap of $5\\mathrm{mm}$. Do not consider the effects of radiation for any of the window.\n", 67 | "\n", 68 | "\"my" 69 | ] 70 | }, 71 | { 72 | "cell_type": "markdown", 73 | "metadata": {}, 74 | "source": [ 75 | "### Solution\n", 76 | "Assumptions:\n", 77 | "" 80 | ] 81 | }, 82 | { 83 | "cell_type": "code", 84 | "execution_count": null, 85 | "metadata": {}, 86 | "outputs": [], 87 | "source": [] 88 | }, 89 | { 90 | "cell_type": "code", 91 | "execution_count": null, 92 | "metadata": {}, 93 | "outputs": [], 94 | "source": [] 95 | } 96 | ], 97 | "metadata": { 98 | "kernelspec": { 99 | "display_name": "Python 3", 100 | "language": "python", 101 | "name": "python3" 102 | }, 103 | "language_info": { 104 | "codemirror_mode": { 105 | "name": "ipython", 106 | "version": 3 107 | }, 108 | "file_extension": ".py", 109 | "mimetype": "text/x-python", 110 | "name": "python", 111 | "nbconvert_exporter": "python", 112 | "pygments_lexer": "ipython3", 113 | "version": "3.8.5" 114 | } 115 | }, 116 | "nbformat": 4, 117 | "nbformat_minor": 4 118 | } 119 | -------------------------------------------------------------------------------- /Libraries/HT_conduction_extended_surfaces.py: -------------------------------------------------------------------------------- 1 | """Object: ExtSurfaces""" 2 | from sympy.interactive import printing 3 | printing.init_printing(use_latex='mathjax') 4 | 5 | 6 | from IPython.display import display,Image, Latex 7 | import numpy as np 8 | import math 9 | import scipy.constants as sc 10 | 11 | import sympy as sym 12 | #from sympy import * 13 | 14 | class ExtSurfaces(object): 15 | """ Defines temperature distribution, heat rate for constant cross sectional area fins. 16 | from Libraries import HT_conduction_extended_surfaces as condext 17 | 18 | fin = condext.ExtSurfaces(T_b,T_infty,T_L,k,h,P,Ac,L) 19 | calculates fin.m, fin.M which are constants used in flux calculation. Also provides 20 | fin.theta_b,.theta_L,.T_b,.T_infty,.T_L,.h,.k,.h,.P,.Ac,.L,.Af(fin exposed surface area) 21 | fin.heat_rate(bc) calculate the heat rate for bc="convection", "adiabatic", "isothermal", "infinite" 22 | The ouptuts are fin.q_f, fin.effectiveness, fin.resistance, fin.efficiency 23 | fin.temperature(bc,x) calculates the temperature as a function of bc and the location x 24 | The output is fin.theta_over_theta_b 25 | fin.equations(T_b_name,T_infty_name,T_L_name,k_name,h_name,P_name,Ac_name,L_name) writes all the equations for you 26 | you need to run fin.heat_rate first. 27 | """ 28 | def __init__(self,T_b,T_infty,T_L,k,h,P,Ac,L): 29 | self.T_b = T_b 30 | self.T_infty = T_infty 31 | self.T_L = T_L 32 | theta_b = T_b-T_infty 33 | theta_L = T_L-T_infty 34 | self.theta_b = T_b-T_infty 35 | self.theta_L = T_L-T_infty 36 | self.k = k 37 | self.h = h 38 | self.P = P 39 | self.Ac = Ac 40 | self.L = L 41 | self.Af = self.P*self.L 42 | m = np.sqrt(self.h*self.P/(self.k*self.Ac)) 43 | self.m = m 44 | M = np.sqrt(self.h*self.P*self.k*self.Ac)*self.theta_b 45 | self.M = M 46 | def heat_rate(self,bc): 47 | self.bc = bc 48 | it_works = True 49 | if self.bc == "convection": 50 | self.q_f = self.M*(np.sinh(self.m*self.L) + (self.h/(self.m*self.k))*np.cosh(self.m*self.L))/\ 51 | (np.cosh(self.m*self.L) + (self.h/(self.m*self.k))*np.sinh(self.m*self.L)) 52 | elif self.bc == "adiabatic": 53 | self.q_f = self.M*np.tanh(self.m*self.L) 54 | elif self.bc == "isothermal": 55 | self.q_f = self.M*np.cosh(self.m*self.L - self.theta_L/self.theta_b)/np.sinh(self.m*self.L) 56 | elif self.bc == 'infinite': 57 | self.q_f = self.M 58 | else: 59 | print("boundary condition is not properly defined") 60 | it_works = False 61 | if it_works: 62 | self.effectiveness = self.q_f/(self.h*self.Ac*self.theta_b) 63 | self.Resistance = self.theta_b/self.q_f 64 | self.efficiency = self.q_f/(self.h*self.Af*self.theta_b) 65 | 66 | 67 | def temperature(self,bc,x): 68 | self.bc = bc 69 | if self.bc == "convection": 70 | self.theta_over_theta_b = (np.cosh(self.m*(self.L-x)) + (self.h/(self.m*self.k))*np.sinh(self.m*(self.L-x)))/\ 71 | (np.cosh(self.m*self.L) + (self.h/(self.m*self.k))*np.sinh(self.m*self.L)) 72 | elif self.bc == "adiabatic": 73 | self.theta_over_theta_b = np.cosh(self.m*(self.L-x))/np.cosh(self.m*self.L) 74 | elif self.bc == "isothermal": 75 | self.theta_over_theta_b = ((self.theta_L/self.theta_b)*np.sinh(self.m*self.L)+np.sinh(self.m*self.L - x))\ 76 | /np.sinh(self.m*self.L) 77 | elif self.bc == 'infinite': 78 | self.theta_over_theta_b = np.exp(-self.m*x) 79 | else: 80 | print("boundary condition is not properly defined") 81 | self.T_x = self.T_infty + self.theta_over_theta_b*self.theta_b 82 | 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /.ipynb_checkpoints/02-ThermalCircuits-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "import schemdraw as schem\n", 10 | "import schemdraw.elements as e\n", 11 | "\n", 12 | "import matplotlib.pyplot as plt\n", 13 | "import numpy as np\n", 14 | "import math\n", 15 | "import scipy.constants as sc\n", 16 | "from Libraries import HT_thermal_resistance as res\n", 17 | "\n", 18 | "R = []\n", 19 | "\n", 20 | "R.append(res.Resistance(name=\"$R_{conv,i}$\", units=\"W/m\"))\n", 21 | "R.append(res.Resistance(name=\"$R_{cond}$\", units=\"W/m\"))\n", 22 | "R.append(res.Resistance(name=\"$R_{conv,o}$\", units=\"W/m\"))\n", 23 | "R.append(res.Resistance(name=\"$R_{rad}$\", units=\"W/m\"))" 24 | ] 25 | }, 26 | { 27 | "cell_type": "code", 28 | "execution_count": null, 29 | "metadata": {}, 30 | "outputs": [], 31 | "source": [ 32 | "d = schem.Drawing()\n", 33 | "d.add(e.DOT, label = r\"$T_m$\")\n", 34 | "d.add(e.RES, d = 'right', label = R[0].name)\n", 35 | "d.add(e.DOT, label = r\"$T_{s,i}$\")\n", 36 | "R1 = d.add(e.RES, d = 'right', label = R[1].name)\n", 37 | "d.add(e.DOT, label = r\"$T_{s,o}$\")\n", 38 | "d.add(e.RES, d='right', label = R[2].name)\n", 39 | "d.add(e.DOT, label=\"$T_\\infty$\")\n", 40 | "L1 = d.add(e.ARROW, toplabel = \"$q'$\", endpts = [[-2.25, 0], [-0.25, 0]])\n", 41 | "# d += e.CurrentLabel().at(R1)\n", 42 | "d.draw()" 43 | ] 44 | }, 45 | { 46 | "cell_type": "code", 47 | "execution_count": null, 48 | "metadata": {}, 49 | "outputs": [], 50 | "source": [ 51 | "d = schem.Drawing()\n", 52 | "d.add(e.DOT, label = r\"$T_m$\")\n", 53 | "d.add(e.RES, d = 'right', label = R[0].name)\n", 54 | "d.add(e.DOT, label = r\"$T_{s,i}$\")\n", 55 | "R1 = d.add(e.RES, d = 'right', label = R[1].name)\n", 56 | "d.add(e.DOT, rgtlabel = r\"$T_{s,o}$\")\n", 57 | "d.push()\n", 58 | "d.add(e.LINE, d= 'up', l = 1.5)\n", 59 | "d.add(e.RES, d='right', label = R[2].name)\n", 60 | "d.add(e.LINE, d='down', l = 1.5)\n", 61 | "d.pop()\n", 62 | "d.add(e.LINE, d='down', l = 1.5)\n", 63 | "d.add(e.RES, d='right', botlabel = R[3].name)\n", 64 | "d.add(e.LINE, d= 'up', l = 1.5)\n", 65 | "d.add(e.LINE,d='right',l=1.5)\n", 66 | "d.add(e.DOT, botlabel=\"$T_\\infty$\")\n", 67 | "\n", 68 | "L1 = d.add(e.ARROW, toplabel = \"$q'$\", endpts = [[-2.25, 0], [-0.25, 0]])\n", 69 | "\n", 70 | "d.draw()" 71 | ] 72 | }, 73 | { 74 | "cell_type": "markdown", 75 | "metadata": {}, 76 | "source": [ 77 | "$$\n", 78 | "R_{eq,atm}= \\left(\\frac{1}{R_{rad}}+\\frac{1}{R_{conv,o}}\\right)^{-1}\n", 79 | "$$" 80 | ] 81 | }, 82 | { 83 | "cell_type": "code", 84 | "execution_count": null, 85 | "metadata": {}, 86 | "outputs": [], 87 | "source": [ 88 | "d = schem.Drawing()\n", 89 | "d.add(e.DOT, label = r\"$T_m$\")\n", 90 | "d.add(e.RES, d = 'right', label = R[0].name)\n", 91 | "d.add(e.DOT, label = r\"$T_{s,i}$\")\n", 92 | "R1 = d.add(e.RES, d = 'right', label = R[1].name)\n", 93 | "d.add(e.DOT, label = r\"$T_{s,o}$\")\n", 94 | "d.add(e.RES, d='right', label = r\"$R_{eq,atm}$\")\n", 95 | "\n", 96 | "d.add(e.DOT, botlabel=\"$T_\\infty$\")\n", 97 | "\n", 98 | "L1 = d.add(e.ARROW, toplabel = \"$q'$\", endpts = [[-2.25, 0], [-0.25, 0]])\n", 99 | "\n", 100 | "d.draw()" 101 | ] 102 | }, 103 | { 104 | "cell_type": "code", 105 | "execution_count": null, 106 | "metadata": {}, 107 | "outputs": [], 108 | "source": [] 109 | } 110 | ], 111 | "metadata": { 112 | "kernelspec": { 113 | "display_name": "Python 3 (ipykernel)", 114 | "language": "python", 115 | "name": "python3" 116 | }, 117 | "language_info": { 118 | "codemirror_mode": { 119 | "name": "ipython", 120 | "version": 3 121 | }, 122 | "file_extension": ".py", 123 | "mimetype": "text/x-python", 124 | "name": "python", 125 | "nbconvert_exporter": "python", 126 | "pygments_lexer": "ipython3", 127 | "version": "3.10.9" 128 | } 129 | }, 130 | "nbformat": 4, 131 | "nbformat_minor": 2 132 | } 133 | -------------------------------------------------------------------------------- /Libraries/Tables/Water1atm.csv: -------------------------------------------------------------------------------- 1 | Temperature (K),Pressure (MPA),Density (kg/m^3),Cp (J/g.K),viscosity (Pa.s),Thermal conductivity (W/m.K) 2 | 274.00,0.10132,999.89,4.2166,0.0017398,0.56269 3 | 275.00,0.10132,999.94,4.2135,0.0016818,0.56459 4 | 276.00,0.10132,999.96,4.2106,0.0016269,0.56649 5 | 277.00,0.10132,999.97,4.2079,0.0015748,0.56839 6 | 278.00,0.10132,999.97,4.2054,0.0015253,0.57029 7 | 279.00,0.10132,999.95,4.2031,0.0014783,0.57219 8 | 280.00,0.10132,999.91,4.2009,0.0014335,0.57409 9 | 281.00,0.10132,999.86,4.1990,0.0013909,0.57598 10 | 282.00,0.10132,999.79,4.1971,0.0013503,0.57788 11 | 283.00,0.10132,999.72,4.1954,0.0013115,0.57976 12 | 284.00,0.10132,999.62,4.1938,0.0012745,0.58165 13 | 285.00,0.10132,999.52,4.1924,0.0012392,0.58352 14 | 286.00,0.10132,999.40,4.1910,0.0012054,0.58539 15 | 287.00,0.10132,999.27,4.1898,0.0011730,0.58725 16 | 288.00,0.10132,999.13,4.1886,0.0011421,0.58910 17 | 289.00,0.10132,998.97,4.1876,0.0011124,0.59094 18 | 290.00,0.10132,998.80,4.1866,0.0010840,0.59278 19 | 291.00,0.10132,998.63,4.1857,0.0010567,0.59459 20 | 292.00,0.10132,998.44,4.1849,0.0010305,0.59640 21 | 293.00,0.10132,998.24,4.1842,0.0010053,0.59819 22 | 294.00,0.10132,998.03,4.1835,0.00098110,0.59997 23 | 295.00,0.10132,997.81,4.1829,0.00095784,0.60174 24 | 296.00,0.10132,997.58,4.1823,0.00093545,0.60349 25 | 297.00,0.10132,997.34,4.1818,0.00091389,0.60522 26 | 298.00,0.10132,997.09,4.1814,0.00089313,0.60694 27 | 299.00,0.10132,996.83,4.1810,0.00087312,0.60864 28 | 300.00,0.10132,996.56,4.1806,0.00085383,0.61032 29 | 301.00,0.10132,996.28,4.1803,0.00083521,0.61199 30 | 302.00,0.10132,995.99,4.1801,0.00081724,0.61363 31 | 303.00,0.10132,995.69,4.1798,0.00079990,0.61526 32 | 304.00,0.10132,995.39,4.1797,0.00078314,0.61687 33 | 305.00,0.10132,995.08,4.1795,0.00076694,0.61846 34 | 306.00,0.10132,994.75,4.1794,0.00075128,0.62002 35 | 307.00,0.10132,994.42,4.1793,0.00073613,0.62157 36 | 308.00,0.10132,994.08,4.1793,0.00072147,0.62310 37 | 309.00,0.10132,993.74,4.1792,0.00070728,0.62460 38 | 310.00,0.10132,993.38,4.1792,0.00069354,0.62609 39 | 311.00,0.10132,993.02,4.1793,0.00068023,0.62755 40 | 312.00,0.10132,992.65,4.1793,0.00066733,0.62900 41 | 313.00,0.10132,992.27,4.1794,0.00065482,0.63042 42 | 314.00,0.10132,991.89,4.1795,0.00064269,0.63181 43 | 315.00,0.10132,991.50,4.1796,0.00063092,0.63319 44 | 316.00,0.10132,991.10,4.1798,0.00061950,0.63455 45 | 317.00,0.10132,990.69,4.1799,0.00060842,0.63588 46 | 318.00,0.10132,990.28,4.1801,0.00059765,0.63719 47 | 319.00,0.10132,989.85,4.1803,0.00058720,0.63848 48 | 320.00,0.10132,989.43,4.1805,0.00057704,0.63975 49 | 321.00,0.10132,988.99,4.1808,0.00056716,0.64099 50 | 322.00,0.10132,988.55,4.1810,0.00055756,0.64221 51 | 323.00,0.10132,988.10,4.1813,0.00054823,0.64342 52 | 324.00,0.10132,987.65,4.1816,0.00053914,0.64460 53 | 325.00,0.10132,987.19,4.1819,0.00053031,0.64575 54 | 326.00,0.10132,986.72,4.1822,0.00052171,0.64689 55 | 327.00,0.10132,986.25,4.1826,0.00051333,0.64800 56 | 328.00,0.10132,985.77,4.1829,0.00050518,0.64909 57 | 329.00,0.10132,985.28,4.1833,0.00049724,0.65017 58 | 330.00,0.10132,984.79,4.1837,0.00048950,0.65122 59 | 331.00,0.10132,984.29,4.1840,0.00048197,0.65224 60 | 332.00,0.10132,983.78,4.1845,0.00047462,0.65325 61 | 333.00,0.10132,983.27,4.1849,0.00046745,0.65424 62 | 334.00,0.10132,982.76,4.1853,0.00046047,0.65521 63 | 335.00,0.10132,982.23,4.1858,0.00045366,0.65615 64 | 336.00,0.10132,981.71,4.1863,0.00044701,0.65708 65 | 337.00,0.10132,981.17,4.1867,0.00044053,0.65798 66 | 338.00,0.10132,980.63,4.1872,0.00043420,0.65887 67 | 339.00,0.10132,980.09,4.1878,0.00042802,0.65974 68 | 340.00,0.10132,979.54,4.1883,0.00042199,0.66058 69 | 341.00,0.10132,978.98,4.1888,0.00041610,0.66141 70 | 342.00,0.10132,978.42,4.1894,0.00041034,0.66222 71 | 343.00,0.10132,977.85,4.1900,0.00040472,0.66301 72 | 344.00,0.10132,977.28,4.1906,0.00039923,0.66378 73 | 345.00,0.10132,976.70,4.1912,0.00039387,0.66453 74 | 346.00,0.10132,976.12,4.1918,0.00038862,0.66527 75 | 347.00,0.10132,975.53,4.1924,0.00038349,0.66599 76 | 348.00,0.10132,974.93,4.1931,0.00037848,0.66669 77 | 349.00,0.10132,974.33,4.1938,0.00037358,0.66737 78 | 350.00,0.10132,973.73,4.1945,0.00036878,0.66803 79 | 351.00,0.10132,973.12,4.1952,0.00036409,0.66868 80 | 352.00,0.10132,972.50,4.1959,0.00035950,0.66931 81 | 353.00,0.10132,971.88,4.1966,0.00035501,0.66992 82 | 354.00,0.10132,971.26,4.1974,0.00035062,0.67052 83 | 355.00,0.10132,970.63,4.1982,0.00034632,0.67110 84 | 356.00,0.10132,969.99,4.1990,0.00034210,0.67167 85 | 357.00,0.10132,969.35,4.1998,0.00033798,0.67222 86 | 358.00,0.10132,968.71,4.2006,0.00033394,0.67275 87 | 359.00,0.10132,968.06,4.2015,0.00032998,0.67327 88 | 360.00,0.10132,967.40,4.2023,0.00032611,0.67378 89 | 361.00,0.10132,966.74,4.2032,0.00032231,0.67427 90 | 362.00,0.10132,966.08,4.2041,0.00031859,0.67474 91 | 363.00,0.10132,965.41,4.2051,0.00031495,0.67520 92 | 364.00,0.10132,964.74,4.2060,0.00031138,0.67565 93 | 365.00,0.10132,964.06,4.2070,0.00030787,0.67608 94 | 366.00,0.10132,963.37,4.2080,0.00030444,0.67649 95 | 367.00,0.10132,962.69,4.2090,0.00030107,0.67690 96 | 368.00,0.10132,961.99,4.2100,0.00029777,0.67729 97 | 369.00,0.10132,961.29,4.2111,0.00029453,0.67767 98 | 370.00,0.10132,960.59,4.2121,0.00029136,0.67803 99 | 371.00,0.10132,959.88,4.2132,0.00028824,0.67838 100 | 372.00,0.10132,959.17,4.2144,0.00028519,0.67872 101 | 373.00,0.10132,958.46,4.2155,0.00028219,0.67904 102 | -------------------------------------------------------------------------------- /.ipynb_checkpoints/HW- April-7-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Problem 1\n", 8 | "\n", 9 | "This follows PB 1 of HT-ablation-bl\n", 10 | "\n", 11 | " The upstream water flow velocity is $1 \\mathrm{m/s}$ and its upstream temperature is $99^\\circ\\mathrm{C}$. Plot the evolution of the initial ablation velocity in $\\text{mm/s}$ and/or give its values for $x=0.01,0.1,0.2,0.5,1.0\\mathrm{m}$. Discuss which fluid is more likley to achieve the formation of the deepest erosion-driven roughness." 12 | ] 13 | }, 14 | { 15 | "cell_type": "markdown", 16 | "metadata": {}, 17 | "source": [ 18 | "# Problem 2\n", 19 | "\"my\n", 20 | "An air duct heater consists of an aligned array of electrical heating elements in which the longitudinal and transverse pitches are $S_L=S_T= 24\\text{ mm}$. There are 3 rows of elements in the flow direction ($N_L=3$) and 4 elements per row ($N_T=4$). Atmospheric air with an upstream velocity of $12\\text{ m/s}$ and a temperature of $25^\\circ\\text{C}$ moves in cross flow over the elements, which have a diameter of $12\\text{ mm}$, a length of $250\\text{ mm}$, and are maintained at a surface temperature of $350^\\circ\\text{C}$.\n", 21 | "
    \n", 22 | "
  1. \n", 23 | "Determine the total heat transfer to the air and the temperature of the air leaving the duct heater.\n", 24 | "
  2. \n", 25 | "
  3. \n", 26 | "Determine the pressure drop across the element bank and the fan power requirement.\n", 27 | "
  4. \n", 28 | "
  5. \n", 29 | "Compare the average convection coefficient obtained in your analysis with the value for an isolated (single) element. Explain the difference between the results.\n", 30 | "
  6. \n", 31 | "
  7. \n", 32 | "What effect would increasing the longitudinal and transverse pitches to 30 mm have on the exit temperature of the air, the total heat rate, and the pressure drop?\n", 33 | "
  8. \n", 34 | "
" 35 | ] 36 | }, 37 | { 38 | "cell_type": "code", 39 | "execution_count": null, 40 | "metadata": {}, 41 | "outputs": [], 42 | "source": [] 43 | }, 44 | { 45 | "cell_type": "markdown", 46 | "metadata": {}, 47 | "source": [ 48 | "# Problem 3\n", 49 | "An aluminum transmission line with a diameter of\n", 50 | "20 mm has an electrical resistance of $R'_\\text{elec}=2.636\\times10^{-4}\\Omega/\\text{m}$\n", 51 | "and carries a current of 700 A. The line is\n", 52 | "subjected to frequent and severe cross winds, increasing the probability of contact between adjacent lines,\n", 53 | "thereby causing sparks and creating a potential fire hazard for nearby vegetation. The remedy is to insulate the\n", 54 | "line, but with the adverse effect of increasing the conductor operating temperature.\n", 55 | "
    \n", 56 | "
  1. Calculate the conductor temperature when the air temperature is $20^\\circ\\text{C}$ and the cross flow wind velocity is $10\\text{m/s}$
  2. \n", 57 | "
  3. Calculate the conductor temperature for the same\n", 58 | "conditions, but with a $2\\text{mm}$-thick insulation having\n", 59 | "a thermal conductivity of $0.15\\text{W/(m.K)}$.
  4. \n", 60 | "
  5. Calculate and plot the temperatures of the bare and\n", 61 | "insulated conductors for wind velocities in the\n", 62 | "range from $2$ to $20\\text{m/s}$. Comment on features of\n", 63 | "the curves and the effect of the wind velocity on the\n", 64 | "conductor temperatures.
  6. \n", 65 | "
" 66 | ] 67 | }, 68 | { 69 | "cell_type": "markdown", 70 | "metadata": {}, 71 | "source": [ 72 | "# Problem 4\n", 73 | "\n", 74 | "\"my\"my\n", 75 | "The top surface of a heated compartment consists of very smooth (A) and highly roughened (B) portions, and the surface is placed in an atmospheric airstream. \n", 76 | "In the interest of minimizing total convection heat transfer from the surface, which orientation, (1) or (2),\n", 77 | "is preferred? If $T_s=100^\\circ\\text{C}$, $T_\\infty= 20^\\circ\\text{C}$, and $u_\\infty=20\\text{ m/s}$, what is the convection heat transfer from the entire surface for this orientation?\n", 78 | "\n", 79 | "Calculate the value of the average heat transfer coefficient when the entire plate is rotated $90^\\circ$ so that half of the leading edge consists of a very smooth portion (A) and the other half consists of a highly roughened portion (B)." 80 | ] 81 | }, 82 | { 83 | "cell_type": "code", 84 | "execution_count": null, 85 | "metadata": {}, 86 | "outputs": [], 87 | "source": [] 88 | } 89 | ], 90 | "metadata": { 91 | "kernelspec": { 92 | "display_name": "Python 3", 93 | "language": "python", 94 | "name": "python3" 95 | }, 96 | "language_info": { 97 | "codemirror_mode": { 98 | "name": "ipython", 99 | "version": 3 100 | }, 101 | "file_extension": ".py", 102 | "mimetype": "text/x-python", 103 | "name": "python", 104 | "nbconvert_exporter": "python", 105 | "pygments_lexer": "ipython3", 106 | "version": "3.8.5" 107 | } 108 | }, 109 | "nbformat": 4, 110 | "nbformat_minor": 4 111 | } 112 | -------------------------------------------------------------------------------- /Libraries/raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/master/Libraries/Tables/Water1atm.csv: -------------------------------------------------------------------------------- 1 | Temperature (K),Pressure (MPA),Density (kg/m^3),Cp (J/g.K),viscosity (Pa.s),Thermal conductivity (W/m.K) 2 | 274.00,0.10132,999.89,4.2166,0.0017398,0.56269 3 | 275.00,0.10132,999.94,4.2135,0.0016818,0.56459 4 | 276.00,0.10132,999.96,4.2106,0.0016269,0.56649 5 | 277.00,0.10132,999.97,4.2079,0.0015748,0.56839 6 | 278.00,0.10132,999.97,4.2054,0.0015253,0.57029 7 | 279.00,0.10132,999.95,4.2031,0.0014783,0.57219 8 | 280.00,0.10132,999.91,4.2009,0.0014335,0.57409 9 | 281.00,0.10132,999.86,4.1990,0.0013909,0.57598 10 | 282.00,0.10132,999.79,4.1971,0.0013503,0.57788 11 | 283.00,0.10132,999.72,4.1954,0.0013115,0.57976 12 | 284.00,0.10132,999.62,4.1938,0.0012745,0.58165 13 | 285.00,0.10132,999.52,4.1924,0.0012392,0.58352 14 | 286.00,0.10132,999.40,4.1910,0.0012054,0.58539 15 | 287.00,0.10132,999.27,4.1898,0.0011730,0.58725 16 | 288.00,0.10132,999.13,4.1886,0.0011421,0.58910 17 | 289.00,0.10132,998.97,4.1876,0.0011124,0.59094 18 | 290.00,0.10132,998.80,4.1866,0.0010840,0.59278 19 | 291.00,0.10132,998.63,4.1857,0.0010567,0.59459 20 | 292.00,0.10132,998.44,4.1849,0.0010305,0.59640 21 | 293.00,0.10132,998.24,4.1842,0.0010053,0.59819 22 | 294.00,0.10132,998.03,4.1835,0.00098110,0.59997 23 | 295.00,0.10132,997.81,4.1829,0.00095784,0.60174 24 | 296.00,0.10132,997.58,4.1823,0.00093545,0.60349 25 | 297.00,0.10132,997.34,4.1818,0.00091389,0.60522 26 | 298.00,0.10132,997.09,4.1814,0.00089313,0.60694 27 | 299.00,0.10132,996.83,4.1810,0.00087312,0.60864 28 | 300.00,0.10132,996.56,4.1806,0.00085383,0.61032 29 | 301.00,0.10132,996.28,4.1803,0.00083521,0.61199 30 | 302.00,0.10132,995.99,4.1801,0.00081724,0.61363 31 | 303.00,0.10132,995.69,4.1798,0.00079990,0.61526 32 | 304.00,0.10132,995.39,4.1797,0.00078314,0.61687 33 | 305.00,0.10132,995.08,4.1795,0.00076694,0.61846 34 | 306.00,0.10132,994.75,4.1794,0.00075128,0.62002 35 | 307.00,0.10132,994.42,4.1793,0.00073613,0.62157 36 | 308.00,0.10132,994.08,4.1793,0.00072147,0.62310 37 | 309.00,0.10132,993.74,4.1792,0.00070728,0.62460 38 | 310.00,0.10132,993.38,4.1792,0.00069354,0.62609 39 | 311.00,0.10132,993.02,4.1793,0.00068023,0.62755 40 | 312.00,0.10132,992.65,4.1793,0.00066733,0.62900 41 | 313.00,0.10132,992.27,4.1794,0.00065482,0.63042 42 | 314.00,0.10132,991.89,4.1795,0.00064269,0.63181 43 | 315.00,0.10132,991.50,4.1796,0.00063092,0.63319 44 | 316.00,0.10132,991.10,4.1798,0.00061950,0.63455 45 | 317.00,0.10132,990.69,4.1799,0.00060842,0.63588 46 | 318.00,0.10132,990.28,4.1801,0.00059765,0.63719 47 | 319.00,0.10132,989.85,4.1803,0.00058720,0.63848 48 | 320.00,0.10132,989.43,4.1805,0.00057704,0.63975 49 | 321.00,0.10132,988.99,4.1808,0.00056716,0.64099 50 | 322.00,0.10132,988.55,4.1810,0.00055756,0.64221 51 | 323.00,0.10132,988.10,4.1813,0.00054823,0.64342 52 | 324.00,0.10132,987.65,4.1816,0.00053914,0.64460 53 | 325.00,0.10132,987.19,4.1819,0.00053031,0.64575 54 | 326.00,0.10132,986.72,4.1822,0.00052171,0.64689 55 | 327.00,0.10132,986.25,4.1826,0.00051333,0.64800 56 | 328.00,0.10132,985.77,4.1829,0.00050518,0.64909 57 | 329.00,0.10132,985.28,4.1833,0.00049724,0.65017 58 | 330.00,0.10132,984.79,4.1837,0.00048950,0.65122 59 | 331.00,0.10132,984.29,4.1840,0.00048197,0.65224 60 | 332.00,0.10132,983.78,4.1845,0.00047462,0.65325 61 | 333.00,0.10132,983.27,4.1849,0.00046745,0.65424 62 | 334.00,0.10132,982.76,4.1853,0.00046047,0.65521 63 | 335.00,0.10132,982.23,4.1858,0.00045366,0.65615 64 | 336.00,0.10132,981.71,4.1863,0.00044701,0.65708 65 | 337.00,0.10132,981.17,4.1867,0.00044053,0.65798 66 | 338.00,0.10132,980.63,4.1872,0.00043420,0.65887 67 | 339.00,0.10132,980.09,4.1878,0.00042802,0.65974 68 | 340.00,0.10132,979.54,4.1883,0.00042199,0.66058 69 | 341.00,0.10132,978.98,4.1888,0.00041610,0.66141 70 | 342.00,0.10132,978.42,4.1894,0.00041034,0.66222 71 | 343.00,0.10132,977.85,4.1900,0.00040472,0.66301 72 | 344.00,0.10132,977.28,4.1906,0.00039923,0.66378 73 | 345.00,0.10132,976.70,4.1912,0.00039387,0.66453 74 | 346.00,0.10132,976.12,4.1918,0.00038862,0.66527 75 | 347.00,0.10132,975.53,4.1924,0.00038349,0.66599 76 | 348.00,0.10132,974.93,4.1931,0.00037848,0.66669 77 | 349.00,0.10132,974.33,4.1938,0.00037358,0.66737 78 | 350.00,0.10132,973.73,4.1945,0.00036878,0.66803 79 | 351.00,0.10132,973.12,4.1952,0.00036409,0.66868 80 | 352.00,0.10132,972.50,4.1959,0.00035950,0.66931 81 | 353.00,0.10132,971.88,4.1966,0.00035501,0.66992 82 | 354.00,0.10132,971.26,4.1974,0.00035062,0.67052 83 | 355.00,0.10132,970.63,4.1982,0.00034632,0.67110 84 | 356.00,0.10132,969.99,4.1990,0.00034210,0.67167 85 | 357.00,0.10132,969.35,4.1998,0.00033798,0.67222 86 | 358.00,0.10132,968.71,4.2006,0.00033394,0.67275 87 | 359.00,0.10132,968.06,4.2015,0.00032998,0.67327 88 | 360.00,0.10132,967.40,4.2023,0.00032611,0.67378 89 | 361.00,0.10132,966.74,4.2032,0.00032231,0.67427 90 | 362.00,0.10132,966.08,4.2041,0.00031859,0.67474 91 | 363.00,0.10132,965.41,4.2051,0.00031495,0.67520 92 | 364.00,0.10132,964.74,4.2060,0.00031138,0.67565 93 | 365.00,0.10132,964.06,4.2070,0.00030787,0.67608 94 | 366.00,0.10132,963.37,4.2080,0.00030444,0.67649 95 | 367.00,0.10132,962.69,4.2090,0.00030107,0.67690 96 | 368.00,0.10132,961.99,4.2100,0.00029777,0.67729 97 | 369.00,0.10132,961.29,4.2111,0.00029453,0.67767 98 | 370.00,0.10132,960.59,4.2121,0.00029136,0.67803 99 | 371.00,0.10132,959.88,4.2132,0.00028824,0.67838 100 | 372.00,0.10132,959.17,4.2144,0.00028519,0.67872 101 | 373.00,0.10132,958.46,4.2155,0.00028219,0.67904 102 | -------------------------------------------------------------------------------- /Libraries/HT_thermal_resistance.py: -------------------------------------------------------------------------------- 1 | """Object name: Resistance 2 | Function name: serial_sum(R,nori,nend), performs serial sum of a resistance object list from nori to nend 3 | Function name: parallel_sum(R,nori,nend), performs parallel sum of a resistance object list from nori to nend 4 | """ 5 | ### definition of thermal resistance ### 6 | from sympy.interactive import printing 7 | printing.init_printing(use_latex='mathjax') 8 | 9 | 10 | from IPython.display import display,Image, Latex 11 | import numpy as np 12 | import math 13 | import scipy.constants as sc 14 | 15 | import sympy as sym 16 | #from sympy import * 17 | 18 | class Resistance(object): 19 | """ Defines thermal resistances for conduction, convection and radiation heat transfer. 20 | First define the object attached with class with the name used in the thermal circuit 21 | and the units, which can only be 'W', 'W/m' or 'W/m^2' 22 | Second use self.conduction, self.convection or self.radiation to calculate your 23 | resistance. Each mode requires different arguments: 24 | 25 | from Libraries import HT_thermal_resistance as res 26 | R = [] 27 | R.append(res.Resistance("$label$", "units")) where units = 'W', 'W/m' or 'W/m^2' 28 | 29 | then 30 | 31 | For conduction, there are 3 options: 32 | 33 | - R.cond_plane(k, L, A = 1.0) for planar conduction: k is the thermal conductivity, 34 | L is the thickness of the wall, and A is the optional surface area (=1 by default) 35 | - R.cond_cylinder(k , ra, rb, L = 1.0, angle = 2.*math.pi) for conduction in a 36 | cylindrical shell between the radii ra (internal) and rb (external). L is the length 37 | of the shell (optional, default = 1) and angle is angular dimension of shell, also 38 | optional and set to a full revolution by default (2 pi) 39 | - R.cond_sphere(k, ra, rb, scale = 1.0) for conductuion within a spherical shell bounded by radii ra and rb 40 | ra < rb. The optional parameter scale allows to calculate the thermal resistance for a fraction 41 | of a spherical shell. For instance a cornea is about 1/3 of spherical shell, so scale = 1./3. 42 | 43 | Convection: 44 | - R.convection(h, A = 1.0), where h is the convection coefficient (W/m^2K) and A is 45 | the surface area (optional, default is unit surface aera 1 m^2) 46 | 47 | Radiation: 48 | - R.radiation(eps, T_s, T_sur, A = 1.0), where eps is the permissivity of the material, T_s 49 | the surface temperature, T_sur the far away surface temperature, A the surface area (optional, 50 | by default A is the unit surface area 1 m^2). 51 | 52 | Contact: 53 | 54 | - R.contact(R,A,R_name= "R_{t}",A_name = "A",T_a_name = "T_a",Tb_name = "T_b"), where R is the contact resistance, typically obtained from a table 55 | A is the surface area 56 | The minimum number of arguments are: 57 | R.contact(R,A) 58 | 59 | R.display_equation(index) displays the heat flux/rate equations for a given resistance. index is the number of 60 | your resistance (you specify) 61 | 62 | Outputs: 63 | - R[i].R the resistance of element i, R[i].h the convection or radiation coefficient. 64 | 65 | Functions include 66 | R_tot = res.serial_sum(R,first_resistance,last_resistance) sums serial resistance 67 | R_tot = res.parallel_sum(R,first_resistance,last_resistance) sums parallel resistance 68 | 69 | 70 | 71 | """ 72 | def __init__(self,name,units): 73 | self.name = name 74 | self.units = units 75 | def cond_plane(self, k, L, A = 1.0): 76 | self.mode = "conduction" 77 | self.geometry = "planar" 78 | self.k = k 79 | if k <= 0.: 80 | print("problem with the definition of thermal conductivity") 81 | self.L = L 82 | self.A = A 83 | self.R = self.L / (self.k * self.A) 84 | def cond_cylinder(self, k , ra, rb, L = 1.0, angle = 2.*math.pi): 85 | self.mode = "conduction" 86 | self.geometry = "cylindrical" 87 | self.k = k 88 | if k <= 0.: 89 | print("problem with the definition of thermal conductivity") 90 | self.ra = ra 91 | self.rb = rb 92 | if ra*rb <= 0.: 93 | print("problem with the definition of radii") 94 | self.L = L 95 | self.angle = angle 96 | self.R = np.log(rb/ra)/(angle*L*k) 97 | def cond_sphere(self, k, ra, rb, scale = 1.0): 98 | self.mode = "conduction" 99 | self.geometry = "spherical" 100 | self.k = k 101 | if k <= 0.: 102 | print("problem with the definition of thermal conductivity") 103 | self.ra = ra 104 | self.rb = rb 105 | if ra*rb <= 0.: 106 | print("problem with the definition of radii") 107 | self.R = (1./r_a-1./r_b)/(scale*4.*math.pi*k) 108 | def convection(self, h, A = 1.0): 109 | self.mode = 'convection' 110 | self.geometry = "whatever" 111 | self.R = 1./(h*A) 112 | self.A = A 113 | self.h = h 114 | def radiation(self,eps,T_s,T_sur, A = 1.0): 115 | self.R = 1./(eps*sc.sigma*(T_s+T_sur)*(T_s**2+T_sur**2)*A) 116 | self.mode = 'radiation' 117 | self.geometry = "whatever" 118 | self.A = A 119 | self.h = eps*sc.sigma*(T_s+T_sur)*(T_s**2+T_sur**2) 120 | def contact(self, R, A=1.0): 121 | self.R = R/A 122 | self.geometry = 'whatever' 123 | self.mode = 'contact' 124 | 125 | 126 | 127 | ### summation of thermal resistance (R is a vector) ### 128 | def serial_sum(R,nori,nend): 129 | sum = 0. 130 | for i in range(nori,nend+1): 131 | sum += R[i].R 132 | return sum 133 | 134 | def parallel_sum(R,nori,nend): 135 | sum = 0. 136 | for i in range(nori,nend+1): 137 | sum += 1./R[i].R 138 | return 1./sum 139 | 140 | 141 | -------------------------------------------------------------------------------- /Libraries/thermodynamics.py: -------------------------------------------------------------------------------- 1 | """ Object name: Fluid""" 2 | import sys 3 | sys.path.insert(0, 'Tables/') 4 | import numpy as np 5 | import scipy 6 | import scipy.optimize 7 | from scipy.constants import convert_temperature 8 | def C2K(T): 9 | return convert_temperature(T,'Celsius','Kelvin') 10 | def C2F(T): 11 | return convert_temperature(T,'Celsius','Fahrenheit') 12 | def F2K(T): 13 | return convert_temperature(T,'Fahrenheit','Kelvin') 14 | def F2C(T): 15 | return convert_temperature(T,'Fahrenheit','Celsius') 16 | def K2F(T): 17 | return convert_temperature(T,'Kelvin','Fahrenheit') 18 | def K2C(T): 19 | return convert_temperature(T,'Kelvin','Celsius') 20 | import scipy.constants as sc 21 | 22 | def interpolate_table(target,index,xquantity,yquantity): 23 | return yquantity[index] + \ 24 | (yquantity[index+1]-yquantity[index])* \ 25 | (target-xquantity[index])/(xquantity[index+1]-xquantity[index]) 26 | 27 | class Fluid(object): 28 | """ How to: 29 | from NewLibraries import thermodynamics as thermo 30 | 31 | fluid_of_interest = thermo.Fluid(material,T) material can be air, water, argon and krypton (see below for ranges) 32 | and the temperature of the fluid T is in Kelvin. 33 | Outputs: 34 | The new object computes thermodynamic properties of air between -150 C and 400 C, 35 | water between 274K and 373K, argon between 100 and 700K and 36 | krypton between 150 and 700 K under 1 atm. Argon, krypton and water were obtained 37 | through http://webbook.nist.gov/chemistry/fluid/ 38 | More fluids to be added in the future 39 | fluid_of_interest.beta thermal expansion coefficient 40 | fluid_of_interest.rho density 41 | fluid_of_interest.Cp specific heat 42 | fluid_of_interest.mu dynamic viscosity 43 | fluid_of_interest.k thermal conductivity 44 | fluid_of_interest.nu kinematic viscosity 45 | fluid_of_interest.alpha thermal diffusivity 46 | fluid_of_interest.Pr 47 | 48 | 49 | """ 50 | def __init__(self,name,T,unit = "K",P = 101325.01): 51 | dirTables = 'https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/master/Libraries/Tables/' 52 | self.name = name 53 | if unit == "C": 54 | T = C2K(T) 55 | elif unit == "F": 56 | T = F2K(T) 57 | self.T = T 58 | self.P = P 59 | if P != 101325.01: 60 | print("All available tables are for P=1ATM, reverting to P=101325.01Pa") 61 | self.P = 101325.01 62 | if self.name == 'water': 63 | if T < 274 or T > 373: 64 | print("Temperature is out of bounds for liquid water") 65 | return 66 | url = dirTables+'Water1atm.csv' 67 | Ttab,ptab,rhotab,Cptab,mutab,ktab = \ 68 | np.genfromtxt(url, delimiter=',', skip_header = 1, unpack=True, dtype=float) 69 | Ntab = len(Ttab) 70 | Cptab *= 1e3 71 | nutab = mutab/rhotab 72 | alphatab = ktab/(rhotab*Cptab) 73 | Prtab = nutab/alphatab 74 | dTtab = Ttab[1] - Ttab[0] 75 | # compute beta from -rho(d rho/dT) 76 | betatab = -(1./rhotab)*np.gradient(rhotab)/dTtab 77 | i = int((T-Ttab[0])/dTtab) 78 | if (i == Ntab - 1): 79 | i == Ntab - 2 80 | elif self.name == 'argon': 81 | if T < 100 or T > 700: 82 | print("Temperature is out of bounds for argon") 83 | return 84 | url = dirTables + 'Argon1atm.csv' 85 | Ttab,ptab,rhotab,Cptab,mutab,ktab = \ 86 | np.loadtxt(url, delimiter=',', skiprows = 1, unpack=True, dtype=float) 87 | Ntab = len(Ttab) 88 | Cptab *= 1e3 89 | nutab = mutab/rhotab 90 | alphatab = ktab/(rhotab*Cptab) 91 | Prtab = nutab/alphatab 92 | dTtab = Ttab[1] - Ttab[0] 93 | # compute beta from -rho(d rho/dT) 94 | betatab = -(1./rhotab)*np.gradient(rhotab)/dTtab 95 | i = int((T-Ttab[0])/dTtab) 96 | if (i == Ntab - 1): 97 | i == Ntab - 2 98 | elif self.name == 'krypton': 99 | if T < 150 or T > 740: 100 | print("Temperature is out of bounds for krypton") 101 | return 102 | url = dirTables + 'Krypton1atm.csv' 103 | Ttab,ptab,rhotab,Cptab,mutab,ktab = \ 104 | np.loadtxt(url, delimiter=',', skiprows = 1, unpack=True, dtype=float) 105 | Ntab = len(Ttab) 106 | Cptab *= 1e3 107 | nutab = mutab/rhotab 108 | alphatab = ktab/(rhotab*Cptab) 109 | Prtab = nutab/alphatab 110 | dTtab = Ttab[1] - Ttab[0] 111 | # compute beta from -rho(d rho/dT) 112 | betatab = -(1./rhotab)*np.gradient(rhotab)/dTtab 113 | i = int((T-Ttab[0])/dTtab) 114 | if (i == Ntab - 1): 115 | i == Ntab - 2 116 | elif self.name == 'air': 117 | if T < C2K(-150.) or T > C2K(400.): 118 | print("Temperature is out of bounds of the table for air") 119 | return 120 | url = dirTables + 'Air1atm.csv' 121 | # url = 'https://raw.githubusercontent.com/yvesdubief/UVM-ME144-Heat-Transfer/master/Libraries/Tables/Air1atm.csv' 122 | # url = 'Tables/Air1atm.csv' 123 | Ttab,rhotab,Cptab,ktab,nutab,betatab,Prtab = \ 124 | np.genfromtxt(url, delimiter=',', skip_header = 1, unpack=True, dtype=float) 125 | Ntab = len(Ttab) 126 | Ttab = C2K(Ttab) 127 | Cptab *= 1e3 128 | nutab *= 1e-6 129 | mutab = rhotab*nutab 130 | alphatab = ktab/(rhotab*Cptab) 131 | Prtab = nutab/alphatab 132 | i = 0 133 | while (Ttab[i] < T) and (i 0.): 101 | f_1 = 1./(-2.0*np.log10(e/3.71))**2 102 | else: 103 | f_1 = f_0 104 | f_guess = np.max([f_0,f_1]) 105 | #f_guess = 0.04 106 | def f_tmp(x): 107 | y = (-2*np.log10((2.51/(Re*np.sqrt(x))) + (e/(3.71))) - 1.0/np.sqrt(x)) 108 | return y 109 | y = scipy.optimize.fsolve(f_tmp, f_guess) 110 | self.f = y[0] 111 | self.dPdx = self.f*(self.L/self.D)*(self.rho*self.Um**2)/2. 112 | 113 | def laminar_isothermal(self): 114 | self.Nu = 3.66 115 | 116 | def laminar_isoflux(self): 117 | self.Nu = 4.36 118 | 119 | def Dittus_Boelter(self,mode,Pr,Re = 0.0): 120 | if Re == 0. and self.Re !=0: 121 | Re = self.Re 122 | else: 123 | print("Warning Reynolds number is not defined") 124 | if (mode == 'heating'): 125 | n = 0.4 126 | elif (mode == 'cooling'): 127 | n = 0.3 128 | else: 129 | print("Warning you have to specify mode='heating' or 'cooling'") 130 | self.Nu = 0.023*Re**(4./5.)*Pr**n 131 | 132 | def Sieder_Tate(self,Pr,mu,mu_s, Re = 0.0): 133 | if Re == 0. and self.Re !=0: 134 | Re = self.Re 135 | else: 136 | print("Warning Reynolds number is not defined") 137 | self.Nu = 0.027*Re**(4/5)*Pr**(1/3)*(mu/mu_s)**0.14 138 | 139 | def Gnielinski(self, Pr, f,Re = 0.0): 140 | if Re == 0. and self.Re !=0: 141 | Re = self.Re 142 | else: 143 | print("Warning Reynolds number is not defined") 144 | self.Nu = (f/8.)*(Re-1000.)*Pr/(1+12.7*(f/8.)**0.5*(Pr**(2./3.)-1.)) 145 | 146 | def Skupinski(self,Pr, Re = 0.0): 147 | if Re == 0. and self.Re !=0: 148 | Re = self.Re 149 | else: 150 | print("Warning Reynolds number is not defined") 151 | self.Nu = 4.82+0.0185*(Re*Pr)**0.827 152 | 153 | def Seban(self,Pr, Re = 0.0): 154 | if Re == 0. and self.Re !=0: 155 | Re = self.Re 156 | else: 157 | print("Warning Reynolds number is not defined") 158 | self.Nu = 5.0+0.025*(Re*Pr)**0.8 159 | 160 | def log_mean_temperature(T_s,T_o,T_i): 161 | if (T_s < min(T_o,T_i)): 162 | DT_o = T_o-T_s 163 | DT_i = T_i-T_s 164 | elif (T_s > max(T_o,T_i)): 165 | DT_o = T_s-T_o 166 | DT_i = T_s-T_i 167 | return (DT_o-DT_i)/np.log(DT_o/DT_i) 168 | 169 | 170 | def T_mx_Ts_constant(T_s,T_mi,P,mdot,Cp,hbar,x): 171 | return T_s-(T_s-T_mi)*np.exp(-P*x*hbar/(mdot*Cp)) 172 | 173 | def T_mo_T_infty(T_infty,T_mi,mdot,Cp,R_tot): 174 | return T_infty-(Tinfty-T_mi)*np.exp(-1/(mdot*Cp*Rtot)) 175 | 176 | def L_given_other_params(T_infty,T_mo,T_mi,mdot,Cp,Rptot): 177 | return -mdot*Cp*Rptot*np.log((T_infty -T_mo)/(T_infty - T_mi)) 178 | 179 | -------------------------------------------------------------------------------- /Libraries/HT_natural_convection.py: -------------------------------------------------------------------------------- 1 | """ 2 | Object name: 3 | - HorizontalCylinder 4 | - FlatPlate 5 | - VerticalEnclosure 6 | Functions: Gr(g,beta,DT,D,nu) gives the Grashoff number based on: 7 | gravity g, thermal expansion coefficient beta, Temperature difference DT, 8 | length scale D, viscosity nu 9 | Ra(g,beta,DT,D,nu,alpha) gives the Rayleigh number where alpha is the thermal conductivity. 10 | """ 11 | import numpy as np 12 | import scipy 13 | import scipy.optimize 14 | 15 | class HorizontalCylinder(object): 16 | """ Natural convection about a horizontal cylinder 17 | from NewLibraries import HT_natural_convection as natconv 18 | cyl = natconv.HorizontalCylinder(correlation, Ra, Pr = 0.0) 19 | where correlation is "Morgan" or "Churchill-Chu" 20 | cyl = natconv.HorizontalCylinder("Morgan", Ra) 21 | cyl = natconv.HorizontalCylinder("Churchill-Chu", Ra, Pr = xx) 22 | """ 23 | 24 | def __init__(self,correlation="Morgan", Ra=0.0, Pr = 0.0): 25 | self.correlation = correlation 26 | self.Ra = Ra 27 | if correlation == "Morgan": 28 | if (Ra <= 1e-2): 29 | C=0.675 30 | n=0.058 31 | elif (Ra <= 1e2): 32 | C=1.02 33 | n=0.148 34 | elif (Ra <= 1e4): 35 | C=0.85 36 | n=0.188 37 | elif (Ra <= 1e7): 38 | C=0.480 39 | n=0.250 40 | elif (Ra <= 1e12): 41 | C=0.125 42 | n=0.333 43 | self.Nu = C*Ra**n 44 | elif correlation == "Churchill-Chu": 45 | if Pr == 0.: 46 | print("Warning you must specify Pr for Churchill and Chu correlation") 47 | else: 48 | self.Nu = (0.60+(0.387*Ra**(1./6.))/(1.+(0.559/Pr)**(9./16.))**(8./27.))**2 49 | else: 50 | print("Warning wrong correlation name") 51 | 52 | class VerticalEnclosure(object): 53 | """ Natural convection about a horizontal cylinder 54 | from NewLibraries import HT_natural_convection as natconv 55 | cyl = natconv.HorizontalCylinder(correlation, Ra, Pr = 0.0) 56 | where correlation is "Morgan" or "Churchill-Chu" 57 | cyl = natconv.HorizontalCylinder("Morgan", Ra) 58 | cyl = natconv.HorizontalCylinder("Churchill-Chu", Ra, Pr = xx) 59 | """ 60 | 61 | def __init__(self,Ra,Pr,H,L): 62 | self.Ra = Ra 63 | self.Pr = Pr 64 | self.H = H 65 | self.L = L 66 | if correlation == "Morgan": 67 | if (H/L) < 2.: 68 | if Ra*Pr/(0.2+Pr)> 1.e3: 69 | self.Nu = 0.18*(Pr/(0.2+Pr)*Ra)**0.29 70 | else: 71 | print('Ra is too low for this correlation') 72 | self.Nu = np.inf 73 | elif H/L < 10: 74 | if Ra < 1e10: 75 | self.Nu = 0.22*(Pr/(0.2+Pr)*Ra)**0.28*(H/L)**(-0.25) 76 | else: 77 | print('Ra is too high for this correlation') 78 | self.Nu = np.inf 79 | elif Ra < 1e4: 80 | print('Ra is too low for this correlation') 81 | self.Nu = np.inf 82 | elif Ra < 1e7: 83 | if Pr > 0.6 and Pr < 2e4: 84 | print('ok') 85 | self.Nu =0.42*Ra**0.25*Pr**0.012*(H/L)**(-0.3) 86 | else : 87 | print('Pr is out of bounds for this correlation') 88 | self.Nu = np.inf 89 | elif Ra < 1e9: 90 | if Pr > 0.6 and Pr < 20.: 91 | self.Nu =0.46*Ra**(1./3.) 92 | else : 93 | print('Pr is out of bounds for this correlation') 94 | self.Nu = np.inf 95 | else: 96 | print('Ra is too high, got nothing for you') 97 | self.Nu = np.inf 98 | class FlatPlate(object): 99 | """ Natural convection caused by a flat plate at temperature T_s 100 | in a fluid at given ambient temperature T_infty. 101 | Inputs: 102 | - Ra based on the |T_s - T_infty| and L=A_s/P_s where 103 | A_s and P_s are the area and the perimeter of the plate, 104 | respectively. 105 | - Pr 106 | - surface is either 'upper' or 'lower' 107 | - surfaceT is either 'cold' or 'hot' 108 | Output: 109 | - Average Nu_L 110 | Limits: 111 | from NewLibraries import HT_natural_convection as natconv 112 | plate = natconv.FlatPlate(Ra= Ra_L, Pr = Pr, 113 | surface = 'upper', surfaceT = 'hot') 114 | plate = natconv.FlatPlate(Ra= Ra_L, Pr = Pr, 115 | surface = 'lower', surfaceT = 'cold') 116 | - Ra > 1e4 117 | - If 1e4 <= Ra <= 1e7 then Pr>= 0.7 118 | - If 1e7 <= Ra <= 1e11 then all Pr 119 | plate = natconv.FlatPlate(Ra= Ra_L, Pr = Pr, 120 | surface = 'lower', surfaceT = 'hot') 121 | plate = natconv.FlatPlate(Ra= Ra_L, Pr = Pr, 122 | surface = 'upper', surfaceT = 'cold') 123 | - 1e4<= Ra <= 1e9, Pr>=0.7 124 | 125 | """ 126 | 127 | def __init__(self,Ra,Pr,surface='none',surfaceT='none'): 128 | self.Ra = Ra 129 | self.Pr = Pr 130 | self.surface = surface 131 | self.surfaceT = surfaceT 132 | # print(self.surface,self.surfaceT) 133 | if (self.surface != 'upper') and (self.surface != 'lower'): 134 | print(self.surface) 135 | print("you must specify surface='upper' or 'lower'") 136 | if (self.surfaceT != 'hot') and (self.surfaceT != 'cold'): 137 | print("you must specify surfaceT='hot' or 'cold'") 138 | if ((self.surface == 'upper') and (self.surfaceT == 'hot')) or \ 139 | ((self.surface == 'lower') and (self.surfaceT == 'cold')): 140 | if (self.Ra >= 1e4) and (self.Ra <= 1e7): 141 | if self.Pr < 0.7: 142 | print("Warning: For %s surface of %s plate, \ 143 | the correlation is only valid for Pr>= 0.7 " %(self.surface,self.surfaceT)) 144 | self.Nu = 0.54*self.Ra**(1/4) 145 | elif (self.Ra >= 1e7) : #and (self.Ra <= 1e11): 146 | self.Nu = 0.15*min(1e11,self.Ra)**(1/3) 147 | else: 148 | # print("Ra is too small") 149 | self.Nu = 0 150 | if ((self.surface == 'lower') and (self.surfaceT == 'hot')) or \ 151 | ((self.surface == 'upper') and (self.surfaceT == 'cold')): 152 | if (self.Ra >= 1e4) : # and (self.Ra <= 1e9): 153 | self.Nu = 0.15*min(1e9,self.Ra)**(1/5) 154 | if self.Pr < 0.7: 155 | print("Warning: the correlation is only valid for Pr>= 0.7") 156 | else: 157 | # print("Ra is too small") 158 | self.Nu=0 159 | 160 | 161 | def Gr(g=9.81,beta=0.0,DT=0.0,D=0.0,nu=1.0): 162 | return (g*beta*DT*D**3)/(nu**2) 163 | 164 | def Ra(g=9.81,beta=0.0,DT=0.0,D=0.0,nu=1.0,alpha=1.0): 165 | return (g*beta*DT*D**3)/(nu*alpha) 166 | 167 | 168 | 169 | -------------------------------------------------------------------------------- /.ipynb_checkpoints/ME144-HW1-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "raw", 5 | "metadata": {}, 6 | "source": [ 7 | "Text provided under a Creative Commons Attribution license, CC-BY. All code is made available under the FSF-approved MIT license. (c) Yves Dubief, 2016. NSF for support via NSF-CBET award #1258697." 8 | ] 9 | }, 10 | { 11 | "cell_type": "markdown", 12 | "metadata": {}, 13 | "source": [ 14 | "The following cell should always be the first coding cell of your python notebooks" 15 | ] 16 | }, 17 | { 18 | "cell_type": "code", 19 | "execution_count": 1, 20 | "metadata": { 21 | "collapsed": false 22 | }, 23 | "outputs": [ 24 | { 25 | "name": "stdout", 26 | "output_type": "stream", 27 | "text": [ 28 | "Please enter your NETID (e.g. ydubief)ydubief\n", 29 | "ydubief\n" 30 | ] 31 | } 32 | ], 33 | "source": [ 34 | "\n", 35 | "student_id = raw_input('Please enter your NETID (e.g. ydubief)')\n", 36 | "print(student_id)\n", 37 | "assignment_name = 'HW1_'+student_id\n" 38 | ] 39 | }, 40 | { 41 | "cell_type": "code", 42 | "execution_count": 1, 43 | "metadata": { 44 | "collapsed": true 45 | }, 46 | "outputs": [], 47 | "source": [ 48 | "\"\"\"\n", 49 | "importing the necessary libraries, do not modify\n", 50 | "\"\"\"\n", 51 | "%matplotlib inline \n", 52 | "# plots graphs within the notebook\n", 53 | "%config InlineBackend.figure_format='svg' # not sure what this does, may be default images to svg format\n", 54 | "\n", 55 | "from IPython.display import display,Image, Latex\n", 56 | "from __future__ import division\n", 57 | "from sympy.interactive import printing\n", 58 | "printing.init_printing(use_latex='mathjax')\n", 59 | "\n", 60 | "\n", 61 | "from IPython.display import display,Image, Latex\n", 62 | "\n", 63 | "from IPython.display import clear_output\n", 64 | "\n", 65 | "import SchemDraw as schem\n", 66 | "import SchemDraw.elements as e\n", 67 | "\n", 68 | "import matplotlib.pyplot as plt\n", 69 | "import numpy as np\n", 70 | "import math\n", 71 | "import scipy.constants as sc\n", 72 | "\n", 73 | "import sympy as sym\n", 74 | "\n", 75 | "from IPython.core.display import HTML\n", 76 | "def header(text):\n", 77 | " raw_html = '

' + str(text) + '

'\n", 78 | " return raw_html\n", 79 | "\n", 80 | "def box(text):\n", 81 | " raw_html = '
'+str(text)+'
'\n", 82 | " return HTML(raw_html)\n", 83 | "\n", 84 | "def nobox(text):\n", 85 | " raw_html = '

'+str(text)+'

'\n", 86 | " return HTML(raw_html)\n", 87 | "\n", 88 | "def addContent(raw_html):\n", 89 | " global htmlContent\n", 90 | " htmlContent += raw_html\n", 91 | " \n", 92 | "class PDF(object):\n", 93 | " def __init__(self, pdf, size=(200,200)):\n", 94 | " self.pdf = pdf\n", 95 | " self.size = size\n", 96 | "\n", 97 | " def _repr_html_(self):\n", 98 | " return ''.format(self.pdf, self.size)\n", 99 | "\n", 100 | " def _repr_latex_(self):\n", 101 | " return r'\\includegraphics[width=1.0\\textwidth]{{{0}}}'.format(self.pdf)\n", 102 | "\n", 103 | "class ListTable(list):\n", 104 | " \"\"\" Overridden list class which takes a 2-dimensional list of \n", 105 | " the form [[1,2,3],[4,5,6]], and renders an HTML Table in \n", 106 | " IPython Notebook. \"\"\"\n", 107 | " \n", 108 | " def _repr_html_(self):\n", 109 | " html = [\"\"]\n", 110 | " for row in self:\n", 111 | " html.append(\"\")\n", 112 | " \n", 113 | " for col in row:\n", 114 | " html.append(\"\".format(col))\n", 115 | " \n", 116 | " html.append(\"\")\n", 117 | " html.append(\"
{0}
\")\n", 118 | " return ''.join(html)\n", 119 | " \n", 120 | "font = {'family' : 'serif',\n", 121 | " 'color' : 'black',\n", 122 | " 'weight' : 'normal',\n", 123 | " 'size' : 18,\n", 124 | " }\n", 125 | "\n", 126 | "from scipy.constants.constants import C2K\n", 127 | "from scipy.constants.constants import K2C\n", 128 | "from scipy.constants.constants import F2K\n", 129 | "from scipy.constants.constants import K2F\n", 130 | "from scipy.constants.constants import C2F\n", 131 | "from scipy.constants.constants import F2C" 132 | ] 133 | }, 134 | { 135 | "cell_type": "markdown", 136 | "metadata": {}, 137 | "source": [ 138 | "

Heat loss through a single-pane window

\n", 139 | "\n", 140 | "The rear window of an automobile is defogged by attaching a thin, transparent, film-type heating element to its inner surface. By electrically heating this element, a uniform heat flux may be established at the inner surface. \n", 141 | "\n", 142 | "(a)\tFor 4-mm-thick window glass, determine the electrical power required per unit window area to maintain an inner surface temperature of $15^\\circ 􏰠C$ when the interior air temperature and convection coefficient are $T_{\\infty.i}= 25^\\circ 􏰠C$ and $h_i=10 W/m^2.K$, while the exterior (ambient) air temperature and convection coefficient are $T_{\\infty.o}=􏰕-10^\\circ 􏰠C$ and $h_o=65 W/m^2.K$.\n", 143 | "\n", 144 | "(b) In practice $T􏰝_{\\infty.o}$ and $h_o$ vary according to weather conditions and car speed. For values of $h_o=2,20,65,100 W/m^2.K$, determine and plot the electrical power requirement as a function of $T􏰝_{\\infty.o}$ for 􏰕$-30\\leq􏰦 T􏰝_{\\infty.o}\\leq 0^\\circ 􏰠C$. From your results, what can you conclude about the need for heater operation at low values of ho? How is this conclusion affected by the value of $T􏰝_{\\infty.o}$? If h 􏰶 V n, where V is the vehicle speed and n is a positive exponent, how does the vehicle speed affect the need for heater operation?\n", 145 | "\n", 146 | "The thermal conductivity of this glass is $1.4 W/m.K$\n" 147 | ] 148 | }, 149 | { 150 | "cell_type": "markdown", 151 | "metadata": {}, 152 | "source": [ 153 | "## Assumptions" 154 | ] 155 | }, 156 | { 157 | "cell_type": "markdown", 158 | "metadata": {}, 159 | "source": [ 160 | "Steady state, 1D conduction, thermal resistance of the heating element is negligible. Negligible heat transfer by radiation." 161 | ] 162 | }, 163 | { 164 | "cell_type": "markdown", 165 | "metadata": {}, 166 | "source": [ 167 | "## Parameters" 168 | ] 169 | }, 170 | { 171 | "cell_type": "code", 172 | "execution_count": 2, 173 | "metadata": { 174 | "collapsed": false 175 | }, 176 | "outputs": [], 177 | "source": [ 178 | "L =0.004 #m\n", 179 | "\n", 180 | "k_glass = 1.4 #W/m.K thermal conductivity of glass\n", 181 | "\n", 182 | "T_inf_in = 25 #C\n", 183 | "T_inf_out = -10 #C\n", 184 | "h_in = 65.\n", 185 | "h_out = 65.\n", 186 | "T_s_i = 15 #C" 187 | ] 188 | }, 189 | { 190 | "cell_type": "code", 191 | "execution_count": 23, 192 | "metadata": { 193 | "collapsed": false 194 | }, 195 | "outputs": [ 196 | { 197 | "name": "stdout", 198 | "output_type": "stream", 199 | "text": [ 200 | "[NbConvertApp] Converting notebook Problem-Template0.ipynb to html\n", 201 | "[NbConvertApp] Writing 319091 bytes to ydubief.html\n" 202 | ] 203 | } 204 | ], 205 | "source": [ 206 | "!ipython nbconvert --to html ME144-HW1.ipynb --output $assignment_name" 207 | ] 208 | }, 209 | { 210 | "cell_type": "code", 211 | "execution_count": null, 212 | "metadata": { 213 | "collapsed": true 214 | }, 215 | "outputs": [], 216 | "source": [] 217 | } 218 | ], 219 | "metadata": { 220 | "kernelspec": { 221 | "display_name": "Python 2", 222 | "language": "python", 223 | "name": "python2" 224 | }, 225 | "language_info": { 226 | "codemirror_mode": { 227 | "name": "ipython", 228 | "version": 2 229 | }, 230 | "file_extension": ".py", 231 | "mimetype": "text/x-python", 232 | "name": "python", 233 | "nbconvert_exporter": "python", 234 | "pygments_lexer": "ipython2", 235 | "version": "2.7.11" 236 | } 237 | }, 238 | "nbformat": 4, 239 | "nbformat_minor": 0 240 | } 241 | -------------------------------------------------------------------------------- /.ipynb_checkpoints/HT-banks_of_tubes-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "%matplotlib inline \n" 10 | ] 11 | }, 12 | { 13 | "cell_type": "markdown", 14 | "metadata": {}, 15 | "source": [ 16 | "This notebook deals with banks of cylinders in a cross flow. Cylinder banks are common heat exchangers where the cylinders may be heated by electricity or a fluid may be flowing within the cylinder to cool or heat the flow around the cylinders. The advantage of cylinder banks is the increase mixing in the fluid, thus the temperature downstream of the bank is likely to be quite homogeneous.\n", 17 | "\n", 18 | "\"my" 19 | ] 20 | }, 21 | { 22 | "cell_type": "markdown", 23 | "metadata": {}, 24 | "source": [ 25 | "The arrangement of cylinders may be aligned or staggered as shown in the following figures. The flow and geometrical parameters will be used in the derivation of temperature equations and Nusselt number correlation.\n", 26 | "\"my" 27 | ] 28 | }, 29 | { 30 | "cell_type": "markdown", 31 | "metadata": {}, 32 | "source": [ 33 | "This notebook should cover a wide variety of problems, providing that the assumption of isothermal boundary conditions on the tubes is (approximately) valid. The tube surface temperature is $T_s$. \n", 34 | "The flow and geometrical parameters of importance to solve this problem are:\n", 35 | "\n", 36 | "* Arithmetic mean of temperature between inlet $T_i$ and outlet $T_o$ of the bank. \n", 37 | "$$\n", 38 | "T_m = \\frac{T_i+T_o}{2}\n", 39 | "$$\n", 40 | "* Reynolds number based on the max velocity within the bank $V_\\text{max}$, the density and viscosity based on $T_m$:\n", 41 | "$$\n", 42 | "Re=\\frac{\\rho V_\\text{max}D}{\\mu}\n", 43 | "$$\n", 44 | "**Question: At what temperature should you estimate $\\rho$ and $\\mu$?** The energy of the flow comes from the inlet and the velocity $V_\\mathrm{max}$ is calculated from the inlet velocity. The density should therefore be estimated at $T_i$. The viscous forces however occur throughout the domain, so $\\mu$ should be estimated at $T_m$. In some cases $T_o$ is the quantity to be found. It is acceptable to use $\\mu(T_i)$, but you must verify that the temperature difference $\\Delta T=\\vert T_i-T_o\\vert$ is not too large. If it is, you must repeat the calculation iteratively with $\\mu(T_i)$ until $T_o$ converges.\n", 45 | "\n", 46 | "* Prandtl number $Pr$ based on $T_m$ \n", 47 | "* Surface Prandtl number $Pr_s$ based on $T_s$\n", 48 | "* Number of tubes in the transversal direction $N_T$, longitudinal direction $N_L$ and total $N=N_T\\times N_L$\n", 49 | "* The transversal $S_T$ and longitudinal $S_L$ separations between tubes in a row and between rows.\n", 50 | "* The type of tube arrangement: \n", 51 | " * Aligned\n", 52 | "$$\n", 53 | "V_\\text{max}=\\frac{S_T}{S_T-D}V_i\n", 54 | "$$\n", 55 | " * Staggered\n", 56 | "$$\n", 57 | "V_\\text{max}=\\frac{S_T}{2(S_D-D)}V_i\\text{ with }S_D=\\sqrt{S_L^2+\\left(\\frac{S_T}{2}\\right)^2}\n", 58 | "$$\n" 59 | ] 60 | }, 61 | { 62 | "cell_type": "markdown", 63 | "metadata": {}, 64 | "source": [ 65 | "The Nusselt number correlation for a bank of tubes is a variation of the Zukauskas correlation:\n", 66 | "$$\n", 67 | "Nu = C_2C_1Re^mPr^{0.36}\\left(\\frac{Pr}{Pr_s}\\right)^{1/4}\n", 68 | "$$\n", 69 | "where $C_2$ depends on $N_L$. In the library, the function for this correlation is\n", 70 | "Nu_tube_banks(Re,Pr,Pr_s,S_L,S_T,N_L,arrangement) .\n", 71 | "\n", 72 | "The heat rate per unit length across the tube bank is\n", 73 | "$$\n", 74 | "q'=N\\overline{h}\\pi D \\Delta T_\\text{lm}\n", 75 | "$$\n", 76 | "where the temperature drop is the log-mean temperature difference\n", 77 | "$$\n", 78 | "\\Delta T_\\text{lm}=\\cfrac{(T_s-T_i)-(T_s-T_o)}{\\ln\\left(\\cfrac{T_s-T_i}{T_s-T_o}\\right)}\n", 79 | "$$\n", 80 | "which accounts for the exponential variation of temperature across the bank\n", 81 | "$$\n", 82 | "\\cfrac{T_s-T_o}{T_s-T_i}=\\exp\\left(-\\cfrac{\\pi D N \\overline{h}}{\\rho V_i N_T S_T C_p}\\right)\n", 83 | "$$\n", 84 | "where $\\rho$, $C_p$ and $V_i$ are inlet quantities if $T_o$ is unknown of the arthimetic mean temperature if available. Note that $N=N_L\\times N_T$ thus \n", 85 | "$$\n", 86 | "\\cfrac{T_s-T_o}{T_s-T_i}=\\exp\\left(-\\cfrac{\\pi D N_L \\overline{h}}{\\rho V_i S_T C_p}\\right)\n", 87 | "$$\n", 88 | "One may want to determine the number of tubes necessary to achieve a given $T_o$. The number of tubes in the transverse directions is typically dictated by the geometry of the system, so we are looking for $N_L$:\n", 89 | "$$\n", 90 | "N_L = \\cfrac{\\rho V_i S_T C_p}{\\pi D \\overline{h}} \\log\\left(\\cfrac{T_s-T_i}{T_s-T_o}\\right)\n", 91 | "$$\n" 92 | ] 93 | }, 94 | { 95 | "cell_type": "markdown", 96 | "metadata": {}, 97 | "source": [ 98 | "The pressure loss through the tube bank is a critical component of the heat exchanger design. The presence of obstacles in the flow requires an increase in the mechanical energy necessary to drive the flow at a given flow rate. The pressure loss, given all parameters above, is\n", 99 | "$$\n", 100 | "\\Delta p = N_L\\,\\chi\\, f\\,\\frac{\\rho V_\\text{max}^2}{2}\n", 101 | "$$\n", 102 | "where the friction factor $f$ and the parameter $\\chi$ are given by the graphs below for the aligned (top) and staggered (bottom) arrangements. These graphs use two new quantities, the longitudnal and transverse pitches:\n", 103 | "$$\n", 104 | "P_L=\\frac{S_L}{D}\\text{ and } P_T=\\frac{S_T}{D}\n", 105 | "$$\n", 106 | "\"my\n", 107 | "\"my" 108 | ] 109 | }, 110 | { 111 | "cell_type": "markdown", 112 | "metadata": {}, 113 | "source": [ 114 | "## Problem1\n", 115 | "A preheater involves the use of condensing steam on the inside of a bank of tubes to heat air that enters at $P_i=1 \\text{ atm}$ and $T_i=25^\\circ\\text{C}$. The air moves at $V_i=5\\text{ m/s}$ in cross flow over the tubes. Each tube is $L=1\\text{ m}$ long and has an outside diameter of $D=10 \\text{ mm}$. The bank consists of columns of 14 tubes in the transversal direction $N_T=14$ and $N_L$ rows in the direction of flow. The arrangement of tubes is aligned array for which $S_T=S_L=15\\text{ mm}$. What is the minimum value of $N_L$ needed to achieve an outlet temperature of $T_o=75^\\circ\\text{C}$? What is the corresponding pressure drop across the tube bank?\n" 116 | ] 117 | }, 118 | { 119 | "cell_type": "code", 120 | "execution_count": 8, 121 | "metadata": {}, 122 | "outputs": [], 123 | "source": [ 124 | "import numpy as np\n", 125 | "from Libraries import thermodynamics as thermo\n", 126 | "from Libraries import HT_external_convection as extconv\n", 127 | "\n", 128 | "T_i = 25 #C\n", 129 | "T_o = 75 #C\n", 130 | "T_s = 100 #C\n", 131 | "V_i = 5 #m/s\n", 132 | "L = 1 #m\n", 133 | "D = 10e-3 #mm\n", 134 | "N_L = 14\n", 135 | "S_T = S_L = 15e-3 #m\n", 136 | "\n", 137 | "\n" 138 | ] 139 | }, 140 | { 141 | "cell_type": "markdown", 142 | "metadata": {}, 143 | "source": [ 144 | "## Problem 2\n", 145 | "\n", 146 | "A preheater involves the use of condensing steam at $100^\\circ\\text{C}$ on the inside of a bank of tubes to heat air that enters at $1 \\text{ atm}$ and $25^\\circ\\text{C}$. The air moves at $5\\text{ m/s}$ in cross flow over the tubes. Each tube is $1\\text{ m}$ long and has an outside diameter of $10 \\text{ mm}$. The bank consists of 196 tubes in a square, aligned array for which $S_T=S_L=15\\text{ mm}$. What is the total rate of heat transfer to the air? What is the pressure drop associated with the airflow?" 147 | ] 148 | }, 149 | { 150 | "cell_type": "markdown", 151 | "metadata": {}, 152 | "source": [ 153 | "## Problem 3" 154 | ] 155 | }, 156 | { 157 | "cell_type": "markdown", 158 | "metadata": {}, 159 | "source": [ 160 | "\"my\n", 161 | "An air duct heater consists of an aligned array of electrical heating elements in which the longitudinal and transverse pitches are $S_L=S_T= 24\\text{ mm}$. There are 3 rows of elements in the flow direction ($N_L=3$) and 4 elements per row ($N_T=4$). Atmospheric air with an upstream velocity of $12\\text{ m/s}$ and a temperature of $25^\\circ\\text{C}$ moves in cross flow over the elements, which have a diameter of $12\\text{ mm}$, a length of $250\\text{ mm}$, and are maintained at a surface temperature of $350^\\circ\\text{C}$.\n", 162 | "
    \n", 163 | "
  1. \n", 164 | "Determine the total heat transfer to the air and the temperature of the air leaving the duct heater.\n", 165 | "
  2. \n", 166 | "
  3. \n", 167 | "Determine the pressure drop across the element bank and the fan power requirement.\n", 168 | "
  4. \n", 169 | "
  5. \n", 170 | "Compare the average convection coefficient obtained in your analysis with the value for an isolated (single) element. Explain the difference between the results.\n", 171 | "
  6. \n", 172 | "
  7. \n", 173 | "What effect would increasing the longitudinal and transverse pitches to 30 mm have on the exit temperature of the air, the total heat rate, and the pressure drop?\n", 174 | "
  8. \n", 175 | "
" 176 | ] 177 | }, 178 | { 179 | "cell_type": "code", 180 | "execution_count": null, 181 | "metadata": {}, 182 | "outputs": [], 183 | "source": [ 184 | "\n", 185 | "\n" 186 | ] 187 | }, 188 | { 189 | "cell_type": "code", 190 | "execution_count": null, 191 | "metadata": {}, 192 | "outputs": [], 193 | "source": [] 194 | } 195 | ], 196 | "metadata": { 197 | "kernelspec": { 198 | "display_name": "Python 3", 199 | "language": "python", 200 | "name": "python3" 201 | }, 202 | "language_info": { 203 | "codemirror_mode": { 204 | "name": "ipython", 205 | "version": 3 206 | }, 207 | "file_extension": ".py", 208 | "mimetype": "text/x-python", 209 | "name": "python", 210 | "nbconvert_exporter": "python", 211 | "pygments_lexer": "ipython3", 212 | "version": "3.8.5" 213 | } 214 | }, 215 | "nbformat": 4, 216 | "nbformat_minor": 2 217 | } 218 | -------------------------------------------------------------------------------- /.ipynb_checkpoints/HTpy-HW2-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# HW2\n", 8 | "\n", 9 | "\n", 10 | "Before submitting your **HTpy-HW2.ipynb** file, perform the following\n", 11 | "* `Kernel>Restart & Run All`\n", 12 | "* Make sure that there are no errors\n", 13 | "\n", 14 | "The following includes problems that need coding and others that only need to perform simple operations (python as a calculator)." 15 | ] 16 | }, 17 | { 18 | "cell_type": "code", 19 | "execution_count": 1, 20 | "metadata": {}, 21 | "outputs": [], 22 | "source": [ 23 | "from Libraries import thermodynamics as thermo\n", 24 | "import numpy as np\n", 25 | "import matplotlib.pyplot as plt\n", 26 | "import scipy.constants as csts" 27 | ] 28 | }, 29 | { 30 | "cell_type": "markdown", 31 | "metadata": {}, 32 | "source": [ 33 | "## 1 Convection heat transfer coefficient\n", 34 | "A plate of metal of mass $m=4.25 kg$, specific heat $C_p= 2770 J/kg.K$ and surface area $0.4m\\times0.4m$ is cooled in ambient air at temperature $T_\\infty=25^\\circ C$. The plate is thin enough and its thermal conductivity high enough that the plate is assumed to be isothermal at any time. At a given time, the plate temperature is $T_s = 245^\\circ C$ and the rate of temperature cooling is\n", 35 | "$$\n", 36 | "\\frac{dT}{dt}=-0.028 K/s\n", 37 | "$$\n", 38 | "\n", 39 | "Find the convection heat transfer coefficient from conservation of energy applied to the plate." 40 | ] 41 | }, 42 | { 43 | "cell_type": "markdown", 44 | "metadata": {}, 45 | "source": [ 46 | "### Solution\n", 47 | "Assumptions:\n", 48 | "* Plate is isothermal\n", 49 | "* Only heat transfer is convection heat transfer\n", 50 | "* Conservation of energy is applied to the plate\n", 51 | "* The plate is thin therefore the area exposed to convection is $A=2\\times0.4^2m^2$\n", 52 | "\n", 53 | "Conservation of energy applied to the metal plates writes:\n", 54 | "$$\n", 55 | "\\frac{d E_{st}}{dt}=\\dot{E}_{in} - \\dot{E}_{out} + \\dot{E}_g\n", 56 | "$$\n", 57 | "\n", 58 | "reduces to\n", 59 | "\n", 60 | "$$\n", 61 | "\\frac{d E_{st}}{dt}=- \\dot{E}_{out}\n", 62 | "$$\n", 63 | "\n", 64 | "where $\\dot{E}_{out}$ is the thermal energy lost by convection to the ambient air:\n", 65 | "$$\n", 66 | "\\dot{E}_{out}=q_{conv}=hA(T_s-T_\\infty).\n", 67 | "$$\n", 68 | "\n", 69 | "Since $T_s=T$, the conservation of energy becomes:\n", 70 | "$$\n", 71 | "\\frac{d}{dt}\\int_V\\rho C_pT dV=-hA(T-T_\\infty)\n", 72 | "$$\n", 73 | "\n", 74 | "$$\n", 75 | "mC_p\\frac{dT}{dt}=-hA(T-T_\\infty)\n", 76 | "$$\n", 77 | "\n", 78 | "Therefore,\n", 79 | "\n", 80 | "$$\n", 81 | "\\frac{dT}{dt}=-\\frac{hA}{mC_p}(T-T_\\infty)\n", 82 | "$$\n", 83 | "\n", 84 | "or\n", 85 | "\n", 86 | "$$\n", 87 | "h=-\\frac{mC_p}{A(T-T_\\infty)}\\frac{dT}{dt}\n", 88 | "$$\n", 89 | "\n" 90 | ] 91 | }, 92 | { 93 | "cell_type": "code", 94 | "execution_count": 2, 95 | "metadata": {}, 96 | "outputs": [ 97 | { 98 | "name": "stdout", 99 | "output_type": "stream", 100 | "text": [ 101 | "The convection heat transfer for the given conditions is 4.7 W/m^2.K\n" 102 | ] 103 | } 104 | ], 105 | "source": [ 106 | "Cp = 2770. #J/kg.K\n", 107 | "m = 4.25 #kg\n", 108 | "dTdt = -0.028 #K/s\n", 109 | "T_infty = 25. #C\n", 110 | "T_s = 245. #C\n", 111 | "A = 2*0.4**2\n", 112 | "\n", 113 | "h = -m*Cp/(A*(T_s - T_infty))*dTdt\n", 114 | "print (\"The convection heat transfer for the given conditions is %.1f W/m^2.K\" %h)" 115 | ] 116 | }, 117 | { 118 | "cell_type": "markdown", 119 | "metadata": {}, 120 | "source": [ 121 | "## 2 Radiation in a vacuum \n", 122 | "\n", 123 | "The same plate as above is now in a vacuum (no flow). Using all conditions defined in 1, determine the emissivity of the plate and the heat rate at which radiation is emitted from the plate. Assume that $T_{sur}=T_\\infty$. " 124 | ] 125 | }, 126 | { 127 | "cell_type": "markdown", 128 | "metadata": {}, 129 | "source": [ 130 | "### Solution\n", 131 | "Assumptions:\n", 132 | "* Same as above, except no convection\n", 133 | "\n", 134 | "Using the same approache as above, with $\\dot{E}_{out}=q_{rad}=\\sigma\\varepsilon A(T_s^4-T_\\infty^4)$, the emissivity is\n", 135 | "$$\n", 136 | "m C_p\\frac{dT}{dt}=\\sigma\\varepsilon A(T_s^4-T_\\infty^4)\n", 137 | "$$\n", 138 | "$$\n", 139 | "\\varepsilon=-\\frac{mC_p}{\\sigma A(T_s^4-T_\\infty^4)}\\frac{dT}{dt}\n", 140 | "$$\n", 141 | "\n", 142 | "Emissive power of the plate is \n", 143 | "\n", 144 | "$$\n", 145 | "q_{rad}=\\varepsilon \\sigma A T_s^4\n", 146 | "$$" 147 | ] 148 | }, 149 | { 150 | "cell_type": "code", 151 | "execution_count": 3, 152 | "metadata": {}, 153 | "outputs": [ 154 | { 155 | "name": "stdout", 156 | "output_type": "stream", 157 | "text": [ 158 | "The Stefan-Boltzmann constant is available from scipy 5.67e-08 W/m^2.K^4\n" 159 | ] 160 | } 161 | ], 162 | "source": [ 163 | "print('The Stefan-Boltzmann constant is available from scipy %.2e W/m^2.K^4' %csts.sigma)" 164 | ] 165 | }, 166 | { 167 | "cell_type": "code", 168 | "execution_count": 5, 169 | "metadata": {}, 170 | "outputs": [ 171 | { 172 | "name": "stdout", 173 | "output_type": "stream", 174 | "text": [ 175 | "The emissivity of the plate is 0.28\n", 176 | "The heat rate of radiation emitted by the plate is 370 W\n" 177 | ] 178 | } 179 | ], 180 | "source": [ 181 | "Cp = 2770. #J/kg.K\n", 182 | "m = 4.25 #kg\n", 183 | "dTdt = -0.028 #K/s\n", 184 | "T_infty = 25. #C\n", 185 | "T_s = 245. #C\n", 186 | "A = 2*0.4**2\n", 187 | "eps = -m*Cp/(csts.sigma*A*(thermo.C2K(T_s)**4 - thermo.C2K(T_infty)**4))*dTdt\n", 188 | "print('The emissivity of the plate is %.2f' %eps)\n", 189 | "q_rad = eps*csts.sigma*A*thermo.C2K(T_s)**4\n", 190 | "print('The heat rate of radiation emitted by the plate is %.0f W' %q_rad)" 191 | ] 192 | }, 193 | { 194 | "cell_type": "markdown", 195 | "metadata": {}, 196 | "source": [ 197 | "## 3 Surface temperature of steam line\n", 198 | "\n", 199 | "A steam line of diameter $D=0.1m$ and length $L=25m$ loses $18.405 kW$ to the ambient air. The air is at $T_\\infty=T_{sur}=25^\\circ C$, the convection coefficient of the air flow is $h=10W/m^2.K$ and the emissivity of the pipe is $\\varepsilon=0.8$.\n", 200 | "\n", 201 | "Find the surface temperature of the steam line, the annual energy loss and the annual cost assuming that the steam is generated by a furnace with an efficiency $\\eta_f = 0.9$ running at a cost of natural gas of $0.02\\$/MJ$.\n", 202 | "\n", 203 | "For the surface temperature, use `scipy.optimize.fsolve`" 204 | ] 205 | }, 206 | { 207 | "cell_type": "markdown", 208 | "metadata": {}, 209 | "source": [ 210 | "### Solution\n", 211 | "Assumptions:\n", 212 | "* Heat transfer is steady and 1D\n", 213 | "* Conservation of energy is applied to the surface of the pipe. There is no energy generation in that control volume. \n", 214 | "\n", 215 | "The control volume is the external surface of the pipe of surface area $A=\\pi D\\times L=2.5m^2$. The steam loses heat to the outside at a rate $q=18.405kW$. This energy is transferred to the outside through radiation and convection. The conservation of energy applied to the surface of the pipe therefore reduces to:\n", 216 | "\n", 217 | "$$\n", 218 | "\\dot{E}_{in}-\\dot{E}_{out}=0\n", 219 | "$$\n", 220 | "\n", 221 | "with $\\dot{E}_{in}=q$ and $\\dot{E}_{out}=q_{conv}+q_{rad}$. For a surface temperature $T_s$, this equation becomes\n", 222 | "\n", 223 | "$$\n", 224 | "q-hA(T_s-T_\\infty)-\\sigma\\varepsilon A(T_s^4-T_\\infty^4)=0\n", 225 | "$$\n", 226 | "\n", 227 | "that we solve for $T_s$ using the function root finder solver fsolve from scipy.optimize.\n", 228 | "\n", 229 | "The annual energy loss $E_{loss}$ is q multiplied by a year. The energy consumed by the boiler to create the total energy loss is\n", 230 | "$$\n", 231 | "E_{furnace}=\\frac{E_{loss}}{\\eta_f}\n", 232 | "$$\n", 233 | "\n", 234 | "Warning: the cost is in dollars per MEGAJoule." 235 | ] 236 | }, 237 | { 238 | "cell_type": "markdown", 239 | "metadata": {}, 240 | "source": [ 241 | "with \n", 242 | "$$\n", 243 | "\\dot{E}_{in}=q_{loss} = 18.405kW\n", 244 | "$$\n", 245 | "\n", 246 | "$$\n", 247 | "\\dot{E}_{out}=q_{conv}+q_{rad}\n", 248 | "$$" 249 | ] 250 | }, 251 | { 252 | "cell_type": "code", 253 | "execution_count": null, 254 | "metadata": {}, 255 | "outputs": [], 256 | "source": [ 257 | "from scipy.optimize import fsolve\n", 258 | "D = 0.1\n", 259 | "L = 25.\n", 260 | "q = 18405.\n", 261 | "h = 10.\n", 262 | "T_infty = 25.\n", 263 | "eps = 0.8\n", 264 | "eta_f = 0.9\n", 265 | "Cost = 0.02\n", 266 | "A = np.pi*D*L\n", 267 | "\n", 268 | "\n", 269 | "# print('The steam line surface temperature is %.0f C' %T_s)\n", 270 | "# print('verification:',A*h*(T_s-T_infty) + eps*sccst.sigma*A*(C2K(T_s)**4-C2K(T_infty)**4))\n", 271 | "# cost = q*(365*24*3600)/0.9*C*1e-6\n", 272 | "# print('The cost of operation for a year is $%.f' %cost)" 273 | ] 274 | }, 275 | { 276 | "cell_type": "markdown", 277 | "metadata": {}, 278 | "source": [ 279 | "## 4 Insulation\n", 280 | "\n", 281 | "Assuming that the surface temperature is $150^\\circ C$, find an insulation that works (i.e. an insulation that will not melt, for which you can retrieve the price and thermal conductivity). Derive the necessary equations that will give optimum savings.\n", 282 | "\n", 283 | "Hint: Derive the heat loss for a variable thickness of insulation, then apply this formula for a range of thicknesses. Compare savings of gas vs cost of insulation." 284 | ] 285 | }, 286 | { 287 | "cell_type": "markdown", 288 | "metadata": {}, 289 | "source": [ 290 | "### Solution\n", 291 | "Assumptions:\n", 292 | "" 295 | ] 296 | }, 297 | { 298 | "cell_type": "code", 299 | "execution_count": null, 300 | "metadata": {}, 301 | "outputs": [], 302 | "source": [] 303 | }, 304 | { 305 | "cell_type": "markdown", 306 | "metadata": {}, 307 | "source": [ 308 | "## 5 Window\n", 309 | "\n", 310 | "Set up calculations to discuss heat losses of a single pane window, a single pane window with storm window and a double paned window with Argon vacuum." 311 | ] 312 | }, 313 | { 314 | "cell_type": "markdown", 315 | "metadata": {}, 316 | "source": [ 317 | "### Solution\n", 318 | "Assumptions:\n", 319 | "" 322 | ] 323 | }, 324 | { 325 | "cell_type": "code", 326 | "execution_count": null, 327 | "metadata": {}, 328 | "outputs": [], 329 | "source": [] 330 | }, 331 | { 332 | "cell_type": "code", 333 | "execution_count": null, 334 | "metadata": {}, 335 | "outputs": [], 336 | "source": [] 337 | } 338 | ], 339 | "metadata": { 340 | "kernelspec": { 341 | "display_name": "Python 3", 342 | "language": "python", 343 | "name": "python3" 344 | }, 345 | "language_info": { 346 | "codemirror_mode": { 347 | "name": "ipython", 348 | "version": 3 349 | }, 350 | "file_extension": ".py", 351 | "mimetype": "text/x-python", 352 | "name": "python", 353 | "nbconvert_exporter": "python", 354 | "pygments_lexer": "ipython3", 355 | "version": "3.8.5" 356 | } 357 | }, 358 | "nbformat": 4, 359 | "nbformat_minor": 4 360 | } 361 | -------------------------------------------------------------------------------- /.ipynb_checkpoints/HW-01-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "0cc46860", 6 | "metadata": {}, 7 | "source": [ 8 | "# Homework Assignment 2\n", 9 | "\n", 10 | "Complete this notebook, export to pdf (`File>Download as> PDF (via LaTeX)`) and submit the pdf to BB" 11 | ] 12 | }, 13 | { 14 | "cell_type": "markdown", 15 | "id": "85aecba7", 16 | "metadata": {}, 17 | "source": [ 18 | "## Pb 1: Air thermodynamic properties class\n", 19 | "\n", 20 | "The concept of class is central to most libraries. It consists of the definition of an object, which has specific properties, data and function.\n", 21 | "\n", 22 | "Zografos et al. (*Compt. Methods Appl. Mech Eng.*, 61:177-187, 1987) proposed polynomials to compute density, dynamic viscosity, thermal conductivity, and specific heat at constant temperature of air at atmospheric pressure as a function of the static temperature $T$ on the Kelvin scale as follows:\n", 23 | "* Density $\\rho$ in units of $\\mathrm{kg/m^3}$:\n", 24 | "\n", 25 | "$$\n", 26 | "\\rho=\\begin{cases}\n", 27 | "-2.440\\times10^{-2}T+5.9958\\,, & 100\\,\\mathrm{K}\\leq T<150\\,\\mathrm{K}\\\\\n", 28 | "345.57(T-2.6884)^{-1}\\,, & 150\\,\\mathrm{K}\\leq T\\leq 3000\\,\\mathrm{K}\n", 29 | "\\end{cases}\n", 30 | "$$\n", 31 | "* Dynamic viscosity $\\mu$ in units of $\\mathrm{N.s/m^2}=\\mathrm{kg/(m.s)}=\\mathrm{Pa.s}$:\n", 32 | "\n", 33 | "$$\n", 34 | "\\mu = 4.1130\\times10^{-6} + 5.0523\\times10^{-8}T - 1.4346\\times10^{-11}T^2+2.5914\\times10^{-15}T^3\n", 35 | "$$\n", 36 | "\n", 37 | "* Thermal conductivity $k$ in units of $\\mathrm{W/(m.K)}$:\n", 38 | "\n", 39 | "$$\n", 40 | "k= -7.488\\times10^{-3} + 1.7082\\times10^{-4}T - 2.3758\\times10^{-10}T^2 + 2.2012\\times10^{-10}T^3 \\\\\n", 41 | " + 9.4600\\times10^{-14}T^4 + 1.5797\\times10^{-17}T^5\n", 42 | "$$\n", 43 | "\n", 44 | "* Specific heat at constant pressure $c_p$ in unites of $\\mathrm{J/(kg.K)}$:\n", 45 | "\n", 46 | "$$\n", 47 | "c_p=1061.332-0.432819T + 1.02344\\times10^{-3}T^2 - 6.47474\\times10^{-7}T^3 + 1.3864\\times10^{-10}T^4\n", 48 | "$$\n", 49 | "\n", 50 | "Air density $\\rho$ of units $\\mathrm{kg/m^3}$ can be computed from \n", 51 | "\n", 52 | "The Prandtl number $Pr$ can be computed as\n", 53 | "\n", 54 | "$$\n", 55 | "Pr=\\frac{\\mu c_p}{k}\n", 56 | "$$\n", 57 | "\n", 58 | "and the thermal conductivity $\\alpha$ of units $\\mathrm{m^2/s}$ as\n", 59 | "\n", 60 | "$$\n", 61 | "\\alpha = \\frac{k}{\\rho c_p}\n", 62 | "$$\n", 63 | "\n", 64 | "Write a class storing all these variables for input temperature (float) and unit used for temperature (string, it can only be \"K\", \"C\", \"F\"). The class should convert the temperature to Kelvin if unit is either \"C\" or \"F\"). The class should give a warning if \n", 65 | "* the temperature is outside of the range,\n", 66 | "* the unit is not \"K\", \"C\", \"F\", e.g. \"c\"\n", 67 | "\n", 68 | "### Tasks\n", 69 | "* Complete the manual part of the class (text between \"\"\" xxxx \"\"\"), i.e. write appropriate units. \n", 70 | "* Complete the class to compute all quantities defined in the manual.\n", 71 | "* Apply your class to the examples below.\n", 72 | "* Define units for examples.\n", 73 | "* Plot density as function of temperature in the range $10^2\\leq T<3000$. Use log-scale for temperature. Axes must be labeled with their variables and units." 74 | ] 75 | }, 76 | { 77 | "cell_type": "code", 78 | "execution_count": null, 79 | "id": "97650df2", 80 | "metadata": {}, 81 | "outputs": [], 82 | "source": [ 83 | "import numpy as np\n", 84 | "import math\n", 85 | "import matplotlib.pyplot as plt\n", 86 | "class Air:\n", 87 | " \"\"\"\n", 88 | " Returns an object containing the thermodynamic properties of air at atmospheric pressure\n", 89 | " Input: \n", 90 | " T: temperature (float)\n", 91 | " Tunit: unit of temperature (string). Can only be \"K\", \"C\", \"F\"\n", 92 | " output:\n", 93 | " self.rho: density [kg/m^3]\n", 94 | " self.mu: dynamic viscosity [write units here]\n", 95 | " self.k: thermal conductivity [write units here]\n", 96 | " self.cp: Specific heat at constant pressure [write units here]\n", 97 | " self.Pr: Prandtl number\n", 98 | " self.nu: kinematic viscosity [write units here]\n", 99 | " self.alpha: thermal diffusivity [write units here]\n", 100 | " \"\"\"\n", 101 | " def __init__(self,T,Tunit):\n", 102 | " if Tunit == \"C\":\n", 103 | " T += 273.15\n", 104 | " elif Tunit == \"F\":\n", 105 | " T = (T - 32)*5/9 +273.15\n", 106 | " elif Tunit != \"K\":\n", 107 | " print(\"Wrong input for unit of temperature\")\n", 108 | " print(\"Input should be 'K', 'C', or 'F'\")\n", 109 | " self.T = T\n", 110 | " self.mu = 4.1130E-6 + 5.0523E-8*T - 1.4346E-11*T**2 + 2.5914E-15*T**3\n", 111 | " \n" 112 | ] 113 | }, 114 | { 115 | "cell_type": "code", 116 | "execution_count": null, 117 | "id": "0b87cbeb", 118 | "metadata": {}, 119 | "outputs": [], 120 | "source": [ 121 | "myair = Air(-200,\"F\")\n", 122 | "print(\"Temperature in K: %.2f\" %myair.T)\n", 123 | "print(\"Kinematic viscosity: %.2e [units], Thermal conductivity: %.4f [units]\" %(myair.nu,myair.k))" 124 | ] 125 | }, 126 | { 127 | "cell_type": "code", 128 | "execution_count": null, 129 | "id": "f887dc6c", 130 | "metadata": {}, 131 | "outputs": [], 132 | "source": [ 133 | "myair = Air(-200,\"C\")" 134 | ] 135 | }, 136 | { 137 | "cell_type": "code", 138 | "execution_count": null, 139 | "id": "5fdbb9f2", 140 | "metadata": {}, 141 | "outputs": [], 142 | "source": [ 143 | "myair = Air(2000,\"k\")" 144 | ] 145 | }, 146 | { 147 | "cell_type": "code", 148 | "execution_count": null, 149 | "id": "8a8c3729", 150 | "metadata": {}, 151 | "outputs": [], 152 | "source": [ 153 | "myair = Air(2000,\"K\")\n", 154 | "print(\"Dynamic viscosity: %.2e [units], Thermal diffusivity: %.2e [units]\" %(myair.mu,myair.alpha))" 155 | ] 156 | }, 157 | { 158 | "cell_type": "code", 159 | "execution_count": null, 160 | "id": "618ff68d", 161 | "metadata": {}, 162 | "outputs": [], 163 | "source": [ 164 | "T = np.logspace(2,np.log10(2999.),1000)\n", 165 | "rho = np.zeros_like(T)\n", 166 | "for i in range(T.shape[0]):\n", 167 | " # Your code here" 168 | ] 169 | }, 170 | { 171 | "cell_type": "code", 172 | "execution_count": null, 173 | "id": "d67d9ede", 174 | "metadata": {}, 175 | "outputs": [], 176 | "source": [ 177 | "plt.figure(figsize=(3,2),dpi=100)\n", 178 | "# your line plot here\n", 179 | "plt.xlabel(\"$T\\;(\\mathrm{units})$\")\n", 180 | "plt.ylabel(r\"$\\rho\\;(\\mathrm{units})$\")\n", 181 | "plt.show()" 182 | ] 183 | }, 184 | { 185 | "cell_type": "markdown", 186 | "id": "b4054fd7", 187 | "metadata": {}, 188 | "source": [ 189 | "## Pb 2 Window\n", 190 | "\n", 191 | "Set up equations and apply realistic numerical values to them to discuss heat losses of a single pane window, a single pane window with storm window and a double paned window with air trapped at a vacuum of $10^{-3} \\mathrm{torr}$ ina gap of $5\\mathrm{mm}$. Do not consider the effects of radiation for any of the window.\n", 192 | "\n", 193 | "\"my\n", 194 | "\n", 195 | "#### Assumptions:\n", 196 | "* Heat transfer is steady and 1D\n", 197 | "* Radiation is ignored\n", 198 | "* Convection in the gap of the storm window is neglected\n", 199 | "* The temperature on the inside and outside surfaces of any window are isothermal and equal to $T_{si}=10^\\circ\\mathrm{C}$ and $T_{so}=-10^\\circ\\mathrm{C}$, respectively.\n", 200 | "* For the storm window, and the double pane window, the average temperature in the gap between the two glass pane is assumed to the average of $T_{si}$ and $T_{so}$ or $T_{mean}=0^\\circ\\mathrm{C}$.\n", 201 | "\n" 202 | ] 203 | }, 204 | { 205 | "cell_type": "markdown", 206 | "id": "bd483448", 207 | "metadata": {}, 208 | "source": [ 209 | "#### Setup\n", 210 | "\n", 211 | "In this cell you are expected to:\n", 212 | "* Insert your sketches of the single pane and double pane windows showing heat fluxes, temperatures at boundaries and dimensions\n", 213 | "* Store in folder `MyFigures`. Change the names `your-single-pane-sketch` and `your-double-pane-sketch` in the HTML command below to include your figures to this cell.\n", 214 | "* Complete a **worded** write-up of the solutions (for both windows) including equations written in LaTeX\n", 215 | "\n", 216 | "\"my\n", 217 | "\"my\n", 218 | "\n", 219 | "*This is the type of introduction of your work that is expected in this class for any deliverable*\n", 220 | "\n", 221 | "The goal is to compute the heat loss from a model window under controlled conditions. We choose to fix the inside surface temperature to $10^\\circ\\mathrm{C}$ and the outside surface temperature to $-10^\\circ\\mathrm{C}$ for a window of height and width $h = 1.2\\;\\mathrm{m}$ and $w = 0.7\\;\\mathrm{m}$ with a surface aera $A=h\\times w$. The thickness of a residential window pane is $t_{glass}=3/32\\,\\mathrm{in}$ (https://ringerwindows.com/thick-glass-windows/) with a thermal conductivity $k=0.96\\;\\mathrm{W/m.K}$. The storm window has a $2.5\\,\\mathrm{in}$.\n", 222 | "\n", 223 | "The heat rate for a single window pane is...\n", 224 | "*Your derivation of the solution here*\n" 225 | ] 226 | }, 227 | { 228 | "cell_type": "code", 229 | "execution_count": null, 230 | "id": "3a7346e0", 231 | "metadata": {}, 232 | "outputs": [], 233 | "source": [ 234 | "import numpy as np\n", 235 | "from Libraries import thermodynamics as thermo\n", 236 | "T_si = 10. #C\n", 237 | "T_so = -10. #C\n", 238 | "h = 1.2 #m\n", 239 | "w = 0.7 #m\n", 240 | "t_glass = 3./32.*0.0254 #m\n", 241 | "k_glass = 0.96\n", 242 | "A = h*w\n", 243 | "t_gap_storm = 2*0.0254 #m\n", 244 | "# getting thermodynamic properties of air for the storm window\n", 245 | "air_gap_storm = thermo.Fluid('air',thermo.C2K(0.))\n", 246 | "t_gap_vacuum = 0.005#m\n", 247 | "k_vacuum = xxxx #W/m.K (from graph)\n", 248 | "R_glass = \n", 249 | "R_gap_storm = \n", 250 | "R_gap_vacuum = \n", 251 | "R_total_single = \n", 252 | "R_total_storm = \n", 253 | "R_total_double = \n", 254 | "\n", 255 | "print(\"Thermal conductivity of air at 0 C: %.4f\" %air_gap_storm.k)\n", 256 | "print(\"Thermal resistance for the single window: %.4f K/W\" %R_total_single)\n", 257 | "print(\"Thermal resistance for the storm window: %.4f K/W\" %R_total_storm)\n", 258 | "print(\"Thermal resistance for the double pane window: %.4f K/W\" %R_total_double)\n", 259 | "\n", 260 | "DT = T_si - T_so\n", 261 | "q_single = DT/R_total_single\n", 262 | "q_storm = DT/R_total_storm\n", 263 | "q_double = DT/R_total_double\n", 264 | "print(\"Single window pane q: %.0f W\" %q_single)\n", 265 | "print(\"Storm window q: %.0f W\" %q_storm)\n", 266 | "print(\"Double pane window q: %.0f W\" %q_double)" 267 | ] 268 | }, 269 | { 270 | "cell_type": "code", 271 | "execution_count": null, 272 | "id": "7d75b9d4", 273 | "metadata": {}, 274 | "outputs": [], 275 | "source": [] 276 | } 277 | ], 278 | "metadata": { 279 | "kernelspec": { 280 | "display_name": "Python 3 (ipykernel)", 281 | "language": "python", 282 | "name": "python3" 283 | }, 284 | "language_info": { 285 | "codemirror_mode": { 286 | "name": "ipython", 287 | "version": 3 288 | }, 289 | "file_extension": ".py", 290 | "mimetype": "text/x-python", 291 | "name": "python", 292 | "nbconvert_exporter": "python", 293 | "pygments_lexer": "ipython3", 294 | "version": "3.9.13" 295 | } 296 | }, 297 | "nbformat": 4, 298 | "nbformat_minor": 5 299 | } 300 | -------------------------------------------------------------------------------- /ME144-HW-04-11.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "cbbb79f1", 6 | "metadata": {}, 7 | "source": [ 8 | "# Homework Assignment due \n", 9 | "\n", 10 | "## Problem 1\n", 11 | "A thermos bottle has an inner diameter of $7\\;\\mathrm{mm}$ is $10\\;\\mathrm{cm}$ tall. The wall is composed of a sealed air chamber of thickness $1\\;\\mathrm{mm}$ sandwiched between two thin cylinders of stainless steal, $k_{stst}=15\\;\\mathrm{W/(m.K)}$, of thickness $2\\;\\mathrm{mm}$. The goal is to hold tea as close as possible to its ideal temperature of $80\\,^\\circ\\mathrm{C}$ for an hour in some of the weather we have had recently. For an ambient air at $T_\\infty=-20\\,^\\circ\\mathrm{C}$ and a wind of $10\\;\\mathrm{m/s}$, the convection coefficient around the bottle is $h = 28.7\\times10^3\\;\\mathrm{W/(m^2.K)}$. The radiation heat transfer is assumed to be negligible. All heat transfer calculations are assumed to be 1D.\n", 12 | "\n", 13 | "* 1.) Calculate the heat rate of the system if the air chamber is at atmospheric pressure $k_{air}=0.022\\;\\mathrm{W/(m.K)}$\n", 14 | "* 2.) Typical thermos bottles are designed with the air chamber vacuumed at about $10^{-3}\\;\\mathrm{torr}$ resulting in a thermal conductivity of $3\\times10^{-3}\\;\\mathrm{W/m.K}$. Calculate the new heat rate.\n", 15 | "* 3.) Describe briefly the microscopic phenomenon that causes vacuum air to reduce so significantly the heat rate.\n", 16 | "* 4.) Assuming that there is no heat loss from the bottom or the lid, give an estimate of the temperature loss of the tea per second in the vacuumed and non-vacuumed scenario. To do this you only need to apply the guiding principle of heat transfer (see equation sheet) and remember that thermal energy is $\\rho C_p T$, where the tea density is $1000\\;\\mathrm{kg/m^3}$ and $C_p= 4198.\\;\\mathrm{J/(kg.K)}$\n", 17 | "* 5.) Compute the heat loss from a lid made of $3 \\;\\mathrm{mm}$ of plastic with a conductivity of $5\\;\\mathrm{W/(m.K)}$. What is your conclusion regarding the ability of this thermos to hold your tea warm? If you can assume that heat loss rate is constant, how long would it take for your tea to be cold (decide what is cold based on your preference)?" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": 1, 23 | "id": "843a3ff4", 24 | "metadata": {}, 25 | "outputs": [], 26 | "source": [ 27 | "import numpy as np\n", 28 | "import matplotlib.pyplot as plt\n", 29 | "from Libraries import thermodynamics as thermo\n", 30 | "from Libraries import HT_thermal_resistance as res\n", 31 | "im" 32 | ] 33 | }, 34 | { 35 | "cell_type": "code", 36 | "execution_count": 3, 37 | "id": "14e6fddf", 38 | "metadata": {}, 39 | "outputs": [], 40 | "source": [ 41 | "L = 0.1 #m Height\n", 42 | "ri = 0.07 #m Inside radius\n", 43 | "t_sts = 0.002 #m Stainless steal wall thickness\n", 44 | "k_sts = 15 #W/m.K thermal conductivity of stainless steal wall\n", 45 | "t_gap = 0.001 #m \n", 46 | "k_gap_atm = 2.2e-2 #W/m.K air chamber without vacuum\n", 47 | "k_gap_vac = 3.0e-3 #W/m.K air chamber with vacuum\n", 48 | "h = 28000 #W/m^2.K convection coefficient\n", 49 | "T_i = 80 #C\n", 50 | "T_inf = -20 #C\n", 51 | "\n", 52 | "r1 = ri + t_sts\n", 53 | "r2 = r1 + t_gap\n", 54 | "ro = r2 + t_sts\n", 55 | "\n", 56 | "A_o = 2*np.pi*ro**2*L\n", 57 | "\n", 58 | "R = []\n", 59 | "# Conduction through Inner wall\n", 60 | "R.append(res.Resistance(\"$R_{cond,w1}$\", \"W\"))\n", 61 | "# Conduction through air gap \n", 62 | "R.append(res.Resistance(\"$R_{cond,a}$\", \"W\"))\n", 63 | "# Conduction through outer wall\n", 64 | "R.append(res.Resistance(\"$R_{cond,w2}$\", \"W\"))\n", 65 | "# Conduction through convection\n", 66 | "R.append(res.Resistance(\"$R_{conv}$\", \"W\"))\n", 67 | "\n" 68 | ] 69 | }, 70 | { 71 | "cell_type": "markdown", 72 | "id": "0bcaacce", 73 | "metadata": {}, 74 | "source": [] 75 | }, 76 | { 77 | "cell_type": "code", 78 | "execution_count": 4, 79 | "id": "6c2e5bdf", 80 | "metadata": {}, 81 | "outputs": [], 82 | "source": [ 83 | "\n", 84 | "R[0].cond_cylinder(k_sts,ra=ri,rb=r1,L=L)\n", 85 | "R[1].cond_cylinder(k_gap_atm,ra=r1,rb=r2,L=L)\n", 86 | "R[2].cond_cylinder(k_sts,ra=r2,rb=ro,L=L)\n", 87 | "R[3].convection(h,A=A_o)\n" 88 | ] 89 | }, 90 | { 91 | "cell_type": "code", 92 | "execution_count": 5, 93 | "id": "c21e9015", 94 | "metadata": {}, 95 | "outputs": [], 96 | "source": [ 97 | "R_tot_atm = res.serial_sum(R,0,3)" 98 | ] 99 | }, 100 | { 101 | "cell_type": "code", 102 | "execution_count": 9, 103 | "id": "f999a92d", 104 | "metadata": {}, 105 | "outputs": [], 106 | "source": [ 107 | "R[1].cond_cylinder(k_gap_vac,ra=r1,rb=r2,L=L)\n", 108 | "R_tot_vac = res.serial_sum(R,0,3)" 109 | ] 110 | }, 111 | { 112 | "cell_type": "code", 113 | "execution_count": 10, 114 | "id": "0083d356", 115 | "metadata": {}, 116 | "outputs": [ 117 | { 118 | "data": { 119 | "text/latex": [ 120 | "$\\displaystyle 7.33366778491278$" 121 | ], 122 | "text/plain": [ 123 | "7.333667784912777" 124 | ] 125 | }, 126 | "execution_count": 10, 127 | "metadata": {}, 128 | "output_type": "execute_result" 129 | } 130 | ], 131 | "source": [ 132 | "R_tot_vac" 133 | ] 134 | }, 135 | { 136 | "cell_type": "code", 137 | "execution_count": 12, 138 | "id": "05887af4", 139 | "metadata": {}, 140 | "outputs": [], 141 | "source": [ 142 | "q_atm = 1/R_tot_atm*(T_i - T_inf)\n", 143 | "q_vac = 1/R_tot_vac*(T_i - T_inf)" 144 | ] 145 | }, 146 | { 147 | "cell_type": "code", 148 | "execution_count": 14, 149 | "id": "316786a1", 150 | "metadata": {}, 151 | "outputs": [ 152 | { 153 | "data": { 154 | "text/latex": [ 155 | "$\\displaystyle 13.635741750632$" 156 | ], 157 | "text/plain": [ 158 | "13.635741750631993" 159 | ] 160 | }, 161 | "execution_count": 14, 162 | "metadata": {}, 163 | "output_type": "execute_result" 164 | } 165 | ], 166 | "source": [ 167 | "q_vac" 168 | ] 169 | }, 170 | { 171 | "cell_type": "code", 172 | "execution_count": null, 173 | "id": "083deacc", 174 | "metadata": {}, 175 | "outputs": [], 176 | "source": [ 177 | "print(\"Without vacuum, the heat rate is \")" 178 | ] 179 | }, 180 | { 181 | "cell_type": "markdown", 182 | "id": "d5fb74e9", 183 | "metadata": {}, 184 | "source": [ 185 | "## Problem 2\n", 186 | "\n", 187 | "The key to a happy skier is to maintain the surface temperature of your skin larger than $20^\\circ\\mathrm{C}$. The objective is to determine the heat flux generated by a thin electrical heater (resistance) inserted on the top of the liner, i.e. between the liner and the sock. All calculations will assume 1D planar heat transfer and to be performed per unit surface area. The study is also limited to the heat transfer from the top of the foot only. The body is assumed to be at constant temperature $36^\\circ\\mathrm{C}$, or $309^\\circ\\mathrm{K}$, which is the inner boundary condition for a skin/fat layer of thickness $3\\;\\mathrm{mm}$ and $k_{skin}=3\\times10^{-1}\\;\\mathrm{W/(m.K)}$. The skin is covered by a sock of thickness $2.5\\;\\mathrm{mm}$ and $k_{sock}=7.5\\;\\mathrm{W/(m.K)}$. The liner of the boot is made of polymer fibers, thickness $5\\;\\mathrm{mm}$ and $k_\\text{liner}=6\\;\\mathrm{W/(m.K)}$ and the shell is carbon fiber, thickness $3\\;\\mathrm{mm}$ and $k_\\text{shell}=10\\;\\mathrm{W/(m.K)}$ with emissivity $\\varepsilon=0.9$. The air is at $T_\\infty= -20^\\circ\\mathrm{C}=253^\\circ\\mathrm{C}$ and the convection coefficient is $h=50\\;\\mathrm{W/(m^2.K)}$\n", 188 | "* 1.) Calculate the heat rate without the heating resistance. For radiation you will use the radiation coefficient heat transfer $h_r=\\varepsilon\\sigma(T_s+T_\\infty)(T_s^2+T_\\infty^2)$, where $\\sigma = 5.67\\times10^{-8}\\;\\mathrm{W/(m^2.K^4)}$ and $T_s$ is the boot surface temperature (outside surface). Take a guess for $T_s$ (between $T_0$ and $T_\\infty$), calculate the total flux. From the total flux, calculate $T_s$ and iterate once more. What is the skin surface temperature?\n", 189 | "* 2.) Modify your thermal circuit to include the thin heater between the sock and the liner and write the conservation of energy in terms of heat fluxes\n", 190 | "* 3.) What heat flux must the heating resistance generate to maintain the skin temperature at $25^\\circ\\mathrm{C}$ under the present conditions?\n", 191 | "* 4.) Calculate the boot outer surface temperature $T_s$.\n", 192 | "* 5.) Without any additional calculation, what is the most preferable material for a sock: wool, $k_\\text{wool}=7.5\\;\\mathrm{W/(m.K)}$, or cotton, $k_\\text{cotton}=17.5\\;\\mathrm{W/(m.K)}$?\n", 193 | "\n" 194 | ] 195 | }, 196 | { 197 | "cell_type": "code", 198 | "execution_count": null, 199 | "id": "ff142774", 200 | "metadata": {}, 201 | "outputs": [], 202 | "source": [] 203 | }, 204 | { 205 | "cell_type": "markdown", 206 | "id": "e100ec1d", 207 | "metadata": {}, 208 | "source": [ 209 | "## Problem 3\n", 210 | "\n", 211 | "To defog the rear window of an automobile, a very thin transparent heating element is attached to the inner surface of the window. A uniform flux $q''_{h}$ is provided to the heating element to maintain the inner surface of the window at a desired temperature $T_{s,i}$ . The window's thickness is $t=5mm$ and the thermal conductivity is $k=1.2\\;\\mathrm{W/m.K}$ . The interior temperature of the automobile is $T_{\\infty,i}=22^\\circ\\mathrm{C}$ and the convection coefficient is $h_i=15\\;\\mathrm{W/m^2.K}$ The outside ambient temperature is $t_{\\infty,o}=-5^\\circ C$ and the convection heat transfer is $h_o=100\\;\\mathrm{W/m^2.K}$. \n", 212 | "\n", 213 | "* 1.) Define your assumptions.\n", 214 | "* 2.) Sketch the thermal circuit of the system.\n", 215 | "* 3.) Write all equations necessary to solve this problem.\n", 216 | "* 4.) Determine the heat flux for $T_{s,i}=15^\\circ\\mathrm{C}$.\n", 217 | "\n", 218 | "The rear window is now tinted with an emissivity $\\varepsilon=0.8$. Radiation is assumed to take place only from the outer surface of the window to the outside. The sky temperature for radiation is $T_{sur}=T_{sky} = 5^\\circ\\mathrm{C}$ and the desired inner surface temperature is still $T_{s,i}=15^\\circ\\mathrm{C}$. \n", 219 | "* 5.) Sketch the new thermal circuit.\n", 220 | "* 6.) Write all equations necessary to solve this problem.\n", 221 | "* 7.) Determine the necessary heater heat flux to maintain. $T_{s,i}=15^\\circ\\mathrm{C}$" 222 | ] 223 | }, 224 | { 225 | "cell_type": "code", 226 | "execution_count": null, 227 | "id": "cc5423a1", 228 | "metadata": {}, 229 | "outputs": [], 230 | "source": [] 231 | }, 232 | { 233 | "cell_type": "markdown", 234 | "id": "95aade5f", 235 | "metadata": {}, 236 | "source": [ 237 | "## Problem 4\n", 238 | "\n", 239 | "\n", 240 | "A fluid at uniform temperature $T_i = 500^\\circ\\mathrm{K}$ is contained in an insulation blanket comprised of two semi-cylindrical shells of different materials. The outside ambient conditions are $T_\\infty = 300^\\circ\\mathrm{K}$ and $h = 25\\;\\mathrm{W/m^2.K}$. The thermal conductivities of the two materials are $k_A = 2\\;\\mathrm{W/m.K}$ and $k_B = 0.25\\;\\mathrm{W/m.K}$, respectively. The inner and outer diameters are $r_1 = 50\\;\\mathrm{mm}$ and $r_2 = 100\\;\\mathrm{mm}$.\n", 241 | "\n", 242 | "\n", 243 | "\n", 244 | "Assuming that the source of heating for the inside fluid stops suddenly. What is the initial rate of temperature change for a fluid of density $\\rho = 1000\\;\\mathrm{kg/m^3}$ and $C_p = 4000\\;\\mathrm{J/kg.K}$? If you have enough time left, show that the heat loss is $1040\\;\\mathrm{W/m}$.\n", 245 | "\n", 246 | "* 1.) Draw the thermal circuit.\n", 247 | "* 2.) Assuming that the source of heating for the inside fluid stops suddenly and the fluid temperature is spatially uniform (but varies in time). Derive the equation governing the rate of temperature change in the fluid ($dT/dt$)?\n", 248 | "* 3.) What is the initial rate of temperature change?\n", 249 | "* 4.) Bonus: Plot the evolution of temperature over time" 250 | ] 251 | }, 252 | { 253 | "cell_type": "code", 254 | "execution_count": null, 255 | "id": "458e6b3c", 256 | "metadata": {}, 257 | "outputs": [], 258 | "source": [] 259 | } 260 | ], 261 | "metadata": { 262 | "kernelspec": { 263 | "display_name": "Python 3 (ipykernel)", 264 | "language": "python", 265 | "name": "python3" 266 | }, 267 | "language_info": { 268 | "codemirror_mode": { 269 | "name": "ipython", 270 | "version": 3 271 | }, 272 | "file_extension": ".py", 273 | "mimetype": "text/x-python", 274 | "name": "python", 275 | "nbconvert_exporter": "python", 276 | "pygments_lexer": "ipython3", 277 | "version": "3.10.10" 278 | } 279 | }, 280 | "nbformat": 4, 281 | "nbformat_minor": 5 282 | } 283 | -------------------------------------------------------------------------------- /HW-01.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "0cc46860", 6 | "metadata": {}, 7 | "source": [ 8 | "# Homework Assignment 2\n", 9 | "\n", 10 | "Complete this notebook, export to pdf (`File>Download as> PDF (via LaTeX)`) and submit the pdf to BB" 11 | ] 12 | }, 13 | { 14 | "cell_type": "markdown", 15 | "id": "85aecba7", 16 | "metadata": {}, 17 | "source": [ 18 | "## Pb 1: Air thermodynamic properties class\n", 19 | "\n", 20 | "The concept of class is central to most libraries. It consists of the definition of an object, which has specific properties, data and function.\n", 21 | "\n", 22 | "Zografos et al. (*Compt. Methods Appl. Mech Eng.*, 61:177-187, 1987) proposed polynomials to compute density, dynamic viscosity, thermal conductivity, and specific heat at constant temperature of air at atmospheric pressure as a function of the static temperature $T$ on the Kelvin scale as follows:\n", 23 | "* Density $\\rho$ in units of $\\mathrm{kg/m^3}$:\n", 24 | "\n", 25 | "$$\n", 26 | "\\rho=\\begin{cases}\n", 27 | "-2.440\\times10^{-2}T+5.9958\\,, & 100\\,\\mathrm{K}\\leq T<150\\,\\mathrm{K}\\\\\n", 28 | "345.57(T-2.6884)^{-1}\\,, & 150\\,\\mathrm{K}\\leq T\\leq 3000\\,\\mathrm{K}\n", 29 | "\\end{cases}\n", 30 | "$$\n", 31 | "* Dynamic viscosity $\\mu$ in units of $\\mathrm{N.s/m^2}=\\mathrm{kg/(m.s)}=\\mathrm{Pa.s}$:\n", 32 | "\n", 33 | "$$\n", 34 | "\\mu = 4.1130\\times10^{-6} + 5.0523\\times10^{-8}T - 1.4346\\times10^{-11}T^2+2.5914\\times10^{-15}T^3\n", 35 | "$$\n", 36 | "\n", 37 | "* Thermal conductivity $k$ in units of $\\mathrm{W/(m.K)}$:\n", 38 | "\n", 39 | "$$\n", 40 | "k= -7.488\\times10^{-3} + 1.7082\\times10^{-4}T - 2.3758\\times10^{-10}T^2 + 2.2012\\times10^{-10}T^3 \\\\\n", 41 | " + 9.4600\\times10^{-14}T^4 + 1.5797\\times10^{-17}T^5\n", 42 | "$$\n", 43 | "\n", 44 | "* Specific heat at constant pressure $c_p$ in unites of $\\mathrm{J/(kg.K)}$:\n", 45 | "\n", 46 | "$$\n", 47 | "c_p=1061.332-0.432819T + 1.02344\\times10^{-3}T^2 - 6.47474\\times10^{-7}T^3 + 1.3864\\times10^{-10}T^4\n", 48 | "$$\n", 49 | "\n", 50 | "Air density $\\rho$ of units $\\mathrm{kg/m^3}$ can be computed from \n", 51 | "\n", 52 | "The Prandtl number $Pr$ can be computed as\n", 53 | "\n", 54 | "$$\n", 55 | "Pr=\\frac{\\mu c_p}{k}\n", 56 | "$$\n", 57 | "\n", 58 | "and the thermal conductivity $\\alpha$ of units $\\mathrm{m^2/s}$ as\n", 59 | "\n", 60 | "$$\n", 61 | "\\alpha = \\frac{k}{\\rho c_p}\n", 62 | "$$\n", 63 | "\n", 64 | "Write a class storing all these variables for input temperature (float) and unit used for temperature (string, it can only be \"K\", \"C\", \"F\"). The class should convert the temperature to Kelvin if unit is either \"C\" or \"F\"). The class should give a warning if \n", 65 | "* the temperature is outside of the range,\n", 66 | "* the unit is not \"K\", \"C\", \"F\", e.g. \"c\"\n", 67 | "\n", 68 | "### Tasks\n", 69 | "* Complete the manual part of the class (text between \"\"\" xxxx \"\"\"), i.e. write appropriate units. \n", 70 | "* Complete the class to compute all quantities defined in the manual.\n", 71 | "* Apply your class to the examples below.\n", 72 | "* Define units for examples.\n", 73 | "* Plot density as function of temperature in the range $10^2\\leq T<3000$. Use log-scale for temperature. Axes must be labeled with their variables and units." 74 | ] 75 | }, 76 | { 77 | "cell_type": "code", 78 | "execution_count": null, 79 | "id": "97650df2", 80 | "metadata": {}, 81 | "outputs": [], 82 | "source": [ 83 | "import numpy as np\n", 84 | "import math\n", 85 | "import matplotlib.pyplot as plt\n", 86 | "class Air:\n", 87 | " \"\"\"\n", 88 | " Returns an object containing the thermodynamic properties of air at atmospheric pressure\n", 89 | " Input: \n", 90 | " T: temperature (float)\n", 91 | " Tunit: unit of temperature (string). Can only be \"K\", \"C\", \"F\"\n", 92 | " output:\n", 93 | " self.rho: density [kg/m^3]\n", 94 | " self.mu: dynamic viscosity [write units here]\n", 95 | " self.k: thermal conductivity [write units here]\n", 96 | " self.cp: Specific heat at constant pressure [write units here]\n", 97 | " self.Pr: Prandtl number\n", 98 | " self.nu: kinematic viscosity [write units here]\n", 99 | " self.alpha: thermal diffusivity [write units here]\n", 100 | " \"\"\"\n", 101 | " def __init__(self,T,Tunit):\n", 102 | " if Tunit == \"C\":\n", 103 | " T += 273.15\n", 104 | " elif Tunit == \"F\":\n", 105 | " T = (T - 32)*5/9 +273.15\n", 106 | " elif Tunit != \"K\":\n", 107 | " print(\"Wrong input for unit of temperature\")\n", 108 | " print(\"Input should be 'K', 'C', or 'F'\")\n", 109 | " self.T = T\n", 110 | " self.mu = 4.1130E-6 + 5.0523E-8*T - 1.4346E-11*T**2 + 2.5914E-15*T**3\n", 111 | " \n" 112 | ] 113 | }, 114 | { 115 | "cell_type": "code", 116 | "execution_count": null, 117 | "id": "0b87cbeb", 118 | "metadata": {}, 119 | "outputs": [], 120 | "source": [ 121 | "myair = Air(-200,\"F\")\n", 122 | "print(\"Temperature in K: %.2f\" %myair.T)\n", 123 | "print(\"Kinematic viscosity: %.2e [units], Thermal conductivity: %.4f [units]\" %(myair.nu,myair.k))" 124 | ] 125 | }, 126 | { 127 | "cell_type": "code", 128 | "execution_count": null, 129 | "id": "f887dc6c", 130 | "metadata": {}, 131 | "outputs": [], 132 | "source": [ 133 | "myair = Air(-200,\"C\")" 134 | ] 135 | }, 136 | { 137 | "cell_type": "code", 138 | "execution_count": null, 139 | "id": "5fdbb9f2", 140 | "metadata": {}, 141 | "outputs": [], 142 | "source": [ 143 | "myair = Air(2000,\"k\")" 144 | ] 145 | }, 146 | { 147 | "cell_type": "code", 148 | "execution_count": null, 149 | "id": "8a8c3729", 150 | "metadata": {}, 151 | "outputs": [], 152 | "source": [ 153 | "myair = Air(2000,\"K\")\n", 154 | "print(\"Dynamic viscosity: %.2e [units], Thermal diffusivity: %.2e [units]\" %(myair.mu,myair.alpha))" 155 | ] 156 | }, 157 | { 158 | "cell_type": "code", 159 | "execution_count": null, 160 | "id": "618ff68d", 161 | "metadata": {}, 162 | "outputs": [], 163 | "source": [ 164 | "T = np.logspace(2,np.log10(2999.),1000)\n", 165 | "rho = np.zeros_like(T)\n", 166 | "for i in range(T.shape[0]):\n", 167 | " # Your code here" 168 | ] 169 | }, 170 | { 171 | "cell_type": "code", 172 | "execution_count": null, 173 | "id": "d67d9ede", 174 | "metadata": {}, 175 | "outputs": [], 176 | "source": [ 177 | "plt.figure(figsize=(3,2),dpi=100)\n", 178 | "# your line plot here\n", 179 | "plt.xlabel(\"$T\\;(\\mathrm{units})$\")\n", 180 | "plt.ylabel(r\"$\\rho\\;(\\mathrm{units})$\")\n", 181 | "plt.show()" 182 | ] 183 | }, 184 | { 185 | "cell_type": "markdown", 186 | "id": "b4054fd7", 187 | "metadata": {}, 188 | "source": [ 189 | "## Pb 2 Window\n", 190 | "\n", 191 | "Set up equations and apply realistic numerical values to them to discuss heat losses of a single pane window, a single pane window with storm window and a double paned window with air trapped at a vacuum of $10^{-3} \\mathrm{torr}$ ina gap of $5\\mathrm{mm}$. Do not consider the effects of radiation for any of the window.\n", 192 | "\n", 193 | "\"my\n", 194 | "\n", 195 | "#### Assumptions:\n", 196 | "* Heat transfer is steady and 1D\n", 197 | "* Radiation is ignored\n", 198 | "* Convection in the gap of the storm window is neglected\n", 199 | "* The temperature on the inside and outside surfaces of any window are isothermal and equal to $T_{si}=10^\\circ\\mathrm{C}$ and $T_{so}=-10^\\circ\\mathrm{C}$, respectively.\n", 200 | "* For the storm window, and the double pane window, the average temperature in the gap between the two glass pane is assumed to the average of $T_{si}$ and $T_{so}$ or $T_{mean}=0^\\circ\\mathrm{C}$.\n", 201 | "\n" 202 | ] 203 | }, 204 | { 205 | "cell_type": "markdown", 206 | "id": "bd483448", 207 | "metadata": {}, 208 | "source": [ 209 | "#### Setup\n", 210 | "\n", 211 | "In this cell you are expected to:\n", 212 | "* Insert your sketches of the single pane and double pane windows showing heat fluxes, temperatures at boundaries and dimensions\n", 213 | "* Store in folder `MyFigures`. Change the names `your-single-pane-sketch` and `your-double-pane-sketch` in the HTML command below to include your figures to this cell.\n", 214 | "* Complete a **worded** write-up of the solutions (for both windows) including equations written in LaTeX\n", 215 | "\n", 216 | "\"my\n", 217 | "\"my\n", 218 | "\n", 219 | "*This is the type of introduction of your work that is expected in this class for any deliverable*\n", 220 | "\n", 221 | "The goal is to compute the heat loss from a model window under controlled conditions. We choose to fix the inside surface temperature to $10^\\circ\\mathrm{C}$ and the outside surface temperature to $-10^\\circ\\mathrm{C}$ for a window of height and width $h = 1.2\\;\\mathrm{m}$ and $w = 0.7\\;\\mathrm{m}$ with a surface aera $A=h\\times w$. The thickness of a residential window pane is $t_{glass}=3/32\\,\\mathrm{in}$ (https://ringerwindows.com/thick-glass-windows/) with a thermal conductivity $k=0.96\\;\\mathrm{W/m.K}$. The storm window has a $2.5\\,\\mathrm{in}$.\n", 222 | "\n", 223 | "The heat rate for a single window pane is...\n", 224 | "*Your derivation of the solution here*\n" 225 | ] 226 | }, 227 | { 228 | "cell_type": "code", 229 | "execution_count": null, 230 | "id": "3a7346e0", 231 | "metadata": {}, 232 | "outputs": [], 233 | "source": [ 234 | "import numpy as np\n", 235 | "from Libraries import thermodynamics as thermo\n", 236 | "T_si = 10. #C\n", 237 | "T_so = -10. #C\n", 238 | "h = 1.2 #m\n", 239 | "w = 0.7 #m\n", 240 | "t_glass = 3./32.*0.0254 #m\n", 241 | "k_glass = 0.96\n", 242 | "A = h*w\n", 243 | "t_gap_storm = 2*0.0254 #m\n", 244 | "# getting thermodynamic properties of air for the storm window\n", 245 | "air_gap_storm = thermo.Fluid('air',thermo.C2K(0.))\n", 246 | "t_gap_vacuum = 0.005#m\n", 247 | "k_vacuum = xxxx #W/m.K (from graph)\n", 248 | "R_glass = \n", 249 | "R_gap_storm = \n", 250 | "R_gap_vacuum = \n", 251 | "R_total_single = \n", 252 | "R_total_storm = \n", 253 | "R_total_double = \n", 254 | "\n", 255 | "print(\"Thermal conductivity of air at 0 C: %.4f\" %air_gap_storm.k)\n", 256 | "print(\"Thermal resistance for the single window: %.4f K/W\" %R_total_single)\n", 257 | "print(\"Thermal resistance for the storm window: %.4f K/W\" %R_total_storm)\n", 258 | "print(\"Thermal resistance for the double pane window: %.4f K/W\" %R_total_double)\n", 259 | "\n", 260 | "DT = T_si - T_so\n", 261 | "q_single = DT/R_total_single\n", 262 | "q_storm = DT/R_total_storm\n", 263 | "q_double = DT/R_total_double\n", 264 | "print(\"Single window pane q: %.0f W\" %q_single)\n", 265 | "print(\"Storm window q: %.0f W\" %q_storm)\n", 266 | "print(\"Double pane window q: %.0f W\" %q_double)" 267 | ] 268 | }, 269 | { 270 | "cell_type": "markdown", 271 | "id": "a8f4fc81", 272 | "metadata": {}, 273 | "source": [ 274 | "## Pb 3\n", 275 | "A plate of metal of mass $m=4.25 kg$, specific heat $C_p= 2770 J/kg.K$ and surface area $0.4m\\times0.4m$ is cooled in ambient air at temperature $T_\\infty=25^\\circ C$. The plate is thin enough and its thermal conductivity high enough that the plate is assumed to be isothermal at any time. At a given time, the plate temperature is $T_s = 245^\\circ C$ and the rate of temperature cooling is\n", 276 | "$$\n", 277 | "\\frac{dT}{dt}=-0.028 K/s\n", 278 | "$$\n", 279 | "\n", 280 | "Find the convection heat transfer coefficient from conservation of energy applied to the plate." 281 | ] 282 | }, 283 | { 284 | "cell_type": "code", 285 | "execution_count": null, 286 | "id": "344068f6", 287 | "metadata": {}, 288 | "outputs": [], 289 | "source": [] 290 | }, 291 | { 292 | "cell_type": "markdown", 293 | "id": "3b915796", 294 | "metadata": {}, 295 | "source": [ 296 | "## Pb 4 Radiation in a vacuum \n", 297 | "\n", 298 | "The same plate as above is now in a vacuum (no flow). Using all conditions defined in 01.1, determine the emissivity of the plate and the heat rate at which radiation is emitted from the plate. Assume that $T_{sur}=T_\\infty$. " 299 | ] 300 | }, 301 | { 302 | "cell_type": "code", 303 | "execution_count": null, 304 | "id": "ed0da580", 305 | "metadata": {}, 306 | "outputs": [], 307 | "source": [] 308 | }, 309 | { 310 | "cell_type": "code", 311 | "execution_count": null, 312 | "id": "57e3221d", 313 | "metadata": {}, 314 | "outputs": [], 315 | "source": [] 316 | } 317 | ], 318 | "metadata": { 319 | "kernelspec": { 320 | "display_name": "Python 3 (ipykernel)", 321 | "language": "python", 322 | "name": "python3" 323 | }, 324 | "language_info": { 325 | "codemirror_mode": { 326 | "name": "ipython", 327 | "version": 3 328 | }, 329 | "file_extension": ".py", 330 | "mimetype": "text/x-python", 331 | "name": "python", 332 | "nbconvert_exporter": "python", 333 | "pygments_lexer": "ipython3", 334 | "version": "3.9.13" 335 | } 336 | }, 337 | "nbformat": 4, 338 | "nbformat_minor": 5 339 | } 340 | -------------------------------------------------------------------------------- /.ipynb_checkpoints/HT-ablation-BL-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# External convection flow\n", 8 | "\n", 9 | "## Flat plate\n", 10 | "\n", 11 | "In the heating or cooling of a plate by a flow (or a flow by a plate), the quantities of interest are\n", 12 | "* Reynolds number and Prandtl number based on the thermodynamics of the **fluid** at **film temperature**.\n", 13 | "* Boundary layer thickness and thermal boundary layer thickness\n", 14 | "* Local and average coefficients of friction\n", 15 | "* Local and average oefficients of convection heat transfer obtained through a Nusselt number correlation\n" 16 | ] 17 | }, 18 | { 19 | "cell_type": "markdown", 20 | "metadata": {}, 21 | "source": [ 22 | "# Design of a low temperature ablation experimental facility\n", 23 | "\n", 24 | "During atmopheric entry, the heat shield of a space vehicle experiences tremendous heat load and aggressive chemical reactions. On some materials, the formation of roughness patterns is observed. These patterns are caused by the local ablation of the matieral. Roughness may cause extra heat flux through increased turbulence that could lead to the failure of the heat shield. The mechanisms by which such ablation or erosion patterns are formed are poorly understood, leaving engineers with few if any ability to predict the outcome of the heat shield. \n", 25 | "\n", 26 | "Here we consider a simple system made out of a plate of wax of thickness $0.05\\text{ m}$ in order to study this system in a lab without worrying about high-temperatures.\n", 27 | "\n", 28 | "The local ablation velocity of wax $V_a(x)$ (i.e. the removal rate of solid wax) is derived from a conservation of energy:\n", 29 | "\n", 30 | "$$\n", 31 | "\\rho_{wax}h_lV_a(x) =\\begin{cases}\\max\\left(q''_\\text{conv}-q''_\\text{cond},0\\right)&\\mathrm{if}\\; T_s(x)\\geq T_m\\\\\n", 32 | "0& \\text{otherwise}\\end{cases}\n", 33 | "$$\n", 34 | "\n", 35 | "where $\\rho_{wax}=900\\,\\mathrm{kg}/\\mathrm{m}^3$ is the wax density, $h_l= 200\\;\\mathrm{kJ}/\\mathrm{kg}$ is the latent heat of wax and $q''_\\text{conv}$ and $q''_\\text{cond}$ are the *local* heat fluxes by convection and conduction, respectively. $T_s(x)$ an $T_m$ are the *local* surface temperature, and the surface temperature, respectively.\n", 36 | "\n", 37 | "The goal is to study the formation of erosion patterns on the surface of the wax plate, thus we are interested in maximumizing the ablation velocity. We will consider two fluids, air and water. \n", 38 | "\n", 39 | "For both case, the bottom of the wax plate is maintained at constant temperature $T_\\text{cool}=20^\\circ\\mathrm{C}$. \n", 40 | "In the following, you are asked to find the initial ablation velocity assuming that (a) the plate has not started to melt yet and (b) the flow-exposed surface is at melting temperature $T_\\text{melt}=50^\\circ\\mathrm{C}$. The thermal conductivity of wax is $k_{wax}=0.25\\mathrm{W}/\\mathrm{m.K}$ and radiation heat transfer is neglected." 41 | ] 42 | }, 43 | { 44 | "cell_type": "markdown", 45 | "metadata": {}, 46 | "source": [ 47 | "2.1 The upstream air flow velocity is $10 \\,\\mathrm{m/s}$ and its upstream temperature is $150^\\circ\\mathrm{C}$. Plot the evolution of the initial ablation velocity in $\\mathrm{mm/s}$ and/or give its values for $x=0.01,0.1,0.2,0.5,1.0\\mathrm{m}$. The leading edge is a very thin, adiabatic rounded edge." 48 | ] 49 | }, 50 | { 51 | "cell_type": "markdown", 52 | "metadata": {}, 53 | "source": [ 54 | "### Assumptions\n", 55 | "\n", 56 | "* Radiation is negligible\n", 57 | "* Leading edge does not trip boundary layer into turbulent regime\n", 58 | "* Heat transfer is predominantly vertical, we use the 1D approximation.\n", 59 | "* Both horizontal surfaces of the wax slab are isothermal.\n", 60 | "\n", 61 | "\n", 62 | "\"my\n", 63 | "\n", 64 | "The ablation velocity is given by the equation above. The conduction heat flux within the wax slab is\n", 65 | "$$\n", 66 | "q''_{cond}=\\frac{k_{wax}}{t_{wax}}(T_m-T_{cool})\n", 67 | "$$\n", 68 | "\n", 69 | "The convection heat flux is defined as\n", 70 | "$$\n", 71 | "q''_{conv}(x)=h(x)(T_\\infty-T_m)\n", 72 | "$$\n", 73 | "and $h(x)$ is given by the correlation for external convection over a flat plate. \n", 74 | "\n", 75 | "The flow starts in the laminar regime and may transition to turbulence if $Re_{x=L}$ is larger than $Re_{c}\\approx 5\\times10^5$.\n", 76 | "\n", 77 | "Flow thermodynamics properties are determined at the film temperature:\n", 78 | "$$\n", 79 | "T_f=\\frac{T_m+T_\\infty}{2}\n", 80 | "$$" 81 | ] 82 | }, 83 | { 84 | "cell_type": "code", 85 | "execution_count": 55, 86 | "metadata": {}, 87 | "outputs": [ 88 | { 89 | "data": { 90 | "image/png": "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\n", 91 | "text/plain": [ 92 | "
" 93 | ] 94 | }, 95 | "metadata": { 96 | "needs_background": "light" 97 | }, 98 | "output_type": "display_data" 99 | } 100 | ], 101 | "source": [ 102 | "from Libraries import thermodynamics as thermo\n", 103 | "from Libraries import HT_external_convection as extconv\n", 104 | "import numpy as np\n", 105 | "import matplotlib.pyplot as plt\n", 106 | "import scipy.constants as csts\n", 107 | "\n", 108 | "# Upstream air properties:\n", 109 | "U_infty = 10. #m/s\n", 110 | "T_infty = 300. #C\n", 111 | "\n", 112 | "#Melting surface \n", 113 | "T_melt = 50. #C\n", 114 | "\n", 115 | "#Bottom temperature\n", 116 | "T_cool = 20. #C\n", 117 | "\n", 118 | "#Wax properties\n", 119 | "k_wax = 0.25 #W/m.K\n", 120 | "rho_wax = 900. #kg/m^3\n", 121 | "h_L_wax = 200.e3 #J/kg\n", 122 | "t_wax = 0.05 #m\n", 123 | "L_plate = 1. #m\n", 124 | "\n", 125 | "# conduction heat flux in the wax\n", 126 | "qpp_cond = k_wax*(T_melt - T_cool)/t_wax\n", 127 | "\n", 128 | "def Va(qpp, Ts):\n", 129 | " global T_melt, rho_wax, h_L_wax, qpp_cond\n", 130 | " if (Ts >= T_melt):\n", 131 | " Va = np.maximum.reduce([(qpp - qpp_cond)/(rho_wax*h_L_wax), 0.])\n", 132 | " else:\n", 133 | " Va = 0.\n", 134 | " return Va\n", 135 | "\n", 136 | "# convection heat flux\n", 137 | "T_f = (T_melt + T_infty)/2.\n", 138 | "airprop = thermo.Fluid('air',thermo.C2K(T_f))\n", 139 | "airconv = extconv.FlatPlate('mixed','isothermal',U_infty,airprop.nu,airprop.alpha,1.)\n", 140 | "\n", 141 | "npts = 500\n", 142 | "x = np.logspace(-3,0,npts)\n", 143 | "Va_x = np.zeros_like(x)\n", 144 | "for i in range(npts):\n", 145 | " xlocal = x[i]\n", 146 | " airconv.local(xlocal)\n", 147 | " hx = airconv.Nu_x*airprop.k/xlocal\n", 148 | " qpp_x = hx*(T_infty - T_melt)\n", 149 | " Va_x[i] = Va(qpp_x,T_melt)\n", 150 | "\n", 151 | "# plt.figure(figsize(3,2),dpi=150)\n", 152 | "plt.plot(x,Va_x*1e3)\n", 153 | "plt.xlabel(\"$x\\;(\\mathrm{m})$\")\n", 154 | "plt.ylabel(\"$Va\\;(\\mathrm{mm}/\\mathrm{s})$\")\n", 155 | "plt.show()" 156 | ] 157 | }, 158 | { 159 | "cell_type": "code", 160 | "execution_count": 47, 161 | "metadata": {}, 162 | "outputs": [ 163 | { 164 | "data": { 165 | "text/latex": [ 166 | "$\\displaystyle 4.5842204364201207e-05$" 167 | ], 168 | "text/plain": [ 169 | "4.5842204364201207e-05" 170 | ] 171 | }, 172 | "execution_count": 47, 173 | "metadata": {}, 174 | "output_type": "execute_result" 175 | } 176 | ], 177 | "source": [] 178 | }, 179 | { 180 | "cell_type": "code", 181 | "execution_count": 43, 182 | "metadata": {}, 183 | "outputs": [], 184 | "source": [ 185 | "?extconv.FlatPlate" 186 | ] 187 | }, 188 | { 189 | "cell_type": "markdown", 190 | "metadata": {}, 191 | "source": [ 192 | "2.2 The upstream water flow velocity is $1 \\mathrm{m/s}$ and its upstream temperature is $99^\\circ\\mathrm{C}$. Plot the evolution of the initial ablation velocity in $\\text{mm/s}$ and/or give its values for $x=0.01,0.1,0.2,0.5,1.0\\mathrm{m}$. Discuss which fluid is more likley to achieve the formation of the deepest erosion-driven roughness." 193 | ] 194 | }, 195 | { 196 | "cell_type": "code", 197 | "execution_count": null, 198 | "metadata": {}, 199 | "outputs": [], 200 | "source": [] 201 | } 202 | ], 203 | "metadata": { 204 | "kernelspec": { 205 | "display_name": "Python 3", 206 | "language": "python", 207 | "name": "python3" 208 | }, 209 | "language_info": { 210 | "codemirror_mode": { 211 | "name": "ipython", 212 | "version": 3 213 | }, 214 | "file_extension": ".py", 215 | "mimetype": "text/x-python", 216 | "name": "python", 217 | "nbconvert_exporter": "python", 218 | "pygments_lexer": "ipython3", 219 | "version": "3.8.5" 220 | } 221 | }, 222 | "nbformat": 4, 223 | "nbformat_minor": 4 224 | } 225 | -------------------------------------------------------------------------------- /.ipynb_checkpoints/HTpy-Lecture9-1DConduction-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# 1D Thermal Boundary Conduction: Boundary Conditions, Plans, Cylindrical and Spherical Conduction, Thermal Resistance" 8 | ] 9 | }, 10 | { 11 | "cell_type": "markdown", 12 | "metadata": {}, 13 | "source": [ 14 | "Local heat flux is measured by the phenomenological Fourier's Law:\n", 15 | "$$\n", 16 | "\\vec{q}''=-k\\vec{\\nabla}T\n", 17 | "$$\n", 18 | "where $k$ is the local thermal conduction, W/(m.K), and the gradient of temperature $\\vec{\\nabla}T$. Since the latter is effectively a temperature difference, temperature may be expressed in Kelvin or Celsius.\n", 19 | "In the previous notebook, we established that in steady-state, planar, 1D conduction, the heat flux (and heat rate) in an homogenous material is proportional to the temperature difference between the boundaries of the material:\n", 20 | "$$\n", 21 | "q''=-\\frac{\\Delta T}{R''} \\text{ and } q=-\\frac{\\Delta T}{R}\n", 22 | "$$\n", 23 | "where the thermal resistances for heat flux and heat rate are\n", 24 | "$$\n", 25 | "R''=\\frac{L}{k}\\text{ and }R=\\frac{L}{kA}\n", 26 | "$$\n", 27 | "$A$ is the cross sectional area of the material.\n", 28 | "\n", 29 | "In this notebook, you will learn how to calculate heat flux with various boundary conditions and in different geometries. We will still limit heat transfer within the system of interest to pure conduction." 30 | ] 31 | }, 32 | { 33 | "cell_type": "markdown", 34 | "metadata": {}, 35 | "source": [ 36 | "## 1. Boundary Conditions" 37 | ] 38 | }, 39 | { 40 | "cell_type": "markdown", 41 | "metadata": {}, 42 | "source": [ 43 | "In the previous notebook, we saw that the solution of a heat transfer problem requires the knowledge of heat transfer at the boundaries of the domain of interest. This section defines the possible scenarios for boundary conditions.\n", 44 | "
" 45 | ] 46 | }, 47 | { 48 | "cell_type": "markdown", 49 | "metadata": {}, 50 | "source": [ 51 | "### 1.1 Imposed Temperature (Isothermal)" 52 | ] 53 | }, 54 | { 55 | "cell_type": "markdown", 56 | "metadata": {}, 57 | "source": [ 58 | "This is the first scenario in the above figure: $T_{s0}$ and and $T_{s3}$ are fixed, the flux is a consequence. This condition is called isothermal, and its mathematical name is the Dirichlet condition." 59 | ] 60 | }, 61 | { 62 | "cell_type": "markdown", 63 | "metadata": {}, 64 | "source": [ 65 | "### 1.2 Imposed Flux" 66 | ] 67 | }, 68 | { 69 | "cell_type": "markdown", 70 | "metadata": {}, 71 | "source": [ 72 | "If the wall is heated by an electric resistance for instance, the heat flux is fixed. The mathematical name is the Neumann condition. A special case is the adiabatic condition when $q_\\infty''=0$ (no heat transfer). In this case, the interface temperature $T_{s0}$ is governed by the imposed flux " 73 | ] 74 | }, 75 | { 76 | "cell_type": "markdown", 77 | "metadata": {}, 78 | "source": [ 79 | "### 1.3 Convection Heat Transfer" 80 | ] 81 | }, 82 | { 83 | "cell_type": "markdown", 84 | "metadata": {}, 85 | "source": [ 86 | "When a surface is cooled or warmed by a flowing fluid, the heat transfer is convection driven. There are three types of convection:\n", 87 | "\n", 92 | "For now, convection heat transfer is modeled as\n", 93 | "$$\n", 94 | "q_\\text{conv}=hA\\left(T_{\\infty,0}-T_{s,0}\\right)\n", 95 | "$$\n", 96 | "and $h$ is the convection heat transfer coefficient, which is a function of the nature of the fluid, the flow characteristics, and the temperature scales involved. We will learn to determine $h$ later on. Until then, $h$ will be provided.\n", 97 | "\n", 98 | "The thermal resistance of convection heat transfer is\n", 99 | "$$\n", 100 | "R_\\text{conv}''=\\frac{1}{h}\\text{ and }R_\\text{conv}=\\frac{1}{hA}\n", 101 | "$$\n" 102 | ] 103 | }, 104 | { 105 | "cell_type": "markdown", 106 | "metadata": {}, 107 | "source": [ 108 | "### 1.4 Radiation Heat Transfer" 109 | ] 110 | }, 111 | { 112 | "cell_type": "markdown", 113 | "metadata": {}, 114 | "source": [ 115 | "The last mode of heat transfer is radiation. For now, we consider radiation between a small surface at temperature $T_\\text{s}$ and a vast surrounding at temperature $T_\\text{sur}$. The surface of interest is characterized by an emissivity $0\\leq\\varepsilon\\leq1$. Thermal radiation is energy emitted by matter and transported by electromagnetic waves. \n", 116 | "For now, we consider radiation from a small surface tThe radiation heat flux, or radiation heat transfer per unit area is\n", 117 | "$$\n", 118 | "q_\\text{rad}''=\\frac{q}{A}=\\varepsilon\\sigma\\left(T_\\text{s}^4-T_\\text{sur}^4\\right)\n", 119 | "$$\n", 120 | "where $\\sigma=5.67\\times10^8 \\text{W/(m}^2\\text{K}^4$ is the Stefan Boltzmann constant.\n", 121 | "\n", 122 | "You should note that the temperature should always be expressed in Kelvin when dealing with radiation. \n", 123 | "\n", 124 | "The radiation heat transfer coefficient is\n", 125 | "$$\n", 126 | "h_\\text{rad}=\\varepsilon\\sigma\\left(T_\\text{s}+T_\\text{sur}\\right)\\left(T_\\text{s}^2+T_\\text{sur}^2\\right)\n", 127 | "$$\n", 128 | "yielding\n", 129 | "$$\n", 130 | "q_\\text{rad}=h_\\text{rad}A\\left(T_\\text{s}-T_\\text{sur}\\right)\n", 131 | "$$\n", 132 | "and the thermal resitance of radiation heat transfer:\n", 133 | "$$\n", 134 | "R_\\text{rad}=\\frac{1}{h_\\text{rad}A}\n", 135 | "$$\n" 136 | ] 137 | }, 138 | { 139 | "cell_type": "markdown", 140 | "metadata": {}, 141 | "source": [ 142 | "## 2. Cylindrical walls" 143 | ] 144 | }, 145 | { 146 | "cell_type": "markdown", 147 | "metadata": {}, 148 | "source": [ 149 | "In many systems, heat transfer occurs between a fluid transported between two points: heating in building, mass transport in chemical and food processing plants, etc... Typically, ducts are cylindrical. Why?" 150 | ] 151 | }, 152 | { 153 | "cell_type": "markdown", 154 | "metadata": {}, 155 | "source": [ 156 | "Consider an pipe of thickness $r_\\text{out}-r_\\text{in}$, where $r_\\text{in}$ and $r_\\text{out}$ are inner and outer radii, which are at constant temperatures $T_\\text{in}>T_\\text{out}$. To solve this problem, we proposed to\n", 157 | "
    \n", 158 | "
  1. Assume 1D conduction heat transfer: The transport of heat is assumed to be purely radial, no heat escapes in other directions.
  2. \n", 159 | "
  3. Divide the system in $n$ shells of constant thickness. The cylindrical shell numbered $i$ is defined by the volume between the cylindrical surfaces $r_i-\\Delta r/2$ and $r_i+\\Delta r/2$. The cylindrical surface at the center of the cell has the radius\n", 160 | "$$\n", 161 | "r_i=r_\\text{in}+i.\\Delta r\\text{ with } \\Delta r=\\frac{r_\\text{out}-r_\\text{in}}{n-1}\n", 162 | "$$
  4. \n", 163 | "
\n", 164 | "Since the problem is 1D, the temperature is constant on any cylindrical surface of radius $r\\in\\left[r_\\text{in},r_\\text{out}\\right]$. \n", 165 | "\n", 166 | "Writing the conservation of energy between cylindrical shells results in\n", 167 | "$$\n", 168 | "-2\\pi\\left(r_i-\\frac{\\Delta r}{2}\\right)Lk\\frac{T_{i}-T_{i-1}}{\\Delta r}=\n", 169 | "-2\\pi\\left(r_i+\\frac{\\Delta r}{2}\\right)Lk\\frac{T_{i+1}-T_{i}}{\\Delta r}\n", 170 | "$$\n", 171 | "This equation states that the heat rate crossing surface $r_i-\\Delta r/2$ is equal to the heat rate crossing surface $r_i+\\Delta r/2$. You should recognise the surface area of the form $2\\pi r L$ and the Fourier's Law $-k(T_i-T_{i-1})/\\Delta r$. " 172 | ] 173 | }, 174 | { 175 | "cell_type": "markdown", 176 | "metadata": {}, 177 | "source": [ 178 | "The conservation of energy or heat rate can be recast in a matrix friendly form:\n", 179 | "$$\n", 180 | "\\left(r_i-\\frac{\\Delta r}{2}\\right)T_{i-1}-2r_iT_{i}+\\left(r_i+\\frac{\\Delta r}{2}\\right)T_{i+1}=0\n", 181 | "$$\n", 182 | "Note that in this particular problem the temperature distribution does not depend upon the thermal conductivity of the cylinder.\n", 183 | "\n", 184 | "The boundary conditions are simply:\n", 185 | "$$\n", 186 | "T_0=T_\\text{in}\\text{ and }T_{n-1}=T_\\text{out}\n", 187 | "$$\n", 188 | "and the system in matrix form looks like this:" 189 | ] 190 | }, 191 | { 192 | "cell_type": "markdown", 193 | "metadata": {}, 194 | "source": [ 195 | "$$\n", 196 | "\\left(\\begin{array}{ccccccc}\n", 197 | "1 & 0 & \\ldots & \\ldots & \\ldots & \\ldots & 0 \\\\\n", 198 | "r_{\\frac{1}{2}} & -2r_1 & r_{\\frac{3}{2}} & & & & \\vdots \\\\\n", 199 | "0 &\\ddots & \\ddots & \\ddots & & & \\vdots\\\\\n", 200 | "\\vdots & & r_{i-\\frac{1}{2}} & -2r_i & r_{i+\\frac{1}{2}} & & \\vdots\\\\\n", 201 | "\\vdots & & & \\ddots & \\ddots & \\ddots & 0\\\\\n", 202 | "\\vdots & & & & r_{n-\\frac{5}{2}} & -2r_{n-2} & r_{n-\\frac{3}{2}}\\\\ \n", 203 | "0 & \\ldots & \\ldots & \\ldots & \\ldots & 0 & 1\\\\\n", 204 | "\\end{array}\\right)\n", 205 | "\\left(\\begin{array}{c}\n", 206 | "T_0\\\\\n", 207 | "%T_1\\\\\n", 208 | "\\vdots \\\\\n", 209 | "T_{i-2} \\\\\n", 210 | "T_{i} \\\\\n", 211 | "T_{i+1} \\\\\n", 212 | "\\vdots \\\\\n", 213 | "%T_{n-2}\\\\\n", 214 | "T_{n-1}\\\\\n", 215 | "\\end{array}\\right)=\n", 216 | "\\left(\\begin{array}{c}\n", 217 | "T_\\text{in}\\\\\n", 218 | "0\\\\\n", 219 | "\\vdots \\\\\n", 220 | "\\vdots \\\\\n", 221 | "\\vdots \\\\\n", 222 | "0\\\\\n", 223 | "T_\\text{out}\\\\\n", 224 | "\\end{array}\\right)\n", 225 | "$$" 226 | ] 227 | }, 228 | { 229 | "cell_type": "code", 230 | "execution_count": null, 231 | "metadata": {}, 232 | "outputs": [], 233 | "source": [ 234 | "%matplotlib inline \n", 235 | "# plots graphs within the notebook\n", 236 | "%config InlineBackend.figure_format='svg' # not sure what this does, may be default images to svg format\n", 237 | "\n", 238 | "import matplotlib.pyplot as plt #calls the plotting library hereafter referred as to plt\n", 239 | "import numpy as np #calls the numerical method library hereafter referred as to np for linear algebra\n", 240 | "\n", 241 | "##############################\n", 242 | "# Parameters #\n", 243 | "##############################\n", 244 | "r_in = 0.1 \n", 245 | "T_in = 10.\n", 246 | "T_out = 100.\n", 247 | "r_out = 10.\n", 248 | "n = 51\n", 249 | "\n", 250 | "##############################\n", 251 | "# Variable definition #\n", 252 | "##############################\n", 253 | "dr = float(r_out-r_in)/float(n-1) #shell thickness\n", 254 | "r = r_in + np.array([i*dr for i in range(n)]) #radius of the center of the shell\n", 255 | "A = np.zeros((n, n)) # pre-allocate [A] array\n", 256 | "b = np.zeros((n, 1)) # pre-allocate {b} column vector\n", 257 | "\n", 258 | "##################################\n", 259 | "# Matrix and vector definition #\n", 260 | "##################################\n", 261 | "A[0, 0] = 1.\n", 262 | "b[0, 0] = T_in\n", 263 | "A[n-1,n-1] = 1.\n", 264 | "b[n-1,0] = T_out\n", 265 | "\n", 266 | "for i in range(1, n-1):\n", 267 | " A[i, i-1] = r[i]-dr/2. # node-1\n", 268 | " A[i, i] = -2.*r[i] # node\n", 269 | " A[i, i+1] = r[i]+dr/2. # node+1\n", 270 | " \n", 271 | "#print('A \\n', A) # if you want to see what you matrix looks like\n", 272 | "#print('B \\n', b)\n", 273 | "\n", 274 | "#---- Solve using numpy.linalg.solve\n", 275 | "\n", 276 | "T = np.linalg.solve(A, b) # solve A*x = B for x\n", 277 | "\n", 278 | "#############################################\n", 279 | "# Compute linear temperature distribution #\n", 280 | "#############################################\n", 281 | "Tlin = np.zeros((n,1)) \n", 282 | "\n", 283 | "for i in range(n):\n", 284 | " Tlin[i] = T_in + (T_out - T_in)*(r[i] - r_in)/(r_out - r_in)\n", 285 | "\n", 286 | "plt.figure(figsize=(6,4), dpi=100)\n", 287 | "plt.plot(r,T, lw=2, label='Computed temperature')\n", 288 | "plt.plot(r,Tlin, lw=2, label='Linear temperature')\n", 289 | "plt.xlim([r_in,r_out])\n", 290 | "plt.ylim([T_out,T_in])\n", 291 | "plt.xlabel('$r$ (m)')\n", 292 | "plt.ylabel('$T$ ($^\\circ$C)')\n", 293 | "plt.legend()\n", 294 | "plt.show" 295 | ] 296 | }, 297 | { 298 | "cell_type": "markdown", 299 | "metadata": {}, 300 | "source": [ 301 | "Play with different number of shells. Is the temperature distribution linear?\n", 302 | "To gain some insights on what type of distribution we are dealing with, we could try to plot in logarithmic-linear and log-log format. This investigation is motivated by the fact that many physical phenomena follow logarithmic or power laws. The former results in a line in a log-lin plot, and the latter in a log-log" 303 | ] 304 | }, 305 | { 306 | "cell_type": "code", 307 | "execution_count": null, 308 | "metadata": {}, 309 | "outputs": [], 310 | "source": [ 311 | "plt.figure(figsize=(10,4), dpi=100)\n", 312 | "plt.subplot(1,2,1)\n", 313 | "plt.plot(r,T, lw=2, label='Computed temperature')\n", 314 | "plt.plot(r,Tlin, lw=2, label='Linear temperature')\n", 315 | "plt.xscale('log')\n", 316 | "plt.xlim([r_in,r_out])\n", 317 | "plt.ylim([T_out,T_in])\n", 318 | "plt.xlabel('$r$ (m)')\n", 319 | "plt.ylabel('$T$ ($^\\circ$C)')\n", 320 | "plt.legend()\n", 321 | "plt.subplot(1,2,2)\n", 322 | "plt.plot(r,T, lw=2, label='Computed temperature')\n", 323 | "plt.plot(r,Tlin, lw=2, label='Linear temperature')\n", 324 | "plt.xscale('log')\n", 325 | "plt.yscale('log')\n", 326 | "plt.xlim([r_in,r_out])\n", 327 | "plt.ylim([T_out,T_in])\n", 328 | "plt.xlabel('$r$ (m)')\n", 329 | "plt.ylabel('$T$ ($^\\circ$C)')\n", 330 | "plt.legend()\n", 331 | "plt.show\n" 332 | ] 333 | }, 334 | { 335 | "cell_type": "markdown", 336 | "metadata": {}, 337 | "source": [ 338 | "Our educated guess payed off! The temperature distribution is obviously logarithmic, i.e.\n", 339 | "$$\n", 340 | "T(r)\\propto\\ln(r)\n", 341 | "$$\n", 342 | "To fit the boundary conditions, this profile ought to be:\n", 343 | "$$\n", 344 | "T(r)=T_\\text{in}+(T_\\text{out}-T_\\text{in})\\cfrac{\\ln\\left(\\cfrac{r}{r_\\text{in}}\\right)}{\\ln\\left(\\cfrac{r_\\text{out}}{r_\\text{in}}\\right)}\n", 345 | "$$\n", 346 | "and we can verify that this is the appropriate function:" 347 | ] 348 | }, 349 | { 350 | "cell_type": "code", 351 | "execution_count": null, 352 | "metadata": {}, 353 | "outputs": [], 354 | "source": [ 355 | "\n", 356 | "Tlog = np.zeros((n,1))\n", 357 | "for i in range(n):\n", 358 | " Tlog[i] = T_in+(T_out-T_in)*np.log(r[i]/r_in)/np.log(r_out/r_in)\n", 359 | "plt.figure(figsize=(10,4), dpi=100)\n", 360 | "plt.subplot(1,2,1)\n", 361 | "plt.plot(r,T, lw=2, label='Computed temperature')\n", 362 | "plt.plot(r,Tlog,marker='o', mfc='none', label='Analytical solution')\n", 363 | "#plt.xscale('log')\n", 364 | "plt.xlim([r_in,r_out])\n", 365 | "plt.ylim([T_out,T_in])\n", 366 | "plt.xlabel('$r$ (m)')\n", 367 | "plt.ylabel('$T$ ($^\\circ$C)')\n", 368 | "plt.legend()\n", 369 | "plt.subplot(1,2,2)\n", 370 | "plt.plot(r,T, lw=2, label='Computed temperature')\n", 371 | "plt.plot(r,Tlog, marker='o', mfc='none', label='Analytical solution')\n", 372 | "plt.xscale('log')\n", 373 | "plt.xlim([r_in,r_out])\n", 374 | "plt.ylim([T_out,T_in])\n", 375 | "plt.xlabel('$r$ (m)')\n", 376 | "plt.ylabel('$T$ ($^\\circ$C)')\n", 377 | "plt.legend()\n", 378 | "plt.show" 379 | ] 380 | }, 381 | { 382 | "cell_type": "markdown", 383 | "metadata": {}, 384 | "source": [ 385 | "Another way to derive the analytical solution is to consider the mathematical definition of Fourier's Law:\n", 386 | "$$\n", 387 | "q''=-k\\vec{\\nabla}T\\text{ which reduces to }q''=-k\\frac{dT}{dr}\\text{ in 1D radial conduction}\n", 388 | "$$\n", 389 | "Conservation of energy dictates that the heat rate be constant of any cylindrical surface of radius $r$. Owing to the expansion of the surface area with $r$, $A=2\\pi r L$ ($L$ is the length of the cylinder), the heat flux is not constant. \n", 390 | "\n", 391 | "Consequently, we have\n", 392 | "$$\n", 393 | "-(2\\pi r L)k\\frac{dT}{dr}=q\\text{ or }r\\frac{dT}{dr}=\\text{constant}=C\n", 394 | "$$\n", 395 | "which leads to:\n", 396 | "$$\n", 397 | "\\frac{dT}{dr}=\\frac{C}{r}\\Rightarrow T(r)=C\\ln(r)+B\n", 398 | "$$\n", 399 | "Consider the heat transfer between two cylindrical surfaces of length $L$ and radii $r_12.K. The pipe wall is 2 mm thick and its thermal conductivity is $k_\\text{p}=14$ W/m.K. The pipe is covered by insulation of thickness 10mm and thermal conductivity $k_\\text{ins}=0.05$ W/m.K. The oustide air is at $T_{\\infty,o}=23^\\circ$C and a convection heat transfer coefficient $h_\\text{o}=6$ W/m2.K. Calculate the heat gain in the fluid, and temperature distribution." 425 | ] 426 | }, 427 | { 428 | "cell_type": "markdown", 429 | "metadata": {}, 430 | "source": [ 431 | "We break the system in cylindrical shells of constant thickness $\\Delta r$. According to Fourier's Law, the heat rates through the boundary at $r_i+\\Delta r/2$ and $r-\\Delta r_i/2$ must be equal and are respectively,\n", 432 | "$$\n", 433 | "-2\\pi\\left(r_i+\\Delta r/2\\right)k_{i-\\frac{1}{2}}\\frac{T_{i}-T_{i-1}}{\\Delta r}=\n", 434 | "-2\\pi\\left(r_i-\\Delta r/2\\right)k_{i+\\frac{1}{2}}\\frac{T_{i+1}-T_{i}}{\\Delta r}\n", 435 | "$$\n", 436 | "After a few simplifications, this identity reduces to\n", 437 | "$$\n", 438 | "\\left(r_i+\\Delta r/2\\right)k_{i-\\frac{1}{2}}T_{i-1}-\\left(\\left(r_i+\\Delta r/2\\right)k_{i-\\frac{1}{2}}+\\left(r_i-\\Delta r/2\\right)k_{i+\\frac{1}{2}}\\right)T_{i}+\\left(r_i-\\Delta r/2\\right)k_{i+\\frac{1}{2}}T_{i+1}=0\n", 439 | "$$\n", 440 | "At the boundaries, the temperature is defined by\n", 441 | "$$\n", 442 | "2\\pi r_0h_o\\left((T_{\\infty,\\text{out}}-T_0\\right)=-2\\pi\\left(r_0-\\Delta r/2\\right)k_\\frac{1}{2}\\frac{T_0-T_1}{\\Delta r}\n", 443 | "$$\n", 444 | "and\n", 445 | "$$\n", 446 | "-2\\pi\\left(r_{n-1}+\\Delta r/2\\right)k_\\frac{1}{2}\\frac{T_{n-2}-T_{n-1}}{\\Delta r}=2\\pi r_{n-1} h_\\text{in}\\left(T_{n-1}-T_{\\infty,\\text{in}}\\right)\n", 447 | "$$" 448 | ] 449 | }, 450 | { 451 | "cell_type": "markdown", 452 | "metadata": {}, 453 | "source": [ 454 | "To summarize the system of equations writes:\n", 455 | "$$\n", 456 | "\\begin{split}\n", 457 | "&-\\left(r_0h_o+\\frac{\\left(r_0-\\Delta r/2\\right)k_\\frac{1}{2}}{\\Delta r}\\right)T_0+\\frac{\\left(r_0-\\Delta r/2\\right)k_\\frac{1}{2}}{\\Delta r}T_1=r_0h_0T_{\\infty,\\text{out}}\\\\\n", 458 | "&\\left(r_i+\\Delta r/2\\right)k_{i-\\frac{1}{2}}T_{i-1}-\\left(\\left(r_i+\\Delta r/2\\right)k_{i-\\frac{1}{2}}+\\left(r_i-\\Delta r/2\\right)k_{i+\\frac{1}{2}}\\right)T_{i}+\\left(r_i-\\Delta r/2\\right)k_{i+\\frac{1}{2}}T_{i+1}=0\\\\\n", 459 | "&\\frac{\\left(r_{n-1}+\\Delta r/2\\right)k_\\frac{1}{2}}{\\Delta r}T_{n-2}-\\left(h_\\text{in}r_{n-1}+\\frac{\\left(r_{n-1}+\\Delta r/2\\right)k_\\frac{1}{2}}{\\Delta r}T_{n-2}\\right)T_{n-1}=h_\\text{in}r_{n-1}T_{\\infty,\\text{in}}\n", 460 | "\\end{split}\n", 461 | "$$" 462 | ] 463 | }, 464 | { 465 | "cell_type": "code", 466 | "execution_count": null, 467 | "metadata": {}, 468 | "outputs": [], 469 | "source": [ 470 | "%matplotlib inline\n", 471 | "%config InlineBackend.figure_format='svg'\n", 472 | "\n", 473 | "import matplotlib.pyplot as plt\n", 474 | "import numpy as np\n", 475 | "\n", 476 | "L = 12e-3 #wall thickness is 2.5 cm\n", 477 | "rout = 30e-3\n", 478 | "rin = 18e-3\n", 479 | "rinterface = 20e-3\n", 480 | "kins=0.05\n", 481 | "kpipe = 0.1\n", 482 | "hout = 6\n", 483 | "hin = 400\n", 484 | "n = 37 # Number of cells in the wall\n", 485 | "Tin = 6. #\n", 486 | "Tout = 23. #\n", 487 | "dr = float(L)/float(n-1) #cell size\n", 488 | "r = rout-np.array([i*dr for i in range(n)])\n", 489 | "A = np.zeros((n, n)) # pre-allocate [A] array\n", 490 | "b = np.zeros((n, 1)) # pre-allocate {b} column vector\n", 491 | "k = np.ones((n, 1))\n", 492 | "\n", 493 | "for i in range(n):\n", 494 | " if (r[i]-dr/2 > rinterface):\n", 495 | " k[i] = kins\n", 496 | " else:\n", 497 | " k[i] = kpipe\n", 498 | " \n", 499 | "A[0, 0] = -(rout*hout+(r[0]-dr/2)/dr*k[0])\n", 500 | "A[0, 1] = (r[0]-dr/2)/dr*k[0]\n", 501 | "b[0, 0] = -rout*hout*Tout\n", 502 | "A[n-1,n-2] = (r[n-1]+dr/2)/dr*k[n-1]\n", 503 | "A[n-1,n-1] = -(rin*hin+(r[n-1]+dr/2)/dr*k[n-1])\n", 504 | "b[n-1,0] = -rin*hin*Tin\n", 505 | "\n", 506 | "for i in range(1, n-1):\n", 507 | " A[i, i-1] = (r[i]+dr/2)/dr*k[i-1] # node-1\n", 508 | " A[i, i] = -(r[i]+dr/2)/dr*k[i-1]-(r[i]-dr/2)/dr*k[i] # node\n", 509 | " A[i, i+1] = (r[i]-dr/2)/dr*k[i] # node+1\n", 510 | " \n", 511 | "#print('A \\n', A)\n", 512 | "#print('B \\n', b)\n", 513 | "\n", 514 | "#---- Solve using numpy.linalg.solve\n", 515 | "\n", 516 | "T = np.linalg.solve(A, b) # solve A*x = B for x\n", 517 | "\n", 518 | "#print('T \\n', T)\n", 519 | "\n", 520 | "plt.figure(figsize=(6,4), dpi=100)\n", 521 | "plt.plot(r,T, lw=2, label='Wall temperature')\n", 522 | "#plt.xlim([0,L])\n", 523 | "#plt.ylim([To,Ti])\n", 524 | "plt.xlabel('$x$ (m)')\n", 525 | "plt.ylabel('$T$ ($^\\circ$C)')\n", 526 | "plt.legend()\n", 527 | "plt.show" 528 | ] 529 | }, 530 | { 531 | "cell_type": "code", 532 | "execution_count": null, 533 | "metadata": {}, 534 | "outputs": [], 535 | "source": [] 536 | }, 537 | { 538 | "cell_type": "code", 539 | "execution_count": null, 540 | "metadata": {}, 541 | "outputs": [], 542 | "source": [] 543 | } 544 | ], 545 | "metadata": { 546 | "kernelspec": { 547 | "display_name": "Python 3", 548 | "language": "python", 549 | "name": "python3" 550 | }, 551 | "language_info": { 552 | "codemirror_mode": { 553 | "name": "ipython", 554 | "version": 3 555 | }, 556 | "file_extension": ".py", 557 | "mimetype": "text/x-python", 558 | "name": "python", 559 | "nbconvert_exporter": "python", 560 | "pygments_lexer": "ipython3", 561 | "version": "3.8.5" 562 | } 563 | }, 564 | "nbformat": 4, 565 | "nbformat_minor": 2 566 | } 567 | -------------------------------------------------------------------------------- /Libraries/HT_external_convection.py: -------------------------------------------------------------------------------- 1 | """ Object name 1: FlatPlate 2 | Object name 2: CircularCylinder 3 | Object name 3: NoncircularCylinder 4 | Object name 4: BankofTubes 5 | """ 6 | 7 | from sympy.interactive import printing 8 | printing.init_printing(use_latex='mathjax') 9 | 10 | 11 | from IPython.display import display,Image, Latex 12 | import numpy as np 13 | import math 14 | import scipy.constants as sc 15 | import sys 16 | try: 17 | import thermodynamics as thermo 18 | except ModuleNotFoundError: 19 | from Libraries import thermodynamics as thermo 20 | import sympy as sym 21 | #from sympy import * 22 | 23 | class FlatPlate(object): 24 | """ Definition of boundary layer thickness, friction coefficient, Nusselt number (both local and average) 25 | as a function of the regime. 26 | import HT_external_convection.py as extconv 27 | 28 | bl =extconv.FlatPlate(regime,thermal_bc,U_infty,nu,alpha,L,xi=0.0,Re_xc=5e5) 29 | where regime = 'laminar' or 'turbulent' or 'mixed', 30 | thermal_bc = 'isothermal', 'heat flux', 'unheated starting length', 31 | U_infty is the free stream velocity, 32 | nu the fluid viscosity, 33 | alpha the fluid thermal diffusivity, 34 | L length of the plate 35 | xi unheated started length (only applies of using unheated starting length) 36 | Re_xc critical Reynolds number for transition laminar to turbulence 37 | 38 | output: bl.Re_L Reynolds at the trailing edge of the plate (x=L) 39 | 40 | bl.local(x) calculates the local Re (bl.Re_x), Cf (bl.Cf_x), Nu (bl.Nu_x) and velocity 41 | thermal boundary layer thicknesses (bl.delta_x and bl.delta_Tx) at x based on thermal_bc 42 | 43 | bl.average(x) calculates the average Cf (bl.C_fave), Nu (bl.Nu_ave) over a length x from the leading edge 44 | 45 | """ 46 | def __init__(self,regime,thermal_bc,U_infty,nu,alpha,L,xi=0.0,Re_xc=5e5): 47 | self.regime = regime 48 | self.thermal_bc = thermal_bc 49 | self.U_infty = U_infty 50 | self.nu = nu 51 | self.alpha = alpha 52 | self.Pr = self.nu/self.alpha 53 | self.L = L 54 | self.xi = xi 55 | self.Re_xc = Re_xc 56 | self.Re_L = self.L*self.U_infty/self.nu 57 | self.x_c = self.Re_xc*self.nu/self.U_infty 58 | if (self.regime != "laminar") and (self.regime != "turbulent") and (self.regime != "mixed"): 59 | print("Warning: regime is not properly defined") 60 | if self.thermal_bc != "isothermal" and self.thermal_bc != "heat flux" and self.thermal_bc != "unheated starting length": 61 | print("Warning: thermal boundary condition is not properly defined") 62 | if self.Re_L > self.Re_xc and self.regime == "laminar": 63 | print("Warning: The end plate Reynolds number is larger than the critical Reynolds number, consider 'mixed' regime instead") 64 | def local(self,x): 65 | self.x = x 66 | self.Re_x = self.U_infty*self.x/self.nu 67 | if x == 0.: 68 | self.delta_x = 0. 69 | self.delta_Tx = 0. 70 | self.Cf_x = 0. 71 | self.Nu_x = 0. 72 | else: 73 | if self.regime == "laminar": 74 | self.delta_x = 5.0*self.x/np.sqrt(self.Re_x) 75 | self.Cf_x = 0.664*np.power(self.Re_x,-1./2.) 76 | if self.thermal_bc == "isothermal": 77 | self.Nu_x = 0.332*np.power(self.Re_x,1./2.)*np.power(self.Pr,1./3.) 78 | elif self.thermal_bc == "heat flux": 79 | self.Nu_x = 0.453*np.power(self.Re_x,1./2.)*np.power(self.Pr,1./3.) 80 | elif self.thermal_bc == "unheated starting length": 81 | self.Re_xi = self.xi*self.U_infty/self.nu 82 | self.Nu_x = 0.332*np.power(self.Re_x,1./2.)*np.power(self.Pr,1./3.)/\ 83 | np.power(1.-np.power(self.xi/self.x,3./4.),1./3.) 84 | elif self.regime == "turbulent": 85 | self.delta_x = 0.37*self.x*np.power(self.Re_x,-1./5.) 86 | self.Cf_x = 0.0592*np.power(self.Re_x,-1./5.) 87 | if self.thermal_bc == "isothermal": 88 | self.Nu_x = 0.0296*np.power(self.Re_x,4./5.)*np.power(self.Pr,1./3.) 89 | elif self.thermal_bc == "heat flux": 90 | self.Nu_x = 0.0296*np.power(self.Re_x,4./5.)*np.power(self.Pr,1./3.) 91 | elif self.thermal_bc == "unheated starting length": 92 | self.Re_xi = self.xi*self.U_infty/self.nu 93 | self.Nu_x = 0.0296*np.power(self.Re_x,4./5.)*np.power(self.Pr,1./3.)/\ 94 | np.power(1.-np.power(self.xi/self.x,9./10.),1./9.) 95 | elif self.regime == "mixed": 96 | if self.x < self.x_c: 97 | self.delta_x = 5.0*self.x/np.sqrt(self.Re_x) 98 | self.Cf_x = 0.664*np.power(self.Re_x,-1./2.) 99 | if self.thermal_bc == "isothermal": 100 | self.Nu_x = 0.332*np.power(self.Re_x,1./2.)*np.power(self.Pr,1./3.) 101 | elif self.thermal_bc == "heat flux": 102 | self.Nu_x = 0.453*np.power(self.Re_x,1./2.)*np.power(self.Pr,1./3.) 103 | elif self.thermal_bc == "unheated starting length": 104 | self.Re_xi = self.xi*self.U_infty/self.nu 105 | self.Nu_x = 0.332*np.power(self.Re_x,1./2.)*np.power(self.Pr,1./3.)/\ 106 | np.power(1.-np.power(self.xi/self.x,3./4.),1./3.) 107 | else: 108 | self.delta_x = 0.37*self.x*np.power(self.Re_x,-1./5.) 109 | self.Cf_x = 0.0592*np.power(self.Re_x,-1./5.) 110 | if self.thermal_bc == "isothermal": 111 | self.Nu_x = 0.0296*np.power(self.Re_x,4./5.)*np.power(self.Pr,1./3.) 112 | elif self.thermal_bc == "heat flux": 113 | self.Nu_x = 0.0296*np.power(self.Re_x,4./5.)*np.power(self.Pr,1./3.) 114 | elif self.thermal_bc == "unheated starting length": 115 | self.Re_xi = self.xi*self.U_infty/self.nu 116 | self.Nu_x = 0.0296*np.power(self.Re_x,4./5.)*np.power(self.Pr,1./3.)/\ 117 | np.power(1.-np.power(self.xi/self.x,9./10.),1./9.) 118 | 119 | self.delta_Tx = self.delta_x*np.power(self.Pr,-1./3.) 120 | def average(self,x): 121 | self.x = x 122 | self.Re_x = self.U_infty*self.x/self.nu 123 | if x == 0.: 124 | print("The length cannot be zero") 125 | if self.regime == "laminar": 126 | self.Cf_ave = 1.328*np.power(self.Re_x,-1./2.) 127 | if self.thermal_bc == "isothermal" or self.thermal_bc == "heat flux": 128 | self.Nu_ave = 0.664*np.power(self.Re_x,1./2.)*np.power(self.Pr,1./3.) 129 | elif self.thermal_bc == "unheated starting length": 130 | p = 2. 131 | self.Re_xi = self.xi*self.U_infty/self.nu 132 | self.Nu_ave = 0.664*np.power(self.Re_x,1./2.)*np.power(self.Pr,1./3.)*\ 133 | x/(x-self.xi)*np.power(1.-np.power(self.xi/x,(p+1.)/(p+2.)),p/(p+1.)) 134 | elif self.regime == "turbulent": 135 | self.Cf_ave = 0.074*np.power(self.Re_x,-1./5.) 136 | if self.thermal_bc == "isothermal" or self.thermal_bc == "heat flux": 137 | self.Nu_ave = 0.037*np.power(self.Re_x,4./5.)*np.power(self.Pr,1./3.) 138 | elif self.thermal_bc == "unheated starting length": 139 | p = 8. 140 | self.Re_xi = self.xi*self.U_infty/self.nu 141 | self.Nu_ave = 0.664*np.power(self.Re_x,1./2.)*np.power(self.Pr,1./3.)*\ 142 | x/(x-self.xi)*np.power(1.-np.power(self.xi/x,(p+1.)/(p+2.)),p/(p+1.)) 143 | elif self.regime == "mixed": 144 | A = 0.037*np.power(self.Re_xc,4./5.)-0.664*np.power(self.Re_xc,1./2.) 145 | 146 | self.C_fave = 0.074*np.power(self.Re_x,-1./5.) - 2.*A/self.Re_x 147 | self.Nu_ave = (0.037*np.power(self.Re_x,4./5.) - A)*np.power(self.Pr,1./3.) 148 | 149 | class CircularCylinder(object): 150 | """ Nusselt correlations for cylinders 151 | import HT_external_convection.py as extconv 152 | 153 | bluff_body =extconv.CircularCylinder(correlation,Re,Pr,Pr_s = 0.0) 154 | where Re, Pr, and Pr_s are the Reynolds number, Prandtl number of the flow and surface Prandtl numbers, respectively. If using Hilpert of Churchill Bernstein correlations, 155 | Re and Pr must be defined at film temperature, Pr_s can be set to anything since it is not used. 156 | If using Zukauskas, Re and Pr are defined at temperature at infinity. 157 | correlation may be 'Hilpert', 'Churchill-Bernstein', 'Zukauskas' 158 | Example: 159 | bluff_body = extconv.CircularCylinder('Hilpert',Re,Pr) 160 | bluff_body = extconv.CircularCylinder('Churchill-Bernstein',Re,Pr) 161 | bluff_body = extconv.CircularCylinder('Zukauskas',Re,Pr,Pr_s = xx) 162 | 163 | Output: bluff_body.Nu average Nusselt number also bluff_body.correlation, bluff_body.Re, bluff_body.Pr, bluff_body.Pr_s 164 | 165 | bluff_body.correlation('Name of the correlation') 166 | Name of the correlation may be 'Hilpert', 'Churchill-Bernstein', 'Zukauskas' 167 | 168 | 169 | """ 170 | def __init__(self,correlation,Re,Pr,Pr_s = 0.0): 171 | self.correlation = correlation 172 | self.Re = Re 173 | self.Pr = Pr 174 | self.Pr_s = Pr_s 175 | if correlation == "Zukauskas" and Pr_s == 0.0: 176 | print("Warning: Zukauskas correlation requires Pr_s") 177 | if self.correlation == "Hilpert": 178 | if self.Re < 0.4: 179 | print("Warning, Reynolds number too low for Hilpert Correlation") 180 | self.Nu = 0. 181 | elif self.Re < 4.: 182 | C = 0.989 183 | m = 0.33 184 | elif self.Re < 40: 185 | C = 0.911 186 | m = 0.385 187 | elif self.Re < 4000: 188 | C = 0.683 189 | m = 0.466 190 | elif self.Re < 40000.: 191 | C = 0.193 192 | m = 0.618 193 | elif self.Re <= 400000.: 194 | C = 0.027 195 | m = 0.805 196 | else : 197 | print("Warning Reynolds number is too high for the Hilpert Correlation") 198 | self.Nu = 0. 199 | if self.Re >= 0.4 and self.Re <= 400000.: 200 | self.Nu = C * self.Re**m * self.Pr**(1./3.) 201 | elif self.correlation == "Churchill-Bernstein": 202 | if (self.Re*self.Pr < 0.2): 203 | print("Warning: Product RePr lower than acceptable limit for Churchill Bernstein Correlation") 204 | self.Nu = 0. 205 | 206 | else: 207 | self.Nu = 0.3+(0.62*self.Re**(0.5)*self.Pr**(1./3.)) \ 208 | /(1.+(0.4/self.Pr)**(2./3.))**(1./4.) \ 209 | *(1.+(self.Re/282000.)**(5./8.))**(4./5.) 210 | elif self.correlation == "Zukauskas": 211 | if (self.Pr <= 10): 212 | n = 0.37 213 | else: 214 | n = 0.36 215 | if (self.Re < 1.) and (self.Re > 1.e6): 216 | print("Warning Reynolds number out of bounds for the Zukauskas Correlation") 217 | self.Nu = 0. 218 | else: 219 | if (self.Re < 40.): 220 | C = 0.75 221 | m = 0.4 222 | elif (self.Re < 1000.): 223 | C = 0.51 224 | m = 0.5 225 | elif (self.Re < 2.e5): 226 | C = 0.26 227 | m = 0.6 228 | else: 229 | C = 0.076 230 | m = 0.7 231 | self.Nu = C*self.Re**m*self.Pr**n*(self.Pr/self.Pr_s)**(1./4.) 232 | 233 | class NonCircularCylinder(object): 234 | """ Nusselt correlations for cylinders with non circular cross-sections. 235 | import HT_external_convection.py as extconv 236 | 237 | bluff_body =extconv.NonCircularCylinder(geometry,Re,Pr) where 238 | geometry = "angled square" square with stagnation point on one of its edges 239 | "square" square with stagnation point at the center of one of its faces 240 | "angled hexagon" hexagon with stagnation point on one of its edges 241 | "hexagon" hexagon with stagnation point at the center of one of its faces 242 | "thin plate" thin plate perpendicular to the flow 243 | Re: Reynolds number at film temperature 244 | Pr: Prandtl number at film temperature 245 | 246 | Output: bluff_body.Nu, bluff_body.Nu_front, bluff_body.Nu_back, the last two are for thin plate only 247 | also bluff_body.geometry, bluff_body.Re, bluff_body.Pr 248 | 249 | """ 250 | def __init__(self,geometry,Re,Pr): 251 | self.geometry = geometry 252 | self.Re = Re 253 | self.Pr = Pr 254 | if self.geometry == "angled square": 255 | self.Nu_front = np.inf 256 | self.Nu_back = np.inf 257 | if self.Re < 6000: 258 | print("Warning, Reynolds number too low for Hilpert Correlation") 259 | self.Nu = np.inf 260 | elif self.Re <= 60000.: 261 | C = 0.304 262 | m = 0.59 263 | self.Nu = C * self.Re**m * self.Pr**(1./3.) 264 | else : 265 | print("Warning Reynolds number is too high for the Hilpert Correlation") 266 | self.Nu = np.inf 267 | elif self.geometry == "square": 268 | self.Nu_front = np.inf 269 | self.Nu_back = np.inf 270 | if self.Re < 5000: 271 | print("Warning, Reynolds number too low for Hilpert Correlation") 272 | self.Nu = np.inf 273 | elif self.Re <= 60000.: 274 | C = 0.158 275 | m = 0.66 276 | self.Nu = C * self.Re**m * self.Pr**(1./3.) 277 | else : 278 | print("Warning Reynolds number is too high for the Hilpert Correlation") 279 | self.Nu = np.inf 280 | elif self.geometry == "angled hexagon": 281 | self.Nu_front = np.inf 282 | self.Nu_back = np.inf 283 | if self.Re < 4500: 284 | print("Warning, Reynolds number too low for Hilpert Correlation") 285 | self.Nu = np.inf 286 | elif self.Re <= 90700.: 287 | C = 0.150 288 | m = 0.638 289 | self.Nu = C * self.Re**m * self.Pr**(1./3.) 290 | else : 291 | print("Warning Reynolds number is too high for the Hilpert Correlation") 292 | self.Nu = np.inf 293 | elif self.geometry == "hexagon": 294 | self.Nu_front = np.inf 295 | self.Nu_back = np.inf 296 | if self.Re < 5200: 297 | print("Warning, Reynolds number too low for Hilpert Correlation") 298 | self.Nu = np.inf 299 | elif self.Re <= 20400.: 300 | C = 0.164 301 | m = 0.638 302 | self.Nu = C * self.Re**m * self.Pr**(1./3.) 303 | elif self.Re <= 105000.: 304 | C = 0.039 305 | m = 0.78 306 | self.Nu = C * self.Re**m * self.Pr**(1./3.) 307 | else : 308 | print("Warning Reynolds number is too high for the Hilpert Correlation") 309 | self.Nu = np.inf 310 | elif self.geometry == "thin plate": 311 | self.Nu = np.inf 312 | if self.Re < 10000: 313 | print("Warning, Reynolds number too low for Hilpert Correlation") 314 | self.Nu_front = np.inf 315 | elif self.Re <= 50000.: 316 | C = 0.667 317 | m = 0.5 318 | self.Nu_front = C * self.Re**m * self.Pr**(1./3.) 319 | else : 320 | print("Warning Reynolds number is too high for the Hilpert Correlation for Nu_front") 321 | self.Nu_back = np.inf 322 | if self.Re < 7000: 323 | print("Warning, Reynolds number too low for Hilpert Correlation") 324 | self.Nu_back = np.inf 325 | elif self.Re <= 80000.: 326 | C = 0.191 327 | m = 0.667 328 | self.Nu_back = C * self.Re**m * self.Pr**(1./3.) 329 | else : 330 | print("Warning Reynolds number is too high for the Hilpert Correlation for Nu_front") 331 | self.Nu_back = np.inf 332 | 333 | class BankofTubes(object): 334 | """ Nusselt correlations for flow across banks of tubes 335 | import HT_external_convection.py as extconv 336 | bank = extconv.BankofTubes('aligned','air',T_i,T_s,T_o,"C",V_i,D,S_L,S_T,N_L=1) 337 | **Input:** 338 | arrangement = "aligned" tubes are aligned in row and column 339 | "staggered" tubes are staggered from one row to the next 340 | fluidspecie = 'air', 'water' or any other specie available in library thermodynamics 341 | T_i = inlet temperature 342 | T_s = tube surface temperature 343 | T_o = outlet temperature, provide a guess < T_s if unknown 344 | V_i: Inlet velocity 345 | S_L: tube center to tube center separation between two consecutive rows (perpendicular to the flow) 346 | S_T: tube center to tube center separation between two consecutive rows (aligned with the flow) 347 | N_L: number of rows aligned with flow if unknown give your best guess (default =1) 348 | 349 | Output: 350 | bank.T_m: arithmetic mean of T_i and T_o 351 | bank.Nu: average Nusselt number 352 | bank.Delta_T_lm: Log mean temperature difference 353 | bank.rho_i: inlet fluid density 354 | bank.mu_m: fluid viscosity at T_m 355 | bank.k_m: fluid thermal conductivity at T_m 356 | bank.Cp_m: Specific heat at T_m 357 | bank.Pr_m: Prandtl number at T_m 358 | bank.Pr_s: Prandtl number at T_s 359 | bank.Vmax: Max fluid velocity based on arrangement 360 | bank.Re: Reynolds number of the system 361 | 362 | bank.Nu: average Nusselt number 363 | bank.hbar: average heat transfer coefficient 364 | 365 | Functions: 366 | bank.heat_rate(N_T,N_L,L=1) creates bank.q, the heat rate per tube length is L is omitted 367 | or total heat rate if L is provided, based on the average convection coefficient 368 | bank.temperature_outlet_tube_banks(N_T,N_L) overwite bank.T_o (useful if T_o is unkown and you provided a 369 | guess. Rerun the object with new T_o to adjust Nu) 370 | bank.pressure_drop(N_L,f,chi) creates bank.Delta_p the pressure drop across the bank. f and chi must 371 | be extrapolated from graphs (see book or notebook) 372 | 373 | 374 | """ 375 | def __init__(self,arrangement,fluidspecie,T_i,T_s,T_o,unit,V_i,D,S_L,S_T,N_L=1): 376 | self.arrangement = arrangement 377 | self.T_i = T_i 378 | self.T_s = T_s 379 | self.V_i = V_i 380 | if (T_o == T_s): 381 | print("T_o and T_s cannot be equal, setting T_o to (T_i+T_s)/2 (think of it as your first guess)") 382 | T_o = (T_i+T_s)/2. 383 | self.T_o = T_o 384 | T_m = (T_i + T_o)/2. 385 | self.T_m = T_m 386 | self.Delta_T_lm = ((T_s-T_i)-(T_s-T_o))/np.log((T_s-T_i)/(T_s-T_o)) 387 | self.fluid = fluidspecie 388 | fluid_i = thermo.Fluid(fluidspecie,T_i,unit) 389 | fluid_m = thermo.Fluid(fluidspecie,T_m,unit) 390 | fluid_s = thermo.Fluid(fluidspecie,T_s,unit) 391 | self.rho_i = fluid_i.rho 392 | self.mu_m = fluid_m.mu 393 | self.k_m = fluid_m.k 394 | self.Cp_m = fluid_m.Cp 395 | self.Pr_m = fluid_m.nu/fluid_m.alpha 396 | self.Pr_s = fluid_s.nu/fluid_s.alpha 397 | self.S_L = S_L 398 | self.S_T = S_T 399 | self.N_L = N_L 400 | self.D = D 401 | if self.arrangement == 'aligned': 402 | self.Vmax = self.S_T*self.V_i/(self.S_T-D) 403 | elif self.arrangement == 'staggered': 404 | self.S_D = np.sqrt(self.S_L**2+(self.S_T/2.)**2) 405 | self.Vmax = self.S_T*V_i/(2.*(self.S_D-D)) 406 | Re = self.rho_i*self.Vmax*self.D/self.mu_m 407 | self.Re = Re 408 | self.Nu = np.inf 409 | Corr_aligned = np.array([0.70,0.80,0.86,0.90,0.92,0.94,0.95,0.96,0.96,0.97,0.97,0.97,0.98,0.99,0.99,0.99,0.99,0.99,0.99]) 410 | Corr_staggered = np.array([0.64,0.76,0.84,0.89,0.92,0.94,0.95,0.96,0.96,0.97,0.97,0.97,0.98,0.99,0.99,0.99,0.99,0.99,0.99]) 411 | if (N_L < 20): 412 | if arrangement == 'aligned': 413 | Corr = Corr_aligned[N_L-1] 414 | elif arrangement == 'staggered': 415 | Corr = Corr_staggered[N_L-1] 416 | else: 417 | Corr = 1. 418 | if (Re < 10.): 419 | print('Warning: Re is out of bounds') 420 | if (Re >= 10.) and (Re <= 100.): 421 | if arrangement == 'aligned': 422 | C = 0.8 423 | m = 0.4 424 | elif arrangement == 'staggered': 425 | C = 0.9 426 | m = 0.4 427 | self.Nu = Corr*C*self.Re**m*self.Pr_m**(0.36)*(self.Pr_m/self.Pr_s)**(1./4.) 428 | elif (Re > 100.) and (Re <= 1000.): 429 | C = 0.51 430 | m = 0. 431 | self.Nu = Corr*C*self.Re**m*self.Pr_m**(0.36)*(self.Pr_m/self.Pr_s)**(1./4.) 432 | elif (Re > 1000.) and (Re <= 2.e5): 433 | if arrangement == 'aligned': 434 | if (S_T/S_L > 0.7): 435 | C = 0.27 436 | m = 0.63 437 | else: 438 | print('Warning: inefficient, S_T/S_L<0.7') 439 | 440 | elif arrangement == 'staggered': 441 | if (S_T/S_L < 2): 442 | C = 0.35*(S_T/S_L)**(1./5.) 443 | m = 0.6 444 | else: 445 | C = 0.40 446 | m = 0.6 447 | self.Nu = Corr*C*self.Re**m*self.Pr_m**(0.36)*(self.Pr_m/self.Pr_s)**(1./4.) 448 | elif (Re > 2e5) and (Re <= 2.e6): 449 | if arrangement == 'aligned': 450 | C = 0.021 451 | m = 0.84 452 | elif arrangement == 'staggered': 453 | C = 0.022 454 | m = 0.84 455 | self.Nu = Corr*C*self.Re**m*self.Pr_m**(0.36)*(self.Pr_m/self.Pr_s)**(1./4.) 456 | else: 457 | print('Warning: Re is out of bounds') 458 | 459 | self.hbar = self.Nu*self.k_m/self.D 460 | self.N_L_for_given_To = -np.log((self.T_s-self.T_o)/(self.T_s-self.T_i))/ \ 461 | (np.pi*self.D*self.hbar)*(self.rho_i*self.V_i*self.S_T*self.Cp_m) 462 | if (self.N_L < 20) and (self.N_L_for_given_To >= 20): 463 | print("WARNING input N_L < 20 but N_L computed for input T_o >=20. \ Rerun your BankofTubes object with the appropriate N_L to calculate the correct Nu") 464 | if (self.N_L < 20) and (self.N_L_for_given_To >= 20): 465 | print("WARNING input N_L >= 20 but N_L computed for input T_o <20. \ Rerun your BankofTubes object with the appropriate N_L to calculate the correct Nu") 466 | 467 | def heat_rate(self,N_T,N_L,L=1): 468 | N = N_T*N_L 469 | if N_L > 20 and self.N_L < 20: 470 | print("WARNING: you chose N_L > 20 but your initial guess was < 20. \ Rerun your BankofTubes object with the appropriate N_L to calculate the correct Nu") 471 | elif N_L < 20 and self.N_L >= 20: 472 | print("WARNING: you chose N_L < 20 but your initial guess was > 20. \ Rerun your BankofTubes object with the appropriate N_L to calculate the correct Nu") 473 | self.q=N*self.hbar*np.pi*self.D*self.Delta_T_lm*L 474 | 475 | 476 | def temperature_outlet_tube_banks(self,N_T,N_L): 477 | if N_L >= 20 and self.N_L < 20: 478 | print("WARNING: you chose N_L > 20 but your initial guess was < 20. \ Rerun your BankofTubes object with the appropriate N_L to calculate the correct Nu") 479 | elif N_L < 20 and self.N_L >= 20: 480 | print("WARNING: you chose N_L < 20 but your initial guess was > 20. \ Rerun your BankofTubes object with the appropriate N_L to calculate the correct Nu") 481 | N = N_T*N_L 482 | self.T_o = self.T_s-(self.T_s-self.T_i)* \ 483 | np.exp(-np.pi*self.D*N*self.hbar/(self.rho_i*self.V_i*N_T*self.S_T*self.Cp_m)) 484 | def pressure_drop(self,N_L,f,chi): 485 | self.Delta_p = N_L*chi*(self.rho_i*self.Vmax**2/2)*f 486 | 487 | 488 | 489 | 490 | 491 | --------------------------------------------------------------------------------