Nonlinear conduction,where thermal conductivity depends on temparature

Click For Summary

Discussion Overview

The discussion revolves around solving a nonlinear differential equation where thermal conductivity is a function of temperature. Participants are exploring numerical methods, specifically the explicit finite difference method, to model heat conduction in a two-dimensional space.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant is attempting to solve the equation ∂²t/∂x² + ∂²t/∂y² * k(t) = -q using MATLAB, where k(t) = a - b*t, leading to a quadratic equation for temperature.
  • Another participant suggests that the use of a while loop and the error threshold of 0.0000001 may be unnecessary, proposing a different approach to update temperature values without root finding.
  • There is a clarification about the nature of k(i,j), with some participants indicating that k can be treated as a matrix even if it is nonlinear, while others question the linearity of the proposed k function.
  • One participant asserts that the formulation presented is incorrect, emphasizing that thermal conductivity should not be factored out from the derivatives in the differential equation.
  • Another participant argues that the derivation provided assumes k is a function of spatial coordinates, while it is actually a function of temperature, suggesting that the numerical method can still converge under the given conditions.
  • A later reply proposes an alternative form of the equation that includes derivatives of the logarithm of k, indicating that omitting these could lead to incorrect results.

Areas of Agreement / Disagreement

Participants express differing views on the correct formulation of the differential equation and the treatment of thermal conductivity. There is no consensus on the best approach to solve the problem, with multiple competing views remaining on how to handle the nonlinear aspects of the equation.

Contextual Notes

Participants have not fully resolved the implications of the assumptions regarding the relationship between thermal conductivity and temperature, nor the impact of those assumptions on the numerical methods being discussed.

annie.1991
Messages
5
Reaction score
0
Hi everyone,
i am trying to solve and program a non linear differential equation in MATLAB where thermal conductivity depends on temparature.I am trying it to solve by explicit finite difference method.
the given equation is ∂2t/∂x2+∂2t/∂y2 *k(t)= -q (x,y)

i have solved the equation taking k(t)= a-b*t,and when i further solved the equation it gave an quadratic equation. where temparature is the root of the equation.but unfortunately my program is running slow and not giving me precize results can anybody help me out in this.

n = 5;
x = linspace(0,1,n);
dx = x(2)-x(1);
y = x;
dy = dx;

Q =80;


M= zeros(n,n);
if (mod(n,2)==0)
M(n/2,n/2)=Q;
else
p = (n+1)/2 ;
M(p,p)= Q;
end


t = ones(n);

t(1,1:n) = 0;
t(n,1:n) = 0;
t(1:n,1) = 0;
t(1:n,n) = 0;
a = 1;
b = 0;
tic
error = 1; z = 0;

while error > 0.0000001
z = z+1;

tnew = t;

for i = 2:n-1
for j = 2:n-1

d = -((b*(tnew(i+1,j)+tnew(i-1,j)+ tnew(i,j+1)+tnew(i,j-1))) + (4*a));

e = ( a*(tnew(i+1,j)+tnew(i-1,j)+ tnew(i,j+1)+tnew(i,j-1))) + (M(i,j)* dx^2);

f = b*4;

answer=roots([f,d,e]);
t(i,j)= max(max(abs(answer)));
end
end
error = max(max(abs(tnew-t)));

end
toc
 
Last edited:
Physics news on Phys.org
Ummmm. I'm not sure, but since you're using a while loop, the tic and toc lines are probably unnecessary? Here's how I would handle it:

T i,j = [(Q i,j/k i,j)*dx^2 + T i+1,j + T i-1,j + T i,j+1 + T i,j-1]/4

Q i,j is the Q matrix you set up.

k i,j would be a matrix with values of k estimated from the last iteration, it would be convenient to store this in a matrix as well.

T i,j is the temperature at point i,j, and the others are offset from i,j by one in the + or - x or y directions (similar to what you already have).

As for the root finding lines that you threw in there, they are completely and totally unnecessary. As long as you update the values of k for each index of the matrix in each loop, the values will converge on their own over time. Your calculation of the error should work okay, but I don't think the number you chose for the error limit needs to be that small. 0.0000001 is extremely small, and it could take a long time to get it that low. Try something larger first, like 0.001. Then solve it down to 0.0001 and see if that changes anything, likely it won't make much of a difference to the final answer you get.
 
Thanks for your reply and your sujjestion,
Probably What i can undestand from your sujjestion is the linear heat conduction,but i am trying to do a non linear heat conduction where thermal conductivity (K) depends on Temparature (T).If you would have any better idea of solving this kind of equation please share with me

I didnt undestand what you are saying about K(i,j),,what exactly is this K(i,j) ?
 
So, K (conductivity) has it's own matrix, where i and j are the indices (for any of the mentioned variables). Even if K is non-linear as a function of temperature, typically you can still use the same method and get convergence of your array.

I'm a little bit confused, above you have written k = a-b*t, which is linear. What is the equation that describes k as a function of temperature? True, the differential equation becomes non-linear after using a temperature dependent conductivity, but the conductivity itself appears to be linear.

Even if it isn't, as long as you have a function for conductivity versus temperature, it should converge (unless it's a really weird relationship in terms of conductivity going to zero or negative numbers).
 
i understood about k(i,j).if i take initial values of k as ones matrix and run the program with your given sujjestion then there will be no influence or no change in values of martix K.

in my code I have considerd K(T) = a - b*T where a>>b a and b are variables. i just taught i can see the variations of temperature depending on the values of a and b.I just wanted to write down in the equation where tempearture is changing with some other variables.

So If you feel like my idea doesn't works (or) my idea is wrong with the physics,then please share any other ideas which you have to solve this equation where i can see the conductivity changing with temperature.
 
You formulation for the case of temperature-dependent thermal conductivity is incorrect. You should not have factored out the thermal conductivity from the derivatives. It should be:

\frac{∂}{∂x}\left(k\frac{∂T}{∂x}\right)+\frac{∂}{∂y}\left(k\frac{∂T}{∂y}\right)=-q
or equivalently
\frac{1}{k}\frac{∂}{∂x}\left(k\frac{∂T}{∂x}\right)+\frac{1}{k}\frac{∂}{∂y}\left(k\frac{∂T}{∂y}\right)=-\frac{q}{k}
or equivalently
\frac{∂^2T}{∂x^2}+\frac{∂^2T}{∂y^2}+\frac{∂lnk}{∂x}\frac{∂T}{∂x}+\frac{∂lnk}{∂y}\frac{∂T}{∂y}=-\frac{q}{k}

Chet
 
Chestermiller said:
You formulation for the case of temperature-dependent thermal conductivity is incorrect. You should not have factored out the thermal conductivity from the derivatives.

Ummmmm, I could be wrong, but Chet's derivation assumes k is a function of x and/or y? This is not the case you've laid out here, where k is only a function of temperature. True, temperature is also a function of the location, but that's why you calculate a new value for k at each iteration and location. (The derivation is not wrong, just unneccesary from what I've always seen done for a numerical method.) Given the conditions described, a>>b, it should have no trouble converging. Because you're solving the equation one element at a time, you can pull k out of it so long as k at each element gets calculated and is updated each iteration.
 
Last edited:
jlefevre76 said:
Ummmmm, I could be wrong, but Chet's derivation assumes k is a function of x and/or y?
Not exactly. k is a function of temperature, and temperature is a function of x and y, so k is a function of x and y. In evaluating the derivatives involving lnk in the equation, you get k(T) at each of the grid points, and then use a central difference approximation to get the derivatives at the grid point under consideration. If you omit those derivatives of lnk, you will get the wrong answer to the problem. I have a lot of industrial experience in solving problems like this in the real world.

Another form of the equation that works is:

\frac{∂^2T}{∂x^2}+\frac{∂^2T}{∂y^2}+\frac{∂lnk}{∂T}\left[\left(\frac{∂T}{∂x}\right)^2+\left(\frac{∂T}{∂y}\right)^2\right]=-\frac{q}{k}

where ∂lnk/∂T is evaluated at the grid point under consideration.

Chet
 
Last edited:

Similar threads

  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 0 ·
Replies
0
Views
3K
  • · Replies 0 ·
Replies
0
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
924
  • · Replies 3 ·
Replies
3
Views
3K