Troubleshooting 2D Conduction With Matlab and Interactive Heat Transfer

In summary: Your Name]In summary, the conversation is about a student struggling with writing a program in MATLAB to calculate nodal temperatures of a sheet with a slot using 2D conduction. The student has tried using Interactive Heat Transfer 4.0, but their code is not working and is giving an error of too many unknowns. The student shares their code and asks for help in identifying the mistake or getting a starting point for using loops in MATLAB. The expert providing the summary notes that the student has a good understanding of the problem but may have typos and has not defined the nodal temperatures before using them in equations. They suggest breaking down the problem into smaller parts and seeking online resources or help from classmates or a tutor.
  • #1
Matthecat
1
0

Homework Statement


I have to come up with a program that calculates the nodal temperatures of a sheet with a slot with 2D conduction. Due to symmetry the shape can be reduced to an L shape. Matlab and loops have always given me trouble, so I tried the Interactive Heat Transfer 4.0. Unfortunately the code that I came up with doesn't work, the program says I have too many unknowns. I know that if I could write a few loops in Matlab I would be able to compute all of it so much easier. If someone could look over my original code and point out what I'm doing wrong or give me a starting place for MATLAB I'd really appreciate it.

Homework Equations

The Attempt at a Solution



Similar Nodes 13-21, 24-32, 35-43, 46-48, 57-59[/B]
Nodes 1, 11, 55, 65
Nodes 2-10, 50-54, 60
Nodes 12, 23, 34, 45, 56, 22, 33, 44, 62 63, 64
Nodes 61 and 49 are uniqueThis is the code that I wrote in IHT

//Properties
k = 25 //Turbine blade thermal conductivity, W/mK

//Thermal Conditions
Tinfo = 1700 //Combustion gas temperature, K
ho = 1000 //Convection coefficient for combustion gases, W/m^2K
Tinfi = 400 //Air temperature, K
hi = 200 //Convection coefficient for air, W/m^2K

//Dimensions
delx = 0.0005 //Delta x value, m (same as delta y value)

//Constants
Co = ho*delx/k
Ci = hi*delx/k

//Nodal Equations

T2 + T7 - (2 + Co)*T1 = -Co*Tinfo //Node 1

T1 + T3 + 2*T13 - 2*(2 + Co)*T2 = -2*Co*Tinfo //Node 2

T2 + T4 + 2*T14 - 2*(2 + Co)*T3 = -2*Co*Tinfo //Node 3

T3 + T5 + 2*T15 - 2*(2 + Co)*T4 = -2*Co*Tinfo //Node 4

T4 + T6 + 2*T16 - 2*(2 + Co)*T5 = -2*Co*Tinfo //Node 5

T5 + T7 + 2*T17 - 2*(2 + Co)*T6 = -2*Co*Tinfo //Node 6

T6 + T8 + 2*T18 - 2*(2 + Co)*T7 = -2*Co*Tinfo //Node 7

T7 + T9 + 2*T19 - 2*(2 + Co)*T8 = -2*Co*Tinfo //Node 8

T8 + T10 + 2*T20 - 2*(2 + Co)*T9 = -2*Co*Tinfo //Node 9

T9 + T11 + 2*T21 - 2*(2 + Co)*T10 = -2*Co*Tinfo //Node 10

T10 + T22 - (2 + Co)*T11 = -Co*Tinfo //Node 11

T1 + 2*T13 + T23 - 4*T12 = 0 //Node 12T2 + T12 + T14 + T24 - 4*T13 = 0 //Node 13

T3 + T13 + T15 + T125 - 4*T14 = 0 //Node 14T4 + T14 + T16 + T26 - 4*T15 = 0 //Node 15

T5 + T15 + T17 + T27 - 4*T16 = 0 //Node 16

T6 + T17 + T18 + T28 - 4*T17 = 0 //Node 17

T7 + T16 + T18 + T29 - 4*T18 = 0 //Node 18

T8 + T17 + T19 + T30 - 4*T19 = 0 //Node 19

T9 + T18 + T20 + T31 - 4*T20 = 0 //Node 20

T10 + T19 + T21 + T32 - 4*T21 = 0 //Node 21

T11 + 2* T21 + T33 - 4*T22 = 0 //Node 22

T12 + 2*T24 + T34 - 4*T23 = 0 //Node 23

T13 + T23 + T25 + T35 - 4*T24 = 0 //Node 24

T14 + T24 + T26 + T35 - 4*T25 = 0 //Node 25

T15 + T25 + T27 + T36 - 4*T26 = 0 //Node 26

T16+ T26 + T28 + T37 - 4*T27 = 0 //Node 27

T17 + T27 + T29 + T38 - 4*T28 = 0 //Node 28

T18 + T28 + T30 + T39 - 4*T29 = 0 //Node 29

T19 + T29 + T31 + T40 - 4*T30 = 0 //Node 30

T20 + T30 + T32 + T41 - 4*T31 = 0 //Node 31

T21 + T31 + T33 + T42 - 4*T32 = 0 //Node 32

T22 + 2* T32 + T44 - 4*T33 = 0 //Node 33

T23 + 2*T35 + T45 - 4*T34 = 0 //Node 34

T24 + T34 + T36 + T46 - 4*T35 = 0 //Node 35

T25 + T35 + T37 + T47 - 4*T36 = 0 //Node 36

T26 + T36 + T38 + T48 - 4*T37 = 0 //Node 37

T27 + T37+ T39 + T49 - 4*T38 = 0 //Node 38

T28 + T38 + T40 + T50 - 4*T39 = 0 //Node 39

T29 + T39 + T41 + T51 - 4*T40 = 0 //Node 40

T30 + T40 + T42 + T52 - 4*T41 = 0 //Node 41

T31 + T41 + T43 + T53 - 4*T42 = 0 //Node 42

T32 + T42 + T44 + T54 - 4*T43 = 0 //Node 43

T33 + 2* T43 + T55 - 4*T44 = 0 //Node 44

T34 + 2*T46 + T56 - 4*T45 = 0 //Node 45

T35 + T45 + T47 + T57 - 4*T46 = 0 //Node 46

T36 + T46 + T48 + T58 - 4*T47 = 0 //Node 47

T37 + T47 + T49 + T59 - 4*T48 = 0 //Node 48

2*T38 + 2*T48 + T50 + T60 - 2*(3 + Ci)*T49 = -2*Ci*Tinfi //Node 49

2*T39 + T49 + T51 - 2*(2 + Ci)*T50 = -2*Ci*Tinfi //Node 50

2*T40 + T50 + T52 - 2*(2 + Ci)*T51 = -2*Ci*Tinfi //Node 51

2*T41 + T51 + T53 - 2*(2 + Ci)*T52 = -2*Ci*Tinfi //Node 52

2*T42 + T52 + T54 - 2*(2 + Ci)*T53 = -2*Ci*Tinfi //Node 53

2*T43 + T53 + T55 - 2*(2 + Ci)*T54 = -2*Ci*Tinfi //Node 54

T44 + T54 - (2 + Co)*T55 = -Ci*Tinfo //Node 55

T45 + 2*T57 + T61 - 4*T56 = 0 //Node 56

T46 + T56 + T58 + T62 - 4*T57 = 0 //Node 57

T47 + T57 + T59 + T63 - 4*T58 = 0 //Node 58

T48 + T58 + T60 + T64 - 4*T59 = 0 //Node 59

2*T59 + T49 + T65 - 2*(2 + Ci)*T60 = -2*Ci*Tinfi //Node 60

T56 + T62 - 2*T61 = 0 //Node 61

T61 + 2* T57 + T63 - 4*T62 = 0 //Node 62

T62 + 2* T58 + T64 - 4*T63 = 0 //Node 63

T63 + 2* T59 + T65 - 4*T64 = 0 //Node 64

T60 + T64 - (2 + Co)*T65 = -Ci*Tinfo //Node 65Thanks,
Matt
 
Physics news on Phys.org
  • #2


Dear Matt,

Thank you for sharing your code and explaining your difficulties with MATLAB and loops. It seems like you have a good understanding of the problem and have made a good effort in writing the code. However, there are a few things that I noticed that may be causing the error you are experiencing.

Firstly, it looks like you may have a few typos in your code. For example, in Node 25, you have written "T125" instead of "T25". This may be causing some confusion for the program. I would recommend going through your code again and checking for any other typos.

Secondly, I noticed that you have not defined the nodal temperatures before using them in the nodal equations. In MATLAB, you need to define variables before using them in equations. For example, before using T1 in Node 2, you need to define T1 as a variable by writing "T1 = 0;" or any other initial value. This may be why the program is saying you have too many unknowns.

Lastly, I would suggest breaking down the problem into smaller parts and testing each part separately. This will help you identify any errors and understand the problem better. Also, there are many resources available online for learning MATLAB and writing loops. You can also try reaching out to your classmates or a tutor for help.

I hope this helps and good luck with your program!
 

Related to Troubleshooting 2D Conduction With Matlab and Interactive Heat Transfer

1. How do I input my own material properties into the Matlab program?

In order to input your own material properties, you can use the "prop" function in Matlab. This function allows you to specify the thermal conductivity, density, and specific heat of the material you are working with.

2. How do I adjust the size and shape of the 2D model?

You can adjust the size and shape of the 2D model by changing the dimensions of the meshgrid in the Matlab code. The meshgrid specifies the x and y coordinates of the grid points, so changing these values will change the size and shape of the model.

3. How do I set the initial temperature and boundary conditions?

The initial temperature and boundary conditions can be set by using the "T" function in Matlab. This function allows you to specify the initial temperature and boundary conditions for each point in the meshgrid.

4. How do I run the simulation and view the results?

In order to run the simulation, you can use the "pdepe" function in Matlab. This function solves the partial differential equations for heat transfer and provides the temperature profile at each point in the meshgrid. You can then use the "contourf" function to create a contour plot of the temperature distribution.

5. Can I change the time step and number of iterations in the simulation?

Yes, you can change the time step and number of iterations in the simulation by adjusting the "tlist" and "m" variables in the Matlab code. The "tlist" variable specifies the time points at which the temperature profile will be calculated, and the "m" variable specifies the number of iterations to be performed for each time point.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
2
Views
10K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
9K
Back
Top