Solve for the temperature distribution of a long, thin circular solid tube with a length of 10 cm (shown in Figure2), using the Finite Difference Method: Parabolic Equation (Explicit Method). The following values of the circular solid tube is as provided: k’= 0.49 cal/ (s · cm · oC), Δt = 0.1 s  and Δx = 2 cm. When t = 0, the temperature of the circular solid tube is zero and the boundary conditions are fixed for all times at temperature T, at x = 0 cm is 100oC where as the temperature T, at x =10 is 50oC. From this information it is given that the circular solid rod is made of material with heat capacity, C = 0.2174 cal/(g· oC) and  density (ρ) = 2.7 g/cm3. Use Explicit Method to solve this problem. Task: A Visual Basic of the FDM solution for (a) has been initially developed based on the required calculation of task Q2(a). The source code is as provided below (may need some minor tweak):   Option Explicit Sub Explicit() Dim i As Integer, j As Integer, np As Integer, ns As Integer Dim Te(20) As Single, dTe(20) As Single, tpr(20) As Single, Tepr(20, 20) As Single Dim k As Single, dx As Single, L As Single, tc As Single, tf As Single Dim tp As Single, t As Single, tend As Single, h As Single L = 10 ns = 5 dx = 2 k = 0.835 Te(0) = 100 Te(5) = 50 tc = 0.1 tf = 1 tp = 0.3 np = 0 tpr(np) = t For i = 0 To ns Tepr(i, np) = Te(i) Next i Do tend = t + tp If tend > tf Then tend = tf h = tc Do If t + h > tend Then h = tend - t Call Derivs(Te, dTe, ns, dx, k) For j = 1 To ns - 1 Te(j) = Te(j) + dTe(j) * h Next j t = t + h If t >= tend Then Exit Do Loop np = np + 1 tpr(np) = t For j = 0 To ns Tepr(j, np) = Te(j) Next j If t >= tf Then Exit Do Loop Sheets("sheet1").Select Range("a4").Select For i = 0 To np ActiveCell.Value = tpr(i) For j = 0 To ns ActiveCell.Offset(0, 1).Select ActiveCell.Value = Tepr(j, i) Next j   ActiveCell.Offset(1, -ns - 1).Select Next i End Sub Sub Derivs(Te, dTe, ns, dx, k) Dim j As Integer For j = 1 To ns - 1 dTe(j) = k * (Te(j - 1) - 2 * Te(j) + Te(j + 1)) / dx ^ 2 Next j End Sub   i.Modify and run the VBA script to obtain the solution for t =0.1 to 10 minutes at 0.1 intervals. Provide the revised script and results as answer. ii. Modify and run the VBA script to obtain the solution for t =0.1 to 10 minutes using a new material (Heat Capacity, C = 0.09195 cal/(g· oC)) and density (ρ) = 8.9 g/cm3. Provide the revised script and results as answer.

Elements Of Electromagnetics
7th Edition
ISBN:9780190698614
Author:Sadiku, Matthew N. O.
Publisher:Sadiku, Matthew N. O.
ChapterMA: Math Assessment
Section: Chapter Questions
Problem 1.1MA
icon
Related questions
Question

Solve for the temperature distribution of a long, thin circular solid tube with a length of 10 cm (shown in Figure2), using the Finite Difference Method: Parabolic Equation (Explicit Method). The following values of the circular solid tube is as provided: k’= 0.49 cal/ (s · cm · oC), Δt = 0.1 s  and Δx = 2 cm. When t = 0, the temperature of the circular solid tube is zero and the boundary conditions are fixed for all times at temperature T, at x = 0 cm is 100oC where as the temperature T, at x =10 is 50oC. From this information it is given that the circular solid rod is made of material with heat capacity, C = 0.2174 cal/(g· oC) and  density (ρ) = 2.7 g/cm3. Use Explicit Method to solve this problem.

Task:

  1. A Visual Basic of the FDM solution for (a) has been initially developed based on the required calculation of task Q2(a). The source code is as provided below (may need some minor tweak):

 

Option Explicit

Sub Explicit()

Dim i As Integer, j As Integer, np As Integer, ns As Integer

Dim Te(20) As Single, dTe(20) As Single, tpr(20) As Single, Tepr(20, 20)

As Single

Dim k As Single, dx As Single, L As Single, tc As Single, tf As Single

Dim tp As Single, t As Single, tend As Single, h As Single

L = 10

ns = 5

dx = 2

k = 0.835

Te(0) = 100

Te(5) = 50

tc = 0.1

tf = 1

tp = 0.3

np = 0

tpr(np) = t

For i = 0 To ns

Tepr(i, np) = Te(i)

Next i

Do

tend = t + tp

If tend > tf Then tend = tf

h = tc

Do

If t + h > tend Then h = tend - t

Call Derivs(Te, dTe, ns, dx, k)

For j = 1 To ns - 1

Te(j) = Te(j) + dTe(j) * h

Next j

t = t + h

If t >= tend Then Exit Do

Loop

np = np + 1

tpr(np) = t

For j = 0 To ns

Tepr(j, np) = Te(j)

Next j

If t >= tf Then Exit Do

Loop

Sheets("sheet1").Select

Range("a4").Select

For i = 0 To np

ActiveCell.Value = tpr(i)

For j = 0 To ns

ActiveCell.Offset(0, 1).Select

ActiveCell.Value = Tepr(j, i)

Next j

 

ActiveCell.Offset(1, -ns - 1).Select

Next i

End Sub

Sub Derivs(Te, dTe, ns, dx, k)

Dim j As Integer

For j = 1 To ns - 1

dTe(j) = k * (Te(j - 1) - 2 * Te(j) + Te(j + 1)) / dx ^ 2

Next j

End Sub

 

i.Modify and run the VBA script to obtain the solution for t =0.1 to 10 minutes at 0.1 intervals. Provide the revised script and results as answer.

ii. Modify and run the VBA script to obtain the solution for t =0.1 to 10 minutes using a new material (Heat Capacity, C = 0.09195 cal/(g· oC)) and density (ρ) = 8.9 g/cm3. Provide the revised script and results as answer.

0
Conduction
Ac
T₂
Ax
Convection
x + Ax
L
Transcribed Image Text:0 Conduction Ac T₂ Ax Convection x + Ax L
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 3 images

Blurred answer
Knowledge Booster
Convection
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, mechanical-engineering and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Elements Of Electromagnetics
Elements Of Electromagnetics
Mechanical Engineering
ISBN:
9780190698614
Author:
Sadiku, Matthew N. O.
Publisher:
Oxford University Press
Mechanics of Materials (10th Edition)
Mechanics of Materials (10th Edition)
Mechanical Engineering
ISBN:
9780134319650
Author:
Russell C. Hibbeler
Publisher:
PEARSON
Thermodynamics: An Engineering Approach
Thermodynamics: An Engineering Approach
Mechanical Engineering
ISBN:
9781259822674
Author:
Yunus A. Cengel Dr., Michael A. Boles
Publisher:
McGraw-Hill Education
Control Systems Engineering
Control Systems Engineering
Mechanical Engineering
ISBN:
9781118170519
Author:
Norman S. Nise
Publisher:
WILEY
Mechanics of Materials (MindTap Course List)
Mechanics of Materials (MindTap Course List)
Mechanical Engineering
ISBN:
9781337093347
Author:
Barry J. Goodno, James M. Gere
Publisher:
Cengage Learning
Engineering Mechanics: Statics
Engineering Mechanics: Statics
Mechanical Engineering
ISBN:
9781118807330
Author:
James L. Meriam, L. G. Kraige, J. N. Bolton
Publisher:
WILEY