CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

IAPWSIF97 water properties

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree8Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 25, 2007, 04:23
Default Dear all, I'm simulating he
  #1
New Member
 
David Palko
Join Date: Mar 2009
Location: Stockholm
Posts: 17
Rep Power: 17
dpalko is on a distinguished road
Dear all,

I'm simulating heat trasfer to water at pressures higher than critical (22.1MPa) and in this region, the results are extremely sensitive to the accuracy of thermo-physical properties implemented. Therefore their correct implementation is of a critical importance for me. New IAPWS-IF97 water properties standard functions shows a very high accuracy and therefore i would like to have them implemented to OpenFOAM.
Basically, when hThermo model with pureMixture, sutherlandTransport, specieThermo, janafThermo, perfectGas is used as a template, methods in sutherlandTransport, janafThermo and perfectGas equations can be overloaded for this purpose.
My question is: when i create new transport, thermo and equationOfState clases, how do i link them to the rest of the code, so for example buoyantSimpleFoam would use them in the following form, let's say:
hThermo<puremixture<iapwstransport<speciethermo<ia pwsthermo<waterrealgas>>>>>

Thank you in advance

David
mgg likes this.
dpalko is offline   Reply With Quote

Old   September 25, 2007, 06:21
Default Hi David, I've been discuss
  #2
Member
 
lillberg's Avatar
 
Eric Lillberg
Join Date: Mar 2009
Location: Stockholm
Posts: 80
Rep Power: 17
lillberg is on a distinguished road
Send a message via Skype™ to lillberg
Hi David,

I've been discussing this with both Henry and also Niklas Nordin who's responsible for much of the thermodynamics structure in OF. It seems from these discussions that one way to implement a full thermodynamics package like the IAPWS-IF97 for water and steam which return both transport and thermo properties is by introducing the following classes:

IAPWSgas in addition to perfectGas
IAPWSthermo in addition to hConstThermo/janafThermo
IAPWStransport in addition to constTransport/sutherlandTtransport

then we have the following thermoType (through changes in basicThermos.C)

hThermo<puremixture<iapwstransport<speciethermo<ia pwsthermo<iapwsgas>>>>>

For multiphase flows it might help with a waterSteamMixture class to help with voidfraction dependent properties but this is probably best implemented on application level together with the interface functions.

We currently have all necessary IAPWS functions written in OpenFOAM syntax for implementation in the new classes.

Niklas recently implemented Peng-Robinson equation of state which also might be helpful.

Any new ideas would be much appreciated.

//Eric
lillberg is offline   Reply With Quote

Old   October 2, 2007, 06:41
Default Hi all, if you are interested:
  #3
Senior Member
 
mkraposhin's Avatar
 
Matvey Kraposhin
Join Date: Mar 2009
Location: Moscow, Russian Federation
Posts: 355
Rep Power: 21
mkraposhin is on a distinguished road
Hi all, if you are interested:
I found IAPWS'97 properties as C++ library (FreeSteam) in www.sourceforge.net

I have already adpated this library to OpenFoam 1.4(but it really slows down the calculation process)

If someone needs more information, please, write to my e-mail:
mkraposhin@inbox.ru

SORRY FOR BAD ENGLISH
mkraposhin is offline   Reply With Quote

Old   August 28, 2008, 07:51
Default Dear All, Does anyone know
  #4
New Member
 
David Palko
Join Date: Mar 2009
Location: Stockholm
Posts: 17
Rep Power: 17
dpalko is on a distinguished road
Dear All,

Does anyone know what definition of compressibility does OpenFoam use? I found that perfectGas psi() function returns 1.0/(R()*T). Assuming that compressibility is defined as psi=(-1/rho)*(drho/dT) at constant pressure, psi function should return 1.0/T.
I need the exact defintion in order to apply the compressibity for water in the correct way.
Thank you so much in advance,

David
dpalko is offline   Reply With Quote

Old   August 29, 2008, 03:54
Default Hi my impression is that psi=
  #5
hkb
New Member
 
Henrik Bergersen
Join Date: Mar 2009
Posts: 17
Rep Power: 17
hkb is on a distinguished road
Hi
my impression is that psi=rho/p.

PerfectGasI.H, line 48:
//- Return compressibility rho/p [s^2/m^2]

This is in agreement with basicThermo.H, line 205

//- Density [kg/m^3]
tmp<volscalarfield> rho() const
{
return p_*psi();
}

It would be very interesting to hear about your progress in implementing IAPWS-IF97.

Henrik
hkb is offline   Reply With Quote

Old   August 29, 2008, 04:28
Default Thank you Henrik, So the de
  #6
New Member
 
David Palko
Join Date: Mar 2009
Location: Stockholm
Posts: 17
Rep Power: 17
dpalko is on a distinguished road
Thank you Henrik,

So the definition of compressibility is psi=drho/dp at constant temperature which gives exactly rho/p for an ideal gas. Please could anyone confirm that i'm right?
In that case the density which is returned by basicThermo.H, line 205 (see below) is valid only if we use ideal gas approximation. Am i right?

//-Density [kg/m^3]
tmp<volscalarfield> rho() const
{
return p_*psi();
}

Thank you,

David
dpalko is offline   Reply With Quote

Old   September 11, 2008, 10:20
Default hmm, thread started a year ago
  #7
Member
 
Maxim Loginov
Join Date: Mar 2009
Posts: 33
Rep Power: 17
zeliboba is on a distinguished road
hmm, thread started a year ago...
is there anything new on freesteam/OpenFOAM integration? I'd like to try
zeliboba is offline   Reply With Quote

Old   September 11, 2008, 13:16
Default Maxim, The issue which i poi
  #8
New Member
 
David Palko
Join Date: Mar 2009
Location: Stockholm
Posts: 17
Rep Power: 17
dpalko is on a distinguished road
Maxim,
The issue which i pointed in the message above, Friday Aug-29 must be solved before you try anything.

David
dpalko is offline   Reply With Quote

Old   September 15, 2008, 15:02
Default Hi David I absence of input f
  #9
hkb
New Member
 
Henrik Bergersen
Join Date: Mar 2009
Posts: 17
Rep Power: 17
hkb is on a distinguished road
Hi David
I absence of input from people who actually know things, allow me to speculate. Unfortunately my knowledge of c++ is rudimentary, so I can't offer any solutions. However, the problem seems to be two-fold:

1. rho is not stored explicity by basicThermo, but constructed as p*psi. Can this be avoided by having basicThermo fetch the density directly from the equation of state, thereby bypassing psi in the calculation of density?

2. The second problem is that psi itself is called from various bits of the source code. I guess that means that we still need a proper definition of psi, even if the density may be possible to calculate even without using psi.

Best Regards
Henrik
hkb is offline   Reply With Quote

Old   September 16, 2008, 04:45
Default Hej Henrik, I absolutely ag
  #10
New Member
 
David Palko
Join Date: Mar 2009
Location: Stockholm
Posts: 17
Rep Power: 17
dpalko is on a distinguished road
Hej Henrik,

I absolutely agree with your points. Rho should be fetched from the equation of state, i am just wondering why OpenFoam doesn't do it this way. And i also agree that psi must be correctly implemented into the equation of state ( in the form: psi=drho/dp at constant temperature).

What i did until now is that i took the water properties, IAPWS-IF97 as implemented in matlab functions of XSteam and use them instead of mu(), kappa(), alpha(), cp(), h(), rho() and psi() functions in thermo, transport and equationOfState objects (one MSc student of Eric Lillberg helped with coding).
These functions differs in different regions of phase diagram, resulting into quite an ugly piece of code. Moreover, when the functions are called directly, they slows down the CFD calculation rapidly.
That's why i decided to use an other approach. Here i call the XSteam functions only when the contructor of thermo, transport or equationOfState is called and create the tables where user specifies the minimum and maximum temperature, number of points and reference pressure. Then all the points are generated at the begining of calculation (which takes around 1-2 minutes depending on the number of points) and during the run-time functions mu(), kappa() etc... use just the linear interpolation between two nearest points depending on the temperature. This approach is really fast and could be quite precise, depending on the size of your lookup table.
I quickly wrote the code (except psi(), which is not defined by XSteam IAPWS functions) and as i remember it runs quite ok. Later i gave up my work on that because i didn't need water properties anymore and didn't even have time for that. If you are interested we can try to make it work and finally solve the issue of water properties, however i warn you, the code at this stage is quite ugly (i just cannot manage to make all the indentations, comments etc..)

David
dpalko is offline   Reply With Quote

Old   September 16, 2008, 09:13
Default Hi David Your work is very in
  #11
hkb
New Member
 
Henrik Bergersen
Join Date: Mar 2009
Posts: 17
Rep Power: 17
hkb is on a distinguished road
Hi David
Your work is very interesting, but for my current projects the full IAPWS-IF97 is probably over-kill. Instead I have tried to write dedicated equations of state (e.g. rho as a polynomial function of T) to use mainly for flow of liquid water. To that end I still need to understand the function of psi. If you get any further with this, please let me know.

Henrik
hkb is offline   Reply With Quote

Old   June 16, 2009, 08:53
Default
  #12
Member
 
Jagmohan Meena
Join Date: May 2009
Posts: 30
Rep Power: 17
jmmeena is on a distinguished road
Quote:
Originally Posted by hkb View Post
Hi David
I absence of input from people who actually know things, allow me to speculate. Unfortunately my knowledge of c++ is rudimentary, so I can't offer any solutions. However, the problem seems to be two-fold:

1. rho is not stored explicity by basicThermo, but constructed as p*psi. Can this be avoided by having basicThermo fetch the density directly from the equation of state, thereby bypassing psi in the calculation of density?

2. The second problem is that psi itself is called from various bits of the source code. I guess that means that we still need a proper definition of psi, even if the density may be possible to calculate even without using psi.

Best Regards
Henrik
Dear Henrik,
I am facing exactly same problem now. Please share your valuable thoughts if you have found solution of above 2 problems ?

Best Regards,
JM
jmmeena is offline   Reply With Quote

Old   June 24, 2009, 06:53
Default IAPWS 97 Properties, liquid Sodium (Na), properties, Bismuth-Led (BiPb) properties
  #13
Senior Member
 
mkraposhin's Avatar
 
Matvey Kraposhin
Join Date: Mar 2009
Location: Moscow, Russian Federation
Posts: 355
Rep Power: 21
mkraposhin is on a distinguished road
Dear friends, here is link to water, Na and BiPb properties

http://www.os-cfd.ru/mamb/index.php?...1a69&no_html=1
mkraposhin is offline   Reply With Quote

Old   June 24, 2009, 07:06
Default
  #14
Member
 
Jagmohan Meena
Join Date: May 2009
Posts: 30
Rep Power: 17
jmmeena is on a distinguished road
Thankyou very much Matvej !!

JM
jmmeena is offline   Reply With Quote

Old   November 25, 2011, 07:24
Default
  #15
Member
 
Jinbiao Xiong
Join Date: Oct 2009
Location: China/Japan
Posts: 50
Rep Power: 17
JinBiao is on a distinguished road
Send a message via MSN to JinBiao
I am starting to investigate how to implement the water properties into openfoam at supercritical pressures. In IAPWS-97, the properties, such as specific heat capacity, are functions of density and temperature in the region 3 which includes the critical point. This does not agree with the style of thermalphysical model in OpenFOAM. Is there any smart solution for this?

Thanks in advance.
__________________
Jinbiao
JinBiao is offline   Reply With Quote

Old   November 28, 2011, 23:34
Default
  #16
Member
 
Jinbiao Xiong
Join Date: Oct 2009
Location: China/Japan
Posts: 50
Rep Power: 17
JinBiao is on a distinguished road
Send a message via MSN to JinBiao
I am keep going with the implementation of IAPWS-IF97 in OpenFOAM. My approach consists of the following steps.

1) build the interpolation table at constant pressure with T as the abscissa.
The table is generated with the aid of freesteam which can generate all the properties I need, such as density, enthalpy, entropy, heat capacity, conductivity and dynamic viscosity etc.

2) interpolate the properties according to T

The multi-layer implementation in my approach is
hPsiThermo<pureMixture<iapwsTransport<specieThermo <iapwsThermo<iapwsEOS>>>>>

This implementation is defined in thermophysicalModels/basic/psiThermo/hPsiThermo/hPsiThermos.H
with
makeBasicPsiThermo
(
hPsiThermo,
pureMixture,
iapwsTransport,
iapwsThermo,
iapwsEOS
);

A basicMixture is also defined in
thermophysicalModels/basic/mixtures/basicMixture/basicMixtures.C
with
makeBasicMixture
(
pureMixture,
iapwsTransport,
iapwsThermo,
iapwsEOS
);

However, the above-mentioned modifications doesnot make the implementation work. When I try to test the implementation with the tutorial case, buoyantCavity, I got the error
buoyantSimpleFoam: symbol lookup error: /home/jinbiao/OpenFOAM/OpenFOAM-2.0.1/platforms/linuxGccDPOpt/lib/libbasicThermophysicalModels.so: undefined symbol: _ZN4Foam14iapwsTransportINS_12specieThermoINS_11iapwsThermoINS_8iapwsEOSEEEEEEC1ERKNS_10dictionaryE

There seems something wrong with the dictionary lookup. The exact problem is still to be debugged.

Best,
__________________
Jinbiao
JinBiao is offline   Reply With Quote

Old   November 29, 2011, 03:24
Default
  #17
Senior Member
 
Markus Rehm
Join Date: Mar 2009
Location: Erlangen (Germany)
Posts: 184
Rep Power: 17
markusrehm is on a distinguished road
Hello,

have you correctly included all libraries and paths for IAPWS-IF97? You should double check that.

Do you plan to make your code available?

Markus
markusrehm is offline   Reply With Quote

Old   November 29, 2011, 22:33
Default
  #18
Member
 
Jinbiao Xiong
Join Date: Oct 2009
Location: China/Japan
Posts: 50
Rep Power: 17
JinBiao is on a distinguished road
Send a message via MSN to JinBiao
Markus,

Thanks for your reply. I am also thinking about that there may be some mistakes in library linking. The implementation of thermophysical property in OF is complicated. I do not fully understand what is wrong.

I will consider to make my code available. But I donot how to do that. Should I add to the OpenFOAM-2.0.1-extend for example?
__________________
Jinbiao
JinBiao is offline   Reply With Quote

Old   November 30, 2011, 04:01
Default
  #19
Senior Member
 
Markus Rehm
Join Date: Mar 2009
Location: Erlangen (Germany)
Posts: 184
Rep Power: 17
markusrehm is on a distinguished road
Hi,

maybe the libbasicThermophysicalModels is missing the link to the IAPWS-IF97 library.

And yes. The extend project is a good place. You can create an own account or have it put by another member.

Markus
markusrehm is offline   Reply With Quote

Old   November 30, 2011, 04:16
Default
  #20
Member
 
Jinbiao Xiong
Join Date: Oct 2009
Location: China/Japan
Posts: 50
Rep Power: 17
JinBiao is on a distinguished road
Send a message via MSN to JinBiao
Hi Markus,

I have solved the problem. I missed the line which includes the iapwsThermo.C file into iapwsThermo.H. And the same mistake in iapwsTransport.H. These files are not complied in the libspecie. Instead they were included in files like basicMixtures.C and consequently compiled in libbasicThermophysicalModels.

So the .C file should be included in the header files so that the libbasicThermophysicalModels can properly linked to them.

Now I am testing the implementation. I will try to create an account in the extend project soon. If the testing is good, I will share it.

Best,
__________________
Jinbiao
JinBiao is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
water properties in supercritical region Naveen CFX 2 April 14, 2009 14:45
standard water properties Thilip Kumar CFX 1 September 20, 2008 10:51
water vapour properties manoj korde FLUENT 4 June 2, 2006 01:47
shallow water VS deep water Paul Main CFD Forum 10 August 30, 2004 11:56
properties of water ? mp Main CFD Forum 0 March 5, 2003 04:41


All times are GMT -4. The time now is 08:37.