Temperature convergence problem with nonsmooth thermal conductivity
Hi all,
I am trying to run a problem where thermal conductivity is a non-smooth function of temperature, where the non-smoothness results from dealing with a phase change material. I am having trouble getting the temperature equation of the solver to converge under certain conditions and would be curious if anyone has any thoughts as to what may be going wrong. In my model, the conductivity is a linear function of temperature. For regions yet to be melted, the conductivity is k1(T) = a*T + b. Once a region has been melted, the conductivity becomes k2 = kfactor*k1(T), even if it re-solidifies. kfactor is between 10 and 100 for problems I want to run. This creates regions in the mesh where cells located next to each other can have similar temperatures but have a jump in conductivity between 10x and 100x. When I set kfactor to 1, my case runs smoothly with no convergence issues. If I modify my code to ignore the melted/unmelted distinction and let conductivity k = k2(T), I get the same (good) behavior as when I use kfactor = 1. This leads me to believe that I don’t have a bug in the implementation of the conductivity function and that the non-smooth jump in conductivity between cells may be the culprit. Below I include my solver setting files, as well as the last few lines of the OpenFoam equation residual output which includes the initial temperature equation blow-up and subsequent simulation crash. I’d be grateful if anyone has any ideas on how to resolve the issue of the temperature equation blowing up for kfactor > 10. I’m hopeful that tweaking some solver settings could iron out the convergence issues – I’ve made some blind attempts so far, but no luck. Any thoughts are appreciated! Thank you! fvSchemes: Code:
/*--------------------------------*- C++ -*----------------------------------*\ Code:
/*--------------------------------*- C++ -*----------------------------------*\ Code:
... |
Hi
There is a paper from Voller saying that you should use harmonic interpolation for non constant thermal conductivity. (TREATMENT OF DISCONTINUOUS THERMAL CONDUCTIVITY IN CONTROL-VOLUME SOLUTIONS OF PHASE-CHANGE PROBLEMS V. R. Voller & C. R. Swaminathan) But I don't think that this is your main problem. With a non constant thermal conductivity you are introducing a non linearity into your problem and you have to use iterations to resolve it. I don't know how you are resolving the phase change but you can update the thermal conductivity in that iteration loop. Best Moritz |
Hi Moritz,
That is a great tip and using a harmonic interpolation scheme for the laplacian does seem to solve my convergence issues. Thank you! Also just a note that my solver is already set up to iterate to handle the nonlinearities in the temperature equation, with temperature and conductivity updates in the appropriate places. Your answer also led me to to a better understanding of how the laplacian term and non-constant conductivity is handled in OpenFoam/FVM versus how I would actually like it to behave. This may be the wrong subforum to discuss this, but I'll elaborate here: Let's assume my model consists of phases 1 and 2. As previously described, each phase has conductivity as a linear function of temperature but k2(T) = 100*k1(T). For my specific problem, heat flows well (higher conductivity) between a 1-2 and 2-2 interface but not between a 1-1 interface. If you do harmonic interpolation you can see that it actually gives an interpolated value of a conductivity much closer to the low k1 value than the k2 value at a 1-2 interface, which is not the result I would like for my model. So I would actually like to define conductivity between a 1-1 interface as k1(T) and between a 1-2 and 2-2 interface as k2(T), with T taking the interpolated temperature value between cells. How to do this in OpenFoam is another question altogether, but I would like to ask, is there anything about that approach that is numerically flawed and would lead non-convergence of the solver? |
Hi
I think it is possible to define the surfaceScalarField for the laplacian directly. So you could interpolate your phase fraction (let us assume its called alpha) on the cell faces. If alpha is zero you prescribe thermal conductivity 1 to that face. If alpha is greater than zero thermal conductivity 2. I not 100% sure if you can do it directly on the surfaceScalarField with pos/neg function but I am sure that you can do it with a forAll loop. Best Moritz |
Hi Moritz,
Thanks again for your thoughts. The programmer's manual confirms that you can supply a surfaceScalarField as the coefficient argument to fvm::laplacian, so your method for prescribing thermal conductivity should work for me. I will try it out and see it how it behaves. Also, I just wanted to note that I was able to get my model to work with linear interpolation of the diffusion coefficient when I reduced the time step. So to summarize for any other interested readers, I was able to avoid non-convergence of my solver by 1) Using harmonic interpolation of the diffusion coefficient (specified in fvSchemes). This solved my convergence issue, although I realized the resulting solution didn't behave how I wanted it to for my specific model. 2) Retaining linear interpolation of the coefficient but reducing the timestep for my transient simulation. A larger reduction was required when I used boundary conditions which induced sharper thermal gradients. Thanks very much for your replies, Moritz, as I learned a lot and also solved my issue. |
All times are GMT -4. The time now is 19:27. |