<jupyter_start><jupyter_text>CHEME 512 Presentation – III (Dt : 10th October, 2019) <NAME> Infinite plate with convection boundaries and internal heatingProblem Statement : The problem consists of an isotropic infinite plate where the thickness of the plate is the major direction of interest for heat transfer. Heat is being generated inside the plate at a volumetric rate of q’’. Heat is entering from either sides of the plate through convection. The temperatures in the surroundings on either sides of the plate are given as shown below in the figure. <img src="figure.png"     alt="Figure"     style="float: center"      width = "500"/> Writing the energy flux equation in x-direction,$$\rho C \frac{dT}{dt} = -\nabla q_x + q''$$As $q_x$ = Conductive heat flux in $x$- direction = $-k\frac{dT}{dx}$,$$\rho C \frac{dT}{dt} = k\frac{d^2T}{dx^2} + q''$$where $k$ = Thermal conductivity, $T$ = Temperature, $q''$= Volumetric Heat of generation, $\rho$ = Density and $C$ = Specific heat capacity Assuming steady state, $$\frac{dT}{dt} = 0 \space\space\implies\space\space k\frac{d^2T}{dx^2} + q'' = 0$$ Boundary Conditions (BCs) : Neumann Boundary Conditions BC 1 : Convective heat flux at $(x = -l)$  =  Conductive heat transfer inside the plate at $(x = -l)$$$h_1(T_1 - T_A) = -k\frac{dT}{dx}\space;\space\space\space\space\space x = -l$$ BC 2 : Convective heat flux at $(x = l)$  =  Conductive heat transfer inside the plate at $(x = l)$$$-h_2(T_2 - T_B) = -k\frac{dT}{dx}\space;\space\space\space\space\space x = l$$For simplicity in solving this, we can **Non-dimensionalize** this ode like this.$$\phi = \frac{T - T_2}{T_1 - T_2}\space\space\space;\space\space\space X = \frac{x}{2l}$$Writing the ode in terms of $\phi$ and $X$,$$d\phi = \frac{dT}{T_1 - T_2}\space\space\space\space\space dX = \frac{dx}{2l}$$$$\frac{dT}{dx} = \frac{T_1 - T_2}{2l}\frac{d\phi}{dX}$$$$\frac{d^2T}{dx^2} = \frac{T_1 - T_2}{(2l)^2}\frac{d^2\phi}{dX^2}$$Substituting this in the ode,$$k\frac{d^2T}{dx^2} + q'' = 0\space\space\space\implies\space\space\space \frac{d^2T}{dx^2} = -\frac{q''}{k}$$$$\frac{T_1 - T_2}{(2l)^2}\frac{d^2\phi}{dX^2} = -\frac{q''}{k}$$$$\frac{d^2\phi}{dX^2} = -\frac{q''}{k}\frac{(2l)^2}{T_1 - T_2}$$For **non-dimensionalizing** the R.H.S, we use the non-dimensional number **Pomerantsev modulus** (assuming A to be area of plate normal to x-direction).$$\text{Pomerantsev modulus} = \text{Po} = \frac{\text{Heat generation rate}}{\text{Heat conduction rate}} = \frac{q''A(2l)}{k\frac{T_1 - T_2}{2l}A}$$$$ = \frac{q''(2l)^2}{k(T_1 - T_2)}$$Putting this in the non-dimentionalized ode,$$\frac{d^2\phi}{dX^2} = -Po$$ For **Non-dimensionalizing** the boundary conditions, we use the non-dimensional parameter, **Biot's number**.$$\text{Biot's Number} = \text{Bi} = \frac{\text{Heat convection rate}}{\text{Heat conduction rate}} = \frac{h(T_1-T_2)A}{k\frac{T_1-T_2}{2l}A} = \frac{h(2l)}{k}$$ BC1 : $$-\frac{h_1}{k}(T_1 - T_A) = \frac{dT}{dx}\space;\space\space\space\space\space x = -l$$$$-Bi_1\frac{(T_1 - T_A)}{2l} = \frac{T_1 - T_2}{2l}\frac{d\phi}{dX}\space;\space\space\space Bi_1 = \frac{h_1(2l)}{k}\space\space; X = -0.5$$$$-Bi_1[1-\frac{(T_A - T_2)}{T_1 - T_2}] = \frac{d\phi}{dX}\space;\space\space\space\space\space X = -0.5$$$$-Bi_1[1-\phi_A] = \frac{d\phi}{dX}\space;\space\space\space\space\space X = -0.5$$ BC2 : $$\frac{h_2}{k}(T_2 - T_B) = \frac{dT}{dx}\space;\space\space\space\space\space x = l$$$$-Bi_2\space\phi_B = \frac{d\phi}{dX}\space;\space\space\space Bi_2 = \frac{h_2(2l)}{k};\space\space X = 0.5$$--- Solving the ode :By simple integration,$$\frac{d^2\phi}{dX^2} = -Po $$$$\frac{d\phi}{dX} = (-Po)X + c_1$$$$\phi = \frac{-Po}{2}X^2 + c_1X + c_2$$Using the BCs, BC 1 :$$-Bi_1[1-\phi_A] = (-Po)(-\frac{1}{2}) + c_1$$$$\phi_A = \frac{1}{Bi_1}(\frac{Po}{2} + c_1) + 1$$ BC 2 :$$-Bi_2\space\phi_B = (-Po)(\frac{1}{2}) + c_1$$$$\phi_B = \frac{1}{Bi_2}(\frac{Po}{2} - c_1)$$Using these two expressions in the solution of ode,$$\frac{1}{Bi_1}(\frac{Po}{2} + c_1) + 1 = \frac{-Po}{2}(-\frac{1}{2})^2 + c_1(-\frac{1}{2}) + c_2\space\space\space\space\space\space\space\space\space\space\space\space (\text{eq. 1 from BC1})$$$$\frac{1}{Bi_2}(\frac{Po}{2} - c_1) = \frac{-Po}{2}(\frac{1}{2})^2 + c_1(\frac{1}{2}) + c_2\space\space\space\space\space\space\space\space\space\space\space\space (\text{eq. 2 from BC2})$$From (eq. 2) - (eq. 1),$$c_1 = \frac{\frac{Po}{2}[\frac{1}{Bi_2} - \frac{1}{Bi_1}] - 1}{\frac{1}{Bi_1} + \frac{1}{Bi_2} + 1} = \frac{\frac{Po}{2}[1-H] - Bi_2}{1 + Bi_2 + H }\space\space\space;\text{where}\space\space H = \frac{h_2}{h_1} = \frac{Bi_2}{Bi_1}$$By putting this expression in (eq. 2),$$c_2 = \frac{Po}{2}[\frac{1}{4} + \frac{1}{Bi_2}] - [\frac{1}{2}+\frac{1}{Bi_2}]c_1$$The final solution would be :$$ \phi = \frac{T - T_2}{T_1 - T_2} = \frac{Bi_2 - \frac{Po}{2}[1-H]}{1 + Bi_2 + H }[\frac{1}{Bi_2} - \frac{1}{2}]\space\space -\space\space \frac{3Po}{8}\space\space +\space\space \frac{Po}{2Bi_2}\space\space +\space\space \frac{Po}{2}(1-X^2)\space\space +\space\space \frac{Bi_2 - \frac{Po}{2}[1-H]}{1 + Bi_2 + H }(1-X)$$The final solution given in the book :$$ \phi = \frac{T - T_2}{T_1 - T_2} = \frac{1 - Po[\frac{1}{Bi_2}+1]}{1 + Bi_2 + H }\space\space +\space\space \frac{Po}{Bi_2}\space\space +\space\space \frac{Po}{2}(1-X^2)\space\space +\space\space Bi_1\frac{1 + Po[\frac{1}{Bi_2}+\frac{1}{2}]}{1 + Bi_1 + H }(1-X)$$Lets compare the hand-solved expression with the one given in the book. The following assumptions are made for the first plot :$l$ = 0.5 m ; $h_1$ = 20 W/m2K ; $h_2$ = 100 W/m2K; $H$ = $h_2/h_1$ = 5$K$ = 0.5 W/m.k ; $q''$ = 100 W/m3 ; $T_1$ = 60 C ; $T_2$ = 40 C<jupyter_code>import numpy as np
import scipy
import matplotlib.pyplot as plt
import matplotlib.cm as cm

#Hand-solved solution
def phi_hand(X, Po, Bi1, H, T1, T2):
    Bi2 = H*Bi1
    
    A = Po/2
    B = (Bi2-(Po/2)*(1-H)) / (1+Bi2+H)
    C = B*((1/Bi2) - (1/2)) - 3*(Po/8) + Po/(2*Bi2)
    
    return (A*(1-X**2) + B*(1-X) + C)*(T1-T2) + T2

#Book solution
def phi_book(X, Po, Bi1, H, T1, T2):
    Bi2 = H*Bi1
    
    A = Po/2
    B = Bi1*( (1+Po*((1/Bi2)+(1/2))) / (1+Bi1+H) )
    C = (1-Po*((1/Bi2)+1))/(1+Bi2+H) + (Po/Bi2)
    
    return (A*(1-X**2) + B*(1-X) + C)*(T1-T2) + T2

T1 = 60
T2 = 40
l = 0.5
h1 = 20
h2 = 100
H = h2/h1
k = 0.5
q = 100

Bi1 = h1*(2*l)/k
Bi2 = h2*(2*l)/k
Po = (q*(2*l)**2)/(k*(T1-T2))

X = np.linspace(-0.5,0.5,50)

fig, ax = plt.subplots(figsize=(10,8))
ax.plot(X, phi_book(X, Po, Bi1, H, T1, T2) , label='book')
ax.plot(X, phi_hand(X, Po, Bi1, H, T1, T2), label='hand')
ax.plot(np.linspace(-0.75, -0.5, 10), np.ones(10)*T1, '--', c = 'r')
ax.plot(np.linspace(0.5, 0.75, 10), np.ones(10)*T2, '--', c = 'r')
ax.legend()
ax.set_xlabel('X = x/2l', fontsize = 16)
ax.set_ylabel('T in C', fontsize = 16)
ax.axvline(-0.5, c='k')
ax.axvline(0.5, c='k')
ax.set_xlim([-0.75,0.75])

print('Bi_1 = {}'.format(Bi1))
print('Bi_2 = {}'.format(Bi2))
print('Po = {}'.format(Po))<jupyter_output>Bi_1 = 40.0
Bi_2 = 200.0
Po = 10.0<jupyter_text>How does the curve change if we change the ode parameters?Hand-solved solution is being used here.<jupyter_code>#Varying Bi1 and Bi2
h1 = [10, 100, 1000]
H = [0.01, 1, 100 ]
Po = 10

fig, ax = plt.subplots(nrows = 1, ncols = 3, figsize = (20,8))
i = 0
j = 0

for h1i in h1:
    Bi1 = h1i*(2*l)/k
    
    for Hj in H:
        h2j = Hj*h1i
        
        Bi2 = h2j*(2*l)/k
        Po = 10
        
        ax[i].plot(X, phi_hand(X, Po, Bi1, Hj, T1, T2), label = 'H = {}'.format(Hj) + '; h2 = {}'.format(h2j) + '; Bi_2 = {}'.format(Bi2) )
        ax[i].plot(np.linspace(-0.75, -0.5, 10), np.ones(10)*T1, '--', c = 'r')
        ax[i].plot(np.linspace(0.5, 0.75, 10), np.ones(10)*T2, '--', c = 'r')
        ax[i].set_xlabel('X = x/2l', fontsize = 16)
        ax[i].set_ylabel('T in C', fontsize = 16)
        ax[i].axvline(-0.5, c='k')
        ax[i].axvline(0.5, c='k')
        ax[i].set_xlim([-0.75,0.75])
        j+=1
    
    ax[i].title.set_text('h1 = {}'.format(h1i) + '; Po = {}'.format(Po) + '; Bi_1 = {}'.format(Bi1))
    ax[i].legend()
    i+=1

#Varying Po
figs,axs = plt.subplots(figsize = (15,7))

h1 = 10
H = 20
h2 = H*h1
Bi1 = h1*(2*l)/k
Bi2 = h2*(2*l)/k

Po = [0.01, 10, 100]

for Poi in Po:
    axs.plot(X, phi_hand(X, Poi, Bi1, H, T1, T2), label = 'Po = {}'.format(Poi) )
    axs.plot(np.linspace(-0.75, -0.5, 10), np.ones(10)*T1, '--', c = 'r')
    axs.plot(np.linspace(0.5, 0.75, 10), np.ones(10)*T2, '--', c = 'r')
    axs.set_xlabel('X = x/2l', fontsize = 16)
    axs.set_ylabel('T in C', fontsize = 16)
    axs.axvline(-0.5, c='k')
    axs.axvline(0.5, c='k')
    axs.set_xlim([-0.75,0.75])

axs.title.set_text('h1 = {}'.format(h1) + '; Bi_1 = {}'.format(Bi1) + '; Bi_2 = {}'.format(Bi2))
axs.legend()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.24908592321755027, 'fraction_numerical': 0.0661563071297989, 'mean_word_length': 3.606842105263158, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '639841', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 4192, 'n_tokens_neox': 3969, 'n_words': 815, 'path': 'presentations/10_10_19_Preetham.ipynb', 'repo_name': 'uw-cheme512/uw-cheme512.github.io', 'size': '8767'}