Created
June 22, 2021 01:25
-
-
Save dneuman/ca108db797588a765138fc77d51a28bd to your computer and use it in GitHub Desktop.
Solving 1 plate problem assuming finite conduction between hot and cold side.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from sympy import * | |
| init_session(quiet=True) | |
| from sympy.abc import epsilon, sigma, c, w | |
| var('P1 P2 P12 Pin T1 T2') | |
| const = dict(sigma=5.67e-8, # Stefan-Boltzmann constant | |
| epsilon=1.0, # emissivity of flat black paint | |
| c = 401.) # W/mK, conductivity of copper plate | |
| # In[111]: | |
| hot = Eq(P1, Pin - P12); hot | |
| # In[112]: | |
| cold = Eq(P2, P12); cold | |
| # In[113]: | |
| p12 = Eq(P12, c * w * (T1 - T2)); p12 | |
| # In[114]: | |
| p1 = Eq(P1, epsilon * sigma * T1**4) | |
| p2 = Eq(P2, epsilon * sigma * T2**4); p2 | |
| # In[115]: | |
| hot = hot.subs({P1: p1.args[1], P12: p12.args[1]}); hot | |
| cold = cold.subs({P2: p2.args[1], P12: p12.args[1]}); cold | |
| # In[116]: | |
| vals = dict(Pin = 400, # W, input power on hot side | |
| w = 0.015) # m, plate width | |
| hotv = hot.subs({**const, **vals}) | |
| coldv = cold.subs({**const, **vals}); coldv | |
| # In[117]: | |
| (t1, t2) = nonlinsolve([hotv, coldv], (T1, T2)).args[1] | |
| print(f'T1 = {t1:.2f}K\nT2 = {t2:.2f}K\nTavg = {(t1+t2)*.5:.2f}K') | |
| print(f'Texp = {((200/epsilon/sigma)**.25).subs({**const}):.2f}K') | |
| # In[118]: | |
| p1v = p1.subs({**const, T1: t1}).args[1]; print(f'P1 = {p1v:.2f}W') | |
| p2v = p2.subs({**const, T2: t2}).args[1]; print(f'P2 = {p2v:.2f}W') | |
| print(f'Pavg = {(p1v+p2v)*.5:.2f}W') | |
| print(f'P12 = {p12.subs({**const, **vals, T1: t1, T2: t2}).args[1]:.2f}W') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment