|
[Sponsors] |
August 18, 2014, 04:33 |
Performance hint for material libraries
|
#1 |
Senior Member
Join Date: Oct 2013
Posts: 397
Rep Power: 18 |
Just as a hint for others:
I had to implement a material library based on tabular data for the various thermophysical properties. Most notably here is the enthalpy. OpenFOAM uses a root-finding algorithm for inverting the h(p, T) function to T(p, h). If the h(p, T) function is numerically expensive (such as in the case of interpolation tables), there can be a massive performance drop. Instead it is better to implement a new class that replaces hePsiThermo (or a similar one that you use) that uses a table with pre-calculated T(p, h) values. It is very important that the inverted table class returns exactly the same results, as even a small deviation will result in largely different end-results. In my case, I first interpolate the pressure value for each point in the relevant range and then interpolate temperature or enthalpy. With such a bilinear interpolation the mapping between both tables is exact. Took me a few days to find a working method All in all, I notice a performance improvement of 450-500% in a flow solver based on sonicFoam, not solving any other equations other than flow. In more complex solvers this performance margin will not be as large as time is spent on solving other equations, but I think this figure is still very significant. |
|
August 22, 2014, 05:15 |
|
#2 |
Senior Member
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 21 |
Do you plan to release the framework/class structure for such a library? Even without the material data this would be very interesting.
|
|
August 22, 2014, 05:46 |
|
#3 |
Senior Member
Join Date: Oct 2013
Posts: 397
Rep Power: 18 |
I'll have to check if I can since I'm developing for a commercial application.
In the end it's an extension to the interpolation2DTable class for extrapolation and some classes for the thermophysical models that return data based on these tables instead of analytical formulas like most of the current implementations do. Getting good tabulated data proves to be the most difficult task. Anyone knows of any reliable programs which are able to calculate properties of plasmas for air and polymers? For absorption coefficients I have been using SPARTAN, which seems to produce good results for lower temperatures, unfortunately its integrated databases don't include multiple ionized species yet. |
|
August 22, 2014, 06:01 |
|
#4 |
Senior Member
Olivier
Join Date: Jun 2009
Location: France, grenoble
Posts: 272
Rep Power: 17 |
Hello,
Like Joachim, i would be really happy if you could release your interpolation table and Thermos model. About plasma properties, this is always a difficult task to get good data, but you can take a look at: http://fr.lxcat.net/home/ regards, Olivier |
|
August 22, 2014, 07:01 |
|
#5 |
Senior Member
Join Date: Oct 2013
Posts: 397
Rep Power: 18 |
Thanks for the link! Unfortunately my knowledge in the field of plasma chemistry is very shallow, but from what I've understood these programs and databases should allow the calculation of rho(p,T) (density) and mu(p,T) (viscosity) tables?
That would be one step in the total task. One also needs h(p,T) (enthalpy), lambda(p,T) (heat conductivity), sigma(p,T) (electrical conductivity) and kappa(nu, p,T) (spectral absorption coefficient). Is it possible to calculate the thermodynamic quantities from these databases?. I have some of this data from this paper: http://epjd.epj.org/articles/epjd/ab...305/d9305.html However I'm also looking for data in higher pressure ranges (< 500 bar), spectral absorption coefficients for these ranges and also data sets for polymers. Some polymer data is shown in http://iopscience.iop.org/0022-3727/29/7/033, but again, the range is too limited for my applications |
|
August 22, 2014, 08:19 |
|
#6 |
Senior Member
Olivier
Join Date: Jun 2009
Location: France, grenoble
Posts: 272
Rep Power: 17 |
hello,
ok, sorry, but this link will not give you thermos properties, since usually we deals with gas so we use perfect gas Thermos model. But you can get the most important part, which is plasma mobility, diffusivity and kinetics and energy exchange. Electric conductivity is linked to electronic density and frequency (! usually complex number). So other properties come from kinetic theory /perfect gaz. regards, olivier |
|
August 26, 2014, 09:40 |
|
#7 |
Senior Member
Join Date: Oct 2013
Posts: 397
Rep Power: 18 |
I fear I won't get any trustworthy results soon, calculating plasma composition feels quite difficult already.
I will package my tabulated material models code soon and release it, so feel free to use it then. Just keep in mind that it's work in progress and future changes are possible. |
|
September 17, 2014, 04:41 |
|
#8 |
Senior Member
Join Date: Oct 2013
Posts: 397
Rep Power: 18 |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] difficulties installing swak4foam | newbie29 | OpenFOAM Community Contributions | 120 | October 21, 2022 04:01 |
compiling libraries - LIBBIN and USER_LIBBIN | grjmell | OpenFOAM Programming & Development | 4 | June 17, 2022 22:06 |
parallel performance on BX900 | uzawa | OpenFOAM Installation | 3 | September 5, 2011 15:52 |
Linux kernel performance enhancement | ConnClark | OpenFOAM | 0 | January 17, 2011 18:18 |
Fortran90 (creating executable by using libraries) | Ravi | Main CFD Forum | 0 | September 27, 2004 22:34 |