Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Nonlinear heat equation -- Handling the conductivity

  1. Oct 29, 2015 #1
    Hey! I'm currently solving the heat equation using finite differences. I have a conductivity [itex]k(u)[/itex] that varies greatly with temperature. It even drops to zero at [itex]u=0[/itex].
    I have discretized the equations the following way:

    [itex]\frac{\partial}{\partial x}\left( k(u) \frac{\partial u}{\partial x}\right) = \alpha \frac{\partial u}{\partial t}[/itex]

    [itex]\frac{1}{\Delta x^2}\left( k_{i+\frac{1}{2}}(u_{i+1}-u_i) - k_{i-\frac{1}{2}}(u_{i}-u_{i-1}) \right) = \alpha \frac{\partial u}{\partial t}[/itex]

    My question is basically how to choose [itex] k_{i+1/2} [/itex] in a clever way. One way is to use [itex] k_{i+1/2} = (k_{i}+k_{i+1})/2[/itex](If k is discretized). Another to use [itex]k_{i+1/2} = k(x_i + \Delta_x/2)[/itex].

    But the method I am considering is to choose [itex] k_{i+1/2} [/itex] in such a way that the total heat moved between the gridpoints is equal to [itex] k_{i+1/2}(u_{i+1}-u_{i}) [/itex], assuming that u(x) is linear between the gridpoints.

    Thus we get: [itex]k_{i+1/2}\frac{(u_{i+1}-u_{i})}{\Delta x}\Delta x = \int_{u_i}^{u_{i+1}} k(u) \frac{\partial u}{\partial x} dx = \int_{u_i}^{u_{i+1}} k(u) du [/itex] or [itex]k_{i+1/2} = \frac{1}{(u_{i+1}-u_{i})} \int_{u_i}^{u_{i+1}} k(u) du[/itex].

    What do you guys think of the approach? Is it reasonable? This essentially becomes a finite volume method does it not? Will it work even in two dimensions, without further complications?
    Last edited: Oct 29, 2015
  2. jcsd
  3. Nov 3, 2015 #2
    Thanks for the post! This is an automated courtesy bump. Sorry you aren't generating responses at the moment. Do you have any further information, come to any new conclusions or is it possible to reword the post?
  4. Nov 4, 2015 #3
    Your method looks kind of interesting, although I'm not sure it will be much more accurate than just using k at the adjacent average temperatures. Don't forget that this would give the exact same result as the value at the average temperature if k varies linearly with u. So, you've got to wonder if it's really worth the effort. Also, it isn't immediately obvious to me how this would be extended to 2D.

  5. Nov 5, 2015 #4
    Thanks for the answer and the bump.

    In reservoir simulation they use a not so different approach to the one i gave above to conclude that the harmonic average should be used instead of the arithmethic for the permeabilities in Darcy's law( I.e. equivalent to the conductivity in the heat equation.) if it varies over space as discrete steps, as these macro-parameters often do in practical use. I agree that it is not very useful in my example.

    I haven't pursued this any more, since it was an attempt to to improve on a numerical solution that wasn't working properly, becoming unstable and not conserving heat. I now know that this was due to an advection term not included in the equation above(I wanted to state the problem as generic as possible, little did i know that I was leaving out the problem itself xD). The equation should be:[itex] \frac{\partial}{\partial x}\left( k(u)\frac{\partial(u-c(x,t))}{\partial x}\right) = \alpha\frac{\partial u}{\partial t}[/itex]. Choosing [itex] k_{i+1/2} = 0.5(k_i+k_{i+1})[/itex] should give a conservative scheme, so this was not my problem. Rather it was that central differences(which i need to have a conservative scheme) doesn't work well for advection-diffusion equations if the advection flux becomes of the same order of magnitude or larger than the diffusion flux.

    I think the right thing for me to do is to include artificial diffusion.

    Does anyone have any tips on how to do this should be done, given that this is a 2d problem? Can I just augment all the [itex]k_{i+1/2}[/itex] for the diffusion term, so that I get an acceptable Peclet number (advective flux divided by diffusive flux)? Is it OK to not just add a constant artificial diffusion, but rather let it vary over space?
  6. Nov 5, 2015 #5
    I can give you lots of advice on this, because I have worked on similar problems, both in heat transfer and in reservoir modeling (i.e., groundwater).

    Let's start with that transport equation. It doesn't look correct to me. The advection term doesn't look familiar to me. What are you doing there?

    Regarding use of artificial diffusion, I would definitely not use that.

    Are you solving the time integration fully implicit?

  7. Nov 5, 2015 #6
    OK. So the equation describes flow of oil, not heat(just wanted to make the question generic, since the math is basically the same). It is a 3D problem that has been reduced to 2D. [itex]k(u)[/itex] is a relative permeability. I.e. When there is no oil, it is zero, when there is only oil and no water, it is equal to the permeability of the rock. The advection term arises from buoyancy of the oil against the top barrier of the layer where the oil flows, [itex]z(x,y,t)[/itex] which is not entirely flat, and changes with time.

    I use an ADI scheme. But as of now I keep [itex] k(u)[/itex] explicit. It works well in most cases. However, when one of my parameters becomes small, the advection term becomes stronger compared to the other term, and I get trouble.

    Do you think making [itex]k(u)[/itex] implicit as well would make the problem more stable?
    I am looking for stability and mass conservation. Accuracy is not that crucial as long as the general features of the solution are intact.
  8. Nov 5, 2015 #7
    I don't think so.
    Is it possible to go fully implicit, or is the problem too large for that?

    My experience has been single phase, associated with deepwell injection of hazardous waste. Some of the modeling we did took into account density driven flow in cases where the injectate density (typically dilute aqueous solution) is of lower or higher density than that of the formation fluid.

    I have always found advection diffusion equations very nasty, and it is an area where, in my opinion, no satisfactory solution has ever been found. In the work that we did on underground injection, we struggled to deal with it all the time, mostly by going to smaller time steps.

    How important is the diffusion? If it can be approximately neglected, it is possible to consider solving the transport by the method of characteristics.

  9. Nov 6, 2015 #8
    It sounds to me like it is still single phase. Also if you have a nicely resolved lattice perhaps you could solve the outer derivative using a fourier transforms and get the conservation equation on u that way.

    What is c(x,t) ?
  10. Nov 6, 2015 #9
    I tested going fully implicit, but it didn't help much. The diffusion may be unimportant in some areas but in others, the diffusion and advection/buoyancy need to cancel each other out. If not, all the oil would accumulate in a delta function of a local maximum of the layer, instead of having a horizontal barrier between oil and water. Tried a bit with artificial diffusion, to smooth out the moving front, but it looks like it wont help much either. Guess I need to crank up the number of timesteps :/

    The equation only looks at the oil phase, yes. But it is derived from two-phase equations, assuming that the pressure fluctuations in the water phase are small, due to a higher permeability. c(x,t) is the gradient of the layer, which creates flow together with the buoyancy of the oil.
    This method sounds interesting. I am using a regular 2d grid. Do you have any links to examples or references?
  11. Nov 6, 2015 #10
    Going fully implicit is usually supposed to help, but not if vΔt ≥ Δx. I forgot what this limitiation is called.

    I take it back. Fully implicit is supposed to be unconditionally stable irrespective of the step size if the problem is linear (from all the discussions I've read up on). Even if the equations are not linear, I'm surprised that the fully implicit scheme was not stable. Certainly, it should allow you to go to much larger time steps.

    Last edited: Nov 6, 2015
  12. Nov 6, 2015 #11
    Yes, I was already taking rather large timesteps, though ^^ Solution did not conserve mass well enough for practical use, but it did not crash, so I guess that makes it stable?
  13. Nov 6, 2015 #12
    Is it possible to set up the spatial finite difference scheme so that it automatically conserves mass?
  14. Nov 6, 2015 #13
    Not to my knowledge... I guess using larger step sizes/control volumes where there is expected to be more rapid flow would help some?(at the price of accuracy)
  15. Nov 6, 2015 #14
    What I'm saying is that, when I set up finite difference schemes in problems like this, I choose a scheme that I can show automatically conserves mass at the finite difference level (while still being second order). Would you like to try me out on a couple of terms to see how I would do it?
  16. Nov 7, 2015 #15
  17. Nov 9, 2015 #16
    Don't we still need an equation on c(x,t)? Or perhaps it is just specified somehow?
  18. Nov 9, 2015 #17
    The c(x,t) field is one of the input parameters for the model :)
  19. Nov 9, 2015 #18
    Is that term in the equation presented in post #4 really what you are calling the advection term? It doesn't look like the kind of advection terms I'm used to seeing. How come it is being multiplied by k if it is advection? Shouldn't it involve u?

  20. Nov 10, 2015 #19
    You're right, the u dependence comes from k(u)... I dont know if that is enough to call it an advection term technically or not... But definetly not your standard advection case.

    I have made a bit more progress on the problem, by making some simplifications in my model, making k(u) not change so rapidly. I have a bit more flexibility with what parameters to choose now. However, my numerical solution has the dubious property that it sometime needs a lot of gridpoints(not timesteps, but gridpoints) to converge. This strengthens my suspicion that it is the discontinuous edges where u drops to zero that is the problem...
  21. Nov 10, 2015 #20
    OK. So, for whatever reason, your advection term is ##\frac{\partial}{\partial x}\left(k(u)\frac{\partial c}{\partial x}\right)=\frac{\partial (f(x,t)k(u))}{\partial x}##. Here's a finite difference representation that automatically conserves mass at the finite difference level:

    $$\frac{f(x+(\Delta x /2)\bar{k}_{x+(\Delta x /2)}-f(x-(\Delta x /2)\bar{k}_{x-(\Delta x /2)}}{\Delta x}$$
    $$\bar{k}_{x+(\Delta x /2)}=\frac{\int_{u(x)}^{u(x+\Delta x)}{k(u)du}}{u(x+\Delta x)-u(x)}$$

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook