Question: 1 . Modify the fCrankNicolson function and CNscript codes to accommodate a Type 3 boundary condition at x = 0 and type 2 at x

1. Modify the fCrankNicolson function and CNscript codes to accommodate a Type 3 boundary condition at x =0 and type 2 at x = L [m]. Let the first boundary condition be characterized by BiL = hL/k and environment temperature T\omicron \omicron [deg C]. Pass these parameters to the new function, such as in the following function header line:
fCrankNicolson_2(nx, dt, Told, BiL, T_inf, q_j, q_jp1)
Use these parameters to call your function:
L =2;
nx =40;
dt =0.01;
T_inf =5;
x =[0:L/nx:L]; tfinal =1.8;
and let q(t)=1.0 W/m2 constant beginning at time t =0 s. Make a plot showing T(x) at different times, all on the same graph: t =0.1,0.45,0.90,1.35, and 1.8 s
2. Test the code with the script letting BiL =0. How do you expect the solution to behave? What do you see in the results that confirms or informs your expectation?
3. Test the code with the script letting BiL =100. How does this affect the solution at x =0? Whats going on in the results at small times at x =0?(you can investigate letting dt be smaller, say dt =0.001, if you wish).
4. Test the code with a moderate value of BiL =20. What do you see in the results? Approximately how long does it take for steady state?

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 Programming Questions!