|
[Sponsors] |
January 31, 2014, 04:56 |
Implementing tabular heat capacity
|
#1 |
Senior Member
Join Date: Oct 2013
Posts: 397
Rep Power: 18 |
Hello,
I'm currently working on implementing a heat capacity model using tabulated T- and p-dependent data. I based the library on the hPolynomial model which works with my solver, and reimplemented cp(), ha(), hs(), hc() and s() using an interpolation2DTable for cp and a T-integrated table for enthalpy calculation. The values in the table are comparable to the values I used in the polynomial model, however, the temperature calculation fails on the very first step, with the "Maximum number of iterations exceeded" error in the temperature calculation function T(). When I use the limit() function to specify valid ranges for T, I see very extreme negative values (-90000 to -1e7). Clamping them does not help. Why would there be negative temperature values? Are they an artifact of the iteration procedure in T()? Is it diverging because I can't provide meaningful data in this range? I have the tables set to clamp, so the capacity and the enthalpy will be constant for these temperatures. Would it help if I use linear extrapolation instead of clamping maybe? Is there anything tricky that I might have missed? The tabulated data isn't as smooth because it contains enthalpies of transitions, can this lead to problems? I'm also a bit confused about the mixture functionality. I only want to work with a single component, does this mean I can safely ignore the operatores for adding, subtracting and multiplying mixtures? I don't have meaningful implementations of them right now, but to my current understanding it should not be needed for my case? On a related note, where can I find information about the temperature calculation? I'm having some difficulties understanding the code in the T() function and it's subroutines. I'm also not quite sure where the reference temperature specie::Tstd comes from? I have looked into constants.h and its includes, but where is the value specified? Edit: I have looked some more into the temperature iteration routine, and I believe it uses a newton algorithm for inverting the H(T,p) function to T. This points indeed to problems when the gradient of this function becomes zero, as it does outside of the table range. I'll try to implement an extrapolating table class to fix this. However, please share your knowledge with me Last edited by chriss85; January 31, 2014 at 06:11. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
mass flow in is not equal to mass flow out | saii | CFX | 12 | March 19, 2018 05:21 |
Question about heat transfer coefficient setting for CFX | Anna Tian | CFX | 1 | June 16, 2013 06:28 |
error message | cuteapathy | CFX | 14 | March 20, 2012 06:45 |
Constant velocity of the material | Sas | CFX | 15 | July 13, 2010 08:56 |
Two-Phase Buoyant Flow Issue | Miguel Baritto | CFX | 4 | August 31, 2006 12:02 |