Question: Run steady-state simulations in python. Repeat as transient simulations. How long would it take to reach steady state in each problem? For transient use initial

Run steady-state simulations in python. Repeat as transient simulations.

How long would it take to reach steady state in each problem?

For transient use initial temperatures of 20C and 500C respectively.

Sintering is a metallurgical process used to create metal objects with better physical properties by holding powdered material in a mold and heating it to a temperature slightly below its melting point. Two materials, nickel (k = 90.7 W/mK) and copper (k = 401 W/mK), are embedded in a mold made of stainless steel (k = 15.1 W/mK), as shown in Fig. P590. The bottom surface of stainless steel is maintained at a nonuniform temperature while its two sides are insulated. The upper surface of nickel and copper is exposed to a convective environment with h = 125 W/m2 K and ambient temperature of 15C. Assuming steady-state heat conduction and a mesh size of 1.5 cm, develop finite difference equations for different nodes and determine the nodal temperatures. The density of the powdered material after sintering is about 99 percent of the original metal density and hence may be considered a continuous solid material for all practical purposes. Hint: Use the mirror image concept for the nodes at the insulated boundary.

import numpy as np import matplotlib.pyplot as plt print("2D heat equation solver") x_length = 0.09 #9 cm by 4.5 cm y_length = 0.045 # max_iters = 100 #maximum number of iterations on solver kappa_Cu = 401 # W/m-K kappa_Ni = 90.7 kappa_Fe = 15.1 h = 125 # W/m^2-K delta_x = 0.015 # 1.5 cm xnorm = x_length/delta_x + 1 #node on each end need to add 1 ynorm = y_length/delta_x + 1 xnorm = round(xnorm) ynorm = round(ynorm) print("nodes in x: ", xnorm) print("nodes in y: ", ynorm) # Initialize solution: the grid of u(k, i, j) T = np.empty((ynorm, xnorm)) # Initial condition everywhere inside the grid T_initial = 293 # Boundary conditions T_amb = 288 #temperature in K T_bot = np.array([600, 700, 800, 900, 800, 700, 600]) T_bot = np.add(T_bot,273) # Set the initial condition T.fill(T_initial) T[:1, :] = T_bot # fixed T on bottom maxTchange = 1 tempT = np.empty((ynorm, xnorm)) iter_to_solve = 0 while(maxTchange>=0.001): #for k in range(max_iters): iter_to_solve = iter_to_solve + 1 tempT[:, :] = T.copy() for i in range(1, ynorm, 1): for j in range(0, xnorm, 1): if i >= 1 and j > 1 and j <= 3: kappa = kappa_Cu elif i >= 1 and j > 3 and j <= 5: kappa = kappa_Ni else: kappa = kappa_Fe if j == xnorm - 1 and i < ynorm - 1: # right boundary described above T[i][j] = (T[i + 1][j] / 2 + T[i - 1][j] / 2 + T[i][j - 1]) / 2 elif j == 0 and i < ynorm - 1: # left boundary described above T[i][j] = (T[i + 1][j] / 2 + T[i - 1][j] / 2 + T[i][j + 1]) / 2 elif i == ynorm - 1 and j < xnorm - 1: # top convection from above T[i][j] = ((h * delta_x / kappa * T_amb) + T[i - 1][j] + T[i][j + 1] / 2 + T[i][j - 1] / 2) / (h * delta_x / kappa + 2) elif i == ynorm - 1 and j == xnorm - 1: # corner top T[i][j] = ((h * delta_x / kappa * T_amb) + T[i - 1][j] + T[i][j - 1]) /(h * delta_x / kappa + 2) else: # bulk T[i][j] = (T[i+1][j] + T[i-1][j] + T[i][j+1] + T[i][j-1])/4 deltaT = np.subtract(T,tempT[:, :]) deltaT = abs(deltaT) maxTchange = np.max(deltaT) print("Max delta T: ", maxTchange) print("Maximum Temperature : ", np.max(T)) print(f"Solution took {iter_to_solve:.0f} iterations to complete") #convert to K from C T_convert = np.empty((ynorm, xnorm)) T_convert.fill(273) T = np.subtract(T,T_convert) plt.clf() plt.title("Temperature (C)") plt.xlabel("x") plt.ylabel("y") # This is to plot u_k (u at time-step k) xrange = np.mgrid[slice(0, x_length+delta_x, delta_x)] yrange = np.mgrid[slice(0, y_length+delta_x, delta_x)] plt.pcolormesh(xrange, yrange, T, cmap=plt.cm.jet, vmin=round(np.min(T)), vmax=round(np.max(T))) plt.colorbar() plt.savefig('5-90_SS.png') plt.show() print("Done!") Provide modified code, thanks 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!