i hate thermo xD

This commit is contained in:
Dane Sabo 2024-12-16 22:39:19 -05:00
parent cb16acdc67
commit 8e22b04161
2 changed files with 134 additions and 100 deletions

View File

@ -14,7 +14,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 1,
"id": "b1dedc02-4383-4c83-b91e-80f4e8a52165",
"metadata": {},
"outputs": [],
@ -290,7 +290,7 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": 2,
"id": "05f73bb9-30ef-4fce-98ef-ef1db81f393d",
"metadata": {},
"outputs": [
@ -365,7 +365,7 @@
"| Stage | Temperature | Pressure | Quality | Enthalpy | Entropy |\n",
"| ----- |----- | ----- | ----- | -----| ----- |\n",
"| 1 - Condenser / P1 | |2.9 psi | 0 | 108.07 BTU/lbm | 0.19869 BTU/lbm-F|\n",
"| 2 - P1/CFWH | |2000 psi|0| 671.797 BTU/lbm| 0.86284 BTU/lbm-F |\n",
"| 2 - P1/CFWH | |2000 psi| | | $s_2$ = $s_1$ = 0.19869 BTU/lbm-F |\n",
"| 3 - CFHW/P2 | |155 psi| 0 | 333.42 BTU/lbm| 0.51747 BTU/lbm-F|\n",
"| 4 - Mix/Boiler | |2000 psi|0| 671.797 BTU/lbm | 0.86284 BTU/lbm-F|\n",
"| 5 - Boiler/HPT |752 F| 2000 psi | |1293.1 BTU/lbm| 1.42335 BTU/lbm-F |\n",
@ -373,12 +373,8 @@
"| 7 - Boiler/LPT |700 F|680 psi| |1346.05 BTU/lbm| 1.57063 BTU/lbm-F|\n",
"| 8 - LPT/CFWH | |155 psi| | |$s_8$ = $s_7$ = 1.57063 BTU/lbm-F |\n",
"| 9 - LPT/Condenser | |2.9 psi| | |$s_9$ = $s_7$ = 1.57063 BTU/lbm-F|\n",
"| 10 - CFWH/Mix | | 2000 psi |0| 671.797 BTU/lbm | 0.86284 BTU/lbm-F|\n",
"| 11 - P2/Mix | | 2000 psi |0| 671.797 BTU/lbm| 0.86284 BTU/lbm-F|\n",
"\n",
"\n",
"\n",
"\n"
"| 10 - CFWH/Mix | | 2000 psi || 671.797 BTU/lbm | 0.86284 BTU/lbm-F|\n",
"| 11 - P2/Mix | | 2000 psi | | | $s_{11}$ = $s_3$ = 0.51747 BTU/lbm-F|"
]
},
{
@ -399,7 +395,7 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": 3,
"id": "085fa335-9198-4923-86d9-efb9ac397280",
"metadata": {},
"outputs": [
@ -450,71 +446,92 @@
"metadata": {},
"source": [
"$$y(h_8 - h_2 - h_3 + h_{10}) = h_{10}-h_2 $$\n",
"$$y = \\frac{h_{10}-h_2}{h_8 - h_2 - h_3 + h_{10}} $$"
"$$y = \\frac{h_{10}-h_2}{h_8 - h_2 - h_3 + h_{10}} $$\n",
"\n",
"Now, we don't know $y$, $h_{11}$, $h_{10}$, or $h_2$.\n",
"\n",
"But we know something about the mixing chamber!\n",
"$$ \\dot m_4 h_4 = \\dot m_{11} h_{11} + \\dot m_{10} h_{10}$$\n",
"$$ \\dot m_7 h_4 = \\dot m_{7} y h_{11} + \\dot m_{7} (1-y) h_{10}$$\n",
"$$ h_4 = y h_{11} + (1-y) h_{10}$$\n",
"$$ h_4 = y h_{11} + h_{10} -y h_{10}$$\n",
"$$ y = \\frac{h_4 - h_{10}}{h_{11} - h_{10}}$$\n",
"\n",
"At this point we have 4 unknowns, 2 equations. Let's look at the boiler:\n",
"$$ Q_{boiler} = \\dot m_4 h_4 - \\dot m_5 h_5 $$\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5bed5dc9-34a9-4aa0-b0c7-c6637ab28774",
"id": "92c15504-e768-4766-84f8-ae20010015b4",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"id": "5bd7f9ab-f870-425d-9dd9-757ae992c3de",
"metadata": {},
"source": [
"#Find h_2\n",
"h_2 = givens.get(2000)['hf']\n",
"###### Find h_2\n",
"x_2 = (givens.get(2.9)['sf'] - givens.get(2000)['sf']) / (givens.get(2000)['sg'] - givens.get(2000)['sf'])\n",
"print(f'x_2 = {x_2:.3f}')\n",
"h_2 = x_2 * (givens.get(2000)['hg'] - givens.get(2000)['hf']) + givens.get(2000)['hf']\n",
"print(f'h_2 = {h_2:.3f} BTU/lbm')\n",
"\n",
"#Find h_10\n",
"h_10 = givens.get(2000)['hf']\n",
"print(f'h_2 = {h_2:.3f} BTU/lbm')\n",
"print(f'h_10 = {h_10:.3f} BTU/lbm')\n",
"\n",
"#Find h_3\n",
"h_10 = givens.get(155)['hf']\n",
"print(f'h_2 = {h_2:.3f} BTU/lbm')\n",
"\n"
"h_3 = givens.get(155)['hf']\n",
"print(f'h_3 = {h_3:.3f} BTU/lbm')"
]
},
{
"cell_type": "markdown",
"id": "df89be07-8172-44bf-900a-46e2108cdd9a",
"id": "7b295ed8-207f-445b-8a60-51dbaaa7012f",
"metadata": {},
"source": [
"Now we also don't know $W_{LPT}$. We need a second equation to find $y$. We get it from the closed water heater, which conserves energy between the two streams:\n",
"\n",
"$$ \\dot m_3 h_3 + \\dot m_{10} h_{10} = \\dot m_2 h_2 + \\dot m_8 h_8 $$\n",
"\n",
"But THIS equation has us going further down the rabbit hole. Must find pump works, then HPT work, then finally we can take the LPT work from that. THEN! We can find y. Things we know though:\n",
"$$\\dot m_3 = \\dot m_7 = \\dot m_{11}$$\n",
"$$\\dot m_{10} = \\dot m_2 = \\dot m_1 = m_9$$\n",
"$$\\dot m_4 = \\dot m_5 = \\dot m_6 = m_7$$\n",
"and also when looking at pumps, we can find the work done by each pump, and work done by the high pressure turbine. We find all of these, and then we can figure out what that LPT work is.\n",
"\n",
"**P1 Work**:\n",
"$$W_{P1} = \\dot m_7 (1-y) (h_2 - h_1)$$\n",
"**P2 Work**:\n",
"$$W_{P2} = \\dot m_7 y (h_{11} - h_3)$$\n",
"\n",
"**Boiler Heat**:\n",
"$$Q_{Boiler} = \\dot m_7 (h_{4} - h_5)$$\n",
"\n",
"**Condenser Heat**:\n",
"$$Q_{Condenser} = \\dot m_7 (1-y) (h_9 - h_1)$$\n",
"\n",
"**CFWH Balance**:\n",
"$$\\dot m_7 y (h_3 - h_7) = \\dot m_7 (1-y) (h_{10} - h_2)$$\n",
"$$y (h_3 - h_7) = (1-y) (h_{10} - h_2)$$\n",
"\n",
"**HPT Work**:\n",
"$$W_{HPT} = \\dot m_7 (h_6 - h_5)$$\n"
"**Part B**\n",
"$$ W_{HPT} = \\dot m_5 h_5 - \\dot m_6 h_6$$"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c7c46329-0ea4-40c5-b0d8-6fd87ce57673",
"execution_count": 17,
"id": "4ce1da3b-82c9-492a-ae75-62bef90d9bae",
"metadata": {},
"outputs": [],
"source": []
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"x_6 = 0.986\n",
"h_6 = 1192.609 BTU/lbm\n",
"\n",
"=========FINAL ANSWER=========\n",
"8b:\n",
"W_HPT = 2.605e+07 BTU/hr\n",
"=========FINAL ANSWER=========\n",
"\n"
]
}
],
"source": [
"# Find quality at 8\n",
"x_6 = (1.42335 - givens.get(680)['sf']) / (givens.get(680)['sg'] - givens.get(680)['sf'])\n",
"print(f'x_6 = {x_6:.3f}')\n",
"\n",
"# Find enthalpy at 8\n",
"h_6 = x_6 * (givens.get(680)['hg'] - givens.get(680)['hf']) + givens.get(680)['hf']\n",
"print(f'h_6 = {h_6:.3f} BTU/lbm')\n",
"\n",
"W_hpt = (72*60*60) *(1293.1 - h_6)\n",
"answer_print('8b', f'W_HPT = {W_hpt:.3e} BTU/hr')\n",
" "
]
},
{
"attachments": {

View File

@ -14,7 +14,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 1,
"id": "b1dedc02-4383-4c83-b91e-80f4e8a52165",
"metadata": {},
"outputs": [],
@ -290,7 +290,7 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": 2,
"id": "05f73bb9-30ef-4fce-98ef-ef1db81f393d",
"metadata": {},
"outputs": [
@ -365,7 +365,7 @@
"| Stage | Temperature | Pressure | Quality | Enthalpy | Entropy |\n",
"| ----- |----- | ----- | ----- | -----| ----- |\n",
"| 1 - Condenser / P1 | |2.9 psi | 0 | 108.07 BTU/lbm | 0.19869 BTU/lbm-F|\n",
"| 2 - P1/CFWH | |2000 psi|0| 671.797 BTU/lbm| 0.86284 BTU/lbm-F |\n",
"| 2 - P1/CFWH | |2000 psi| | | $s_2$ = $s_1$ = 0.19869 BTU/lbm-F |\n",
"| 3 - CFHW/P2 | |155 psi| 0 | 333.42 BTU/lbm| 0.51747 BTU/lbm-F|\n",
"| 4 - Mix/Boiler | |2000 psi|0| 671.797 BTU/lbm | 0.86284 BTU/lbm-F|\n",
"| 5 - Boiler/HPT |752 F| 2000 psi | |1293.1 BTU/lbm| 1.42335 BTU/lbm-F |\n",
@ -373,12 +373,8 @@
"| 7 - Boiler/LPT |700 F|680 psi| |1346.05 BTU/lbm| 1.57063 BTU/lbm-F|\n",
"| 8 - LPT/CFWH | |155 psi| | |$s_8$ = $s_7$ = 1.57063 BTU/lbm-F |\n",
"| 9 - LPT/Condenser | |2.9 psi| | |$s_9$ = $s_7$ = 1.57063 BTU/lbm-F|\n",
"| 10 - CFWH/Mix | | 2000 psi |0| 671.797 BTU/lbm | 0.86284 BTU/lbm-F|\n",
"| 11 - P2/Mix | | 2000 psi |0| 671.797 BTU/lbm| 0.86284 BTU/lbm-F|\n",
"\n",
"\n",
"\n",
"\n"
"| 10 - CFWH/Mix | | 2000 psi || 671.797 BTU/lbm | 0.86284 BTU/lbm-F|\n",
"| 11 - P2/Mix | | 2000 psi | | | $s_{11}$ = $s_3$ = 0.51747 BTU/lbm-F|"
]
},
{
@ -399,7 +395,7 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": 3,
"id": "085fa335-9198-4923-86d9-efb9ac397280",
"metadata": {},
"outputs": [
@ -450,71 +446,92 @@
"metadata": {},
"source": [
"$$y(h_8 - h_2 - h_3 + h_{10}) = h_{10}-h_2 $$\n",
"$$y = \\frac{h_{10}-h_2}{h_8 - h_2 - h_3 + h_{10}} $$"
"$$y = \\frac{h_{10}-h_2}{h_8 - h_2 - h_3 + h_{10}} $$\n",
"\n",
"Now, we don't know $y$, $h_{11}$, $h_{10}$, or $h_2$.\n",
"\n",
"But we know something about the mixing chamber!\n",
"$$ \\dot m_4 h_4 = \\dot m_{11} h_{11} + \\dot m_{10} h_{10}$$\n",
"$$ \\dot m_7 h_4 = \\dot m_{7} y h_{11} + \\dot m_{7} (1-y) h_{10}$$\n",
"$$ h_4 = y h_{11} + (1-y) h_{10}$$\n",
"$$ h_4 = y h_{11} + h_{10} -y h_{10}$$\n",
"$$ y = \\frac{h_4 - h_{10}}{h_{11} - h_{10}}$$\n",
"\n",
"At this point we have 4 unknowns, 2 equations. Let's look at the boiler:\n",
"$$ Q_{boiler} = \\dot m_4 h_4 - \\dot m_5 h_5 $$\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5bed5dc9-34a9-4aa0-b0c7-c6637ab28774",
"id": "92c15504-e768-4766-84f8-ae20010015b4",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"id": "5bd7f9ab-f870-425d-9dd9-757ae992c3de",
"metadata": {},
"source": [
"#Find h_2\n",
"h_2 = givens.get(2000)['hf']\n",
"###### Find h_2\n",
"x_2 = (givens.get(2.9)['sf'] - givens.get(2000)['sf']) / (givens.get(2000)['sg'] - givens.get(2000)['sf'])\n",
"print(f'x_2 = {x_2:.3f}')\n",
"h_2 = x_2 * (givens.get(2000)['hg'] - givens.get(2000)['hf']) + givens.get(2000)['hf']\n",
"print(f'h_2 = {h_2:.3f} BTU/lbm')\n",
"\n",
"#Find h_10\n",
"h_10 = givens.get(2000)['hf']\n",
"print(f'h_2 = {h_2:.3f} BTU/lbm')\n",
"print(f'h_10 = {h_10:.3f} BTU/lbm')\n",
"\n",
"#Find h_3\n",
"h_10 = givens.get(155)['hf']\n",
"print(f'h_2 = {h_2:.3f} BTU/lbm')\n",
"\n"
"h_3 = givens.get(155)['hf']\n",
"print(f'h_3 = {h_3:.3f} BTU/lbm')"
]
},
{
"cell_type": "markdown",
"id": "df89be07-8172-44bf-900a-46e2108cdd9a",
"id": "7b295ed8-207f-445b-8a60-51dbaaa7012f",
"metadata": {},
"source": [
"Now we also don't know $W_{LPT}$. We need a second equation to find $y$. We get it from the closed water heater, which conserves energy between the two streams:\n",
"\n",
"$$ \\dot m_3 h_3 + \\dot m_{10} h_{10} = \\dot m_2 h_2 + \\dot m_8 h_8 $$\n",
"\n",
"But THIS equation has us going further down the rabbit hole. Must find pump works, then HPT work, then finally we can take the LPT work from that. THEN! We can find y. Things we know though:\n",
"$$\\dot m_3 = \\dot m_7 = \\dot m_{11}$$\n",
"$$\\dot m_{10} = \\dot m_2 = \\dot m_1 = m_9$$\n",
"$$\\dot m_4 = \\dot m_5 = \\dot m_6 = m_7$$\n",
"and also when looking at pumps, we can find the work done by each pump, and work done by the high pressure turbine. We find all of these, and then we can figure out what that LPT work is.\n",
"\n",
"**P1 Work**:\n",
"$$W_{P1} = \\dot m_7 (1-y) (h_2 - h_1)$$\n",
"**P2 Work**:\n",
"$$W_{P2} = \\dot m_7 y (h_{11} - h_3)$$\n",
"\n",
"**Boiler Heat**:\n",
"$$Q_{Boiler} = \\dot m_7 (h_{4} - h_5)$$\n",
"\n",
"**Condenser Heat**:\n",
"$$Q_{Condenser} = \\dot m_7 (1-y) (h_9 - h_1)$$\n",
"\n",
"**CFWH Balance**:\n",
"$$\\dot m_7 y (h_3 - h_7) = \\dot m_7 (1-y) (h_{10} - h_2)$$\n",
"$$y (h_3 - h_7) = (1-y) (h_{10} - h_2)$$\n",
"\n",
"**HPT Work**:\n",
"$$W_{HPT} = \\dot m_7 (h_6 - h_5)$$\n"
"**Part B**\n",
"$$ W_{HPT} = \\dot m_5 h_5 - \\dot m_6 h_6$$"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c7c46329-0ea4-40c5-b0d8-6fd87ce57673",
"execution_count": 17,
"id": "4ce1da3b-82c9-492a-ae75-62bef90d9bae",
"metadata": {},
"outputs": [],
"source": []
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"x_6 = 0.986\n",
"h_6 = 1192.609 BTU/lbm\n",
"\n",
"=========FINAL ANSWER=========\n",
"8b:\n",
"W_HPT = 2.605e+07 BTU/hr\n",
"=========FINAL ANSWER=========\n",
"\n"
]
}
],
"source": [
"# Find quality at 8\n",
"x_6 = (1.42335 - givens.get(680)['sf']) / (givens.get(680)['sg'] - givens.get(680)['sf'])\n",
"print(f'x_6 = {x_6:.3f}')\n",
"\n",
"# Find enthalpy at 8\n",
"h_6 = x_6 * (givens.get(680)['hg'] - givens.get(680)['hf']) + givens.get(680)['hf']\n",
"print(f'h_6 = {h_6:.3f} BTU/lbm')\n",
"\n",
"W_hpt = (72*60*60) *(1293.1 - h_6)\n",
"answer_print('8b', f'W_HPT = {W_hpt:.3e} BTU/hr')\n",
" "
]
},
{
"attachments": {