Modeling 2D Heat Conduction Using Matlab & Central Divided Difference Method

In summary, the conversation is about using Matlab to model and solve a 2D steady state heat conduction problem. The problem involves a square section duct buried in the Earth at a steady temperature of 60 degrees C, and the goal is to show how the heat from the duct propagates into the surrounding earth and provide temperatures at different points across a 2D section. The conversation includes a discussion about using the central divided difference method to calculate the temperatures, and the person is seeking help with writing a script for this in Matlab. They have provided a matrix with known and initial value guesses for the temperatures, and have mentioned using a for loop to run through multiple iterations. They have also shared their attempt at the syntax for calculating the temperatures
  • #1
grufff
4
0
1. The problem statement

I'd like to use Matlab to help me model and solve a simple 2D steady state heat conduction problem:

A square section duct is buried in the Earth some distance below the surface. This duct is at a steady temperature of 60 degrees C. I need to use the central divided difference method to show how the heat from the duct propagates into the surrounding earth, and provide temperatures at different points across a 2D section (end on) view.

Below is 8x8 matrix representing the known and initial value guesses for temperatures: 4 degrees all across the surface, -17 degrees at lowest depth of interest, linear temperature gradient between those two values at some distance to the right of the duct, and the duct itself on the left hand side at 60 degrees (rows 4 & 5, columns 1 & 2). All of the 10 degree values are initial guesses to get the iterative process under way.

4 4 4 4 4 4 4 4
10 10 10 10 10 10 10 1
10 10 10 10 10 10 10 -2
60 60 10 10 10 10 10 -5
60 60 10 10 10 10 10 -8
10 10 10 10 10 10 10 -11
10 10 10 10 10 10 10 -14
-17 -17 -17 -17 -17 -17 -17 -17

(sorry, can't get my matrix properly aligned in here)

The Attempt at a Solution



Intend to write an m file script setting A = above matrix. Start a for loop with i = 1:(some value, however many iterations I might need).

Define a new 8x8 matrix B, using central divided differencing with data pulled from A to create each element of matrix B

Once this process is complete, set A = B (to map all the newly calculated values from B onto A), and return to start of loop to run through next iteration. Repeat until desired accuracy is reached.

Central differencing requires me to sum values from "north, south, east and west" of my point of interest and divide by 4 to find a new value. For example, to calculate value of B(2,2), I use values around that point from A as follows:

B(2,2) = (A(1,2)+A(3,2)+A(2,1)+A(2,3))/4

I've guessed at that syntax, can anyone please give me a working example?

Also can I build my 8x8 B matrix from a simple list of expressions similar to above, one for each element to be defined?

ie:

B(2,2) = (A(1,2)+A(3,2)+A(2,1)+A(2,3))/4
B(2,3) = (A(1,3)+A(3,3)+A(2,2)+A(2,4))/4
etc.

I'd really appreciate any advice or comments anyone might have for me, this is my first Matlab experience.
 
Physics news on Phys.org
  • #2
Sorry to reply to my own post, but I'm okay with this now. The script was really quite straightforward to write.

The syntax

B(2,2) = (A(1,2)+A(3,2)+A(2,1)+A(2,3))/4
B(2,3) = (A(1,3)+A(3,3)+A(2,2)+A(2,4))/4

does work fine. It's simple to modify the matrix in this way, and then loop it for repeated iterations.
 

1. How does the Central Divided Difference Method work for modeling 2D heat conduction?

The Central Divided Difference Method is a numerical technique used to approximate the second derivative of a function. In the context of 2D heat conduction, this method involves dividing the domain into a grid of points and using the temperature values at these points to calculate the rate of change of temperature in both the x and y directions.

2. Why is Matlab commonly used for modeling 2D heat conduction?

Matlab is a powerful and versatile software that allows for efficient and accurate numerical calculations. It also has built-in functions and tools specifically designed for solving heat conduction problems, making it a popular choice for scientists and engineers.

3. What are some assumptions made when using the Central Divided Difference Method for heat conduction modeling?

The Central Divided Difference Method assumes that the material being modeled has a constant thermal conductivity and that the temperature at the boundary of the domain remains constant over time. It also assumes that the temperature gradient in the x and y directions are continuous.

4. Can the Central Divided Difference Method be used for 3D heat conduction modeling?

While the Central Divided Difference Method is commonly used for 2D heat conduction, it can also be extended to 3D problems by incorporating the additional dimension into the calculations. However, this can significantly increase the complexity and computational cost of the model.

5. How can I validate the results of my heat conduction model using the Central Divided Difference Method?

One way to validate the results of a heat conduction model is to compare them to analytical solutions or experimental data. Additionally, performing a sensitivity analysis and varying different parameters in the model can help identify any errors or limitations in the calculations.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
7
Views
891
  • Engineering and Comp Sci Homework Help
Replies
3
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
25
Views
4K
Replies
131
Views
4K
  • Engineering and Comp Sci Homework Help
Replies
9
Views
7K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
9K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Introductory Physics Homework Help
Replies
6
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
10K
Back
Top