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 Community New Posts Updated Threads Search

Like Tree8Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 30, 2013, 11:07
Default
  #61
Senior Member
 
Christian Lucas
Join Date: Aug 2009
Location: Braunschweig, Germany
Posts: 202
Rep Power: 17
Chris Lucas is on a distinguished road
Hi,

have you added the macros from "makeBasicPsiThermo.H" and "makeBasicMixture.h" used to create the IAPWS Thermo class?

Christian

PS. By the way, download the latest version I pushed, removed some bugs (non in the IAPWS Library)
Chris Lucas is offline   Reply With Quote

Old   August 30, 2013, 11:11
Default
  #62
Senior Member
 
romant's Avatar
 
Roman Thiele
Join Date: Aug 2009
Location: Eindhoven, NL
Posts: 374
Rep Power: 20
romant is on a distinguished road
Quote:
Originally Posted by Chris Lucas View Post
Hi,

have you added the macros from "makeBasicPsiThermo.H" and "makeBasicMixture.h" used to create the IAPWS Thermo class?

Christian

No, I have not, where would I add those? In the *s.C in the .H or in the .C file? In the *s.C file I am using the makeThermo.H file, as this is the new base class in OF 2.2.1, makeBasicPsiThermo.H, makeBasicRhoThermo.H and makeBasicMixture.H do not exist anymore.
__________________
~roman
romant is offline   Reply With Quote

Old   August 30, 2013, 11:14
Default
  #63
Senior Member
 
Christian Lucas
Join Date: Aug 2009
Location: Braunschweig, Germany
Posts: 202
Rep Power: 17
Chris Lucas is on a distinguished road
HI,

not sure about OF2.2 but there should be a file where you find a marco (similar to the first one in "makeBasicPsiThermo.H"). Add the new macro (last one in "makeBasicPsiThermo.H").

Christian
Chris Lucas is offline   Reply With Quote

Old   June 16, 2014, 02:45
Default solution found
  #64
Senior Member
 
romant's Avatar
 
Roman Thiele
Join Date: Aug 2009
Location: Eindhoven, NL
Posts: 374
Rep Power: 20
romant is on a distinguished road
Hej Chris,

I have developed a solution and your input was helpful. Thanks. The solution for OF 2.2 and above can be found here http://www.cfd-online.com/Forums/ope...2-2-above.html or https://github.com/romansCode/IAPWS-IF97-OF
__________________
~roman
romant is offline   Reply With Quote

Old   March 21, 2015, 13:52
Default
  #65
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings to all!

@Roman: I've created a basic wiki page to help getting your toolkit known to the community that uses OpenFOAM technology: http://openfoamwiki.net/index.php/Contrib/IAPWS-IF97-OF

May you or anyone else feel free to update that wiki page!

Best regards,
Bruno
romant likes this.
wyldckat is offline   Reply With Quote

Old   March 23, 2015, 03:44
Default
  #66
Senior Member
 
romant's Avatar
 
Roman Thiele
Join Date: Aug 2009
Location: Eindhoven, NL
Posts: 374
Rep Power: 20
romant is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Greetings to all!

@Roman: I've created a basic wiki page to help getting your toolkit known to the community that uses OpenFOAM technology: http://openfoamwiki.net/index.php/Contrib/IAPWS-IF97-OF

May you or anyone else feel free to update that wiki page!

Best regards,
Bruno
Thanks Bruno,

this has been on my list for a while. I will undertake this as soon as possible.

Best regards,
Roman
__________________
~roman
romant is offline   Reply With Quote

Old   June 14, 2015, 05:29
Default wiki page up
  #67
Senior Member
 
romant's Avatar
 
Roman Thiele
Join Date: Aug 2009
Location: Eindhoven, NL
Posts: 374
Rep Power: 20
romant is on a distinguished road
I finally got around to it and the page is now up.
wyldckat and mcoveri like this.
__________________
~roman
romant is offline   Reply With Quote

Old   February 24, 2016, 21:07
Default
  #68
New Member
 
Will
Join Date: Feb 2016
Posts: 3
Rep Power: 10
mcoveri is on a distinguished road
I am trying to use the IAPWS-IF97-OF lib with the chtMultiregionSimpleFoam (SS CHT) solver in OF2.4.0.

I am operating at ~10MPa and 500-600K. I am not getting sensible results using the IAPWS-IF97 steam table lib with this solver. The density falls from the initial value (1e3kg/m^3) until it bottoms out at 2 kg/m^3. Visualizing the results shows that the pressure field is indeed around 1.e7 everywhere and that the temperature is around 500-550K. I attached the relevant case file for anyone to take a look at if they wish to help!

In addition, I tried using this steam table lib with OF3.0.1 however the library would not compile. I submitted a pull request on the github page that seems to fix the compile issue.

Edit:
I resolved my issue. Forgot to update the density limits set in the SIMPLE block of fvSolution.
Attached Files
File Type: txt controlDict.txt (1.3 KB, 17 views)
File Type: txt changeDictionaryDict.txt (7.8 KB, 16 views)
File Type: txt thermophysicalProperties.txt (1.6 KB, 34 views)

Last edited by mcoveri; March 6, 2016 at 01:33. Reason: fixed issue
mcoveri is offline   Reply With Quote

Old   December 31, 2017, 16:59
Default
  #69
New Member
 
Han
Join Date: Dec 2017
Location: USA
Posts: 9
Rep Power: 8
whhjken1 is on a distinguished road
Dear friends,

Recently I have been trying to implement IAPWS-IF97 into OpenFoam following the construction posted by Chris Lucas and Roman (https://openfoamwiki.net/index.php/C.../IAPWS-IF97-OF). My OpenFOAM is version 4.0 which is fully installed on Ubuntu 16.04. The freesteam is version 2.1, I believe it is successfully compiled because I tested it with both scons test && ./test and ipython.

I clone the IAPWS-IF97-OF to my home folder, when I compile it using "wclean && wmake libso", I got the following errors. I have searched google and CFD-online for several days, but still couldn't solve the problem. Can anyone tell me what else should I do to correctly compile IAPWS? Any help will be greatly appreciated. Thanks.

Have a happy new year everyone!

Han
Attached Images
File Type: jpg error1.jpg (204.6 KB, 31 views)
File Type: jpg error2.jpg (168.4 KB, 21 views)
File Type: jpg error3.jpg (194.1 KB, 15 views)
File Type: jpg error4.jpg (194.3 KB, 13 views)
File Type: jpg error5.jpg (206.4 KB, 14 views)

Last edited by whhjken1; December 31, 2017 at 21:36.
whhjken1 is offline   Reply With Quote

Old   December 31, 2017, 21:14
Default
  #70
New Member
 
Will
Join Date: Feb 2016
Posts: 3
Rep Power: 10
mcoveri is on a distinguished road
kinda spit-balling here: maybe try compiling with -std=c++11 or -fpermissive flag. Similar thing here: https://github.com/ANTsX/ANTsR/issues/4
mcoveri is offline   Reply With Quote

Old   December 31, 2017, 23:15
Default
  #71
New Member
 
Han
Join Date: Dec 2017
Location: USA
Posts: 9
Rep Power: 8
whhjken1 is on a distinguished road
Quote:
Originally Posted by mcoveri View Post
kinda spit-balling here: maybe try compiling with -std=c++11 or -fpermissive flag. Similar thing here: https://github.com/ANTsX/ANTsR/issues/4
Hi Mcoveri,

Thanks for your quick reply. Could you please show me how to compile it with -std=c++11 flag, I can't do it correctly. Moreover, in the link that you provided, it is suggested adding "-DVCL_CAN_STATIC_CONST_INIT_FLOAT=0" somewhere. For this IAPWS-IF97 lib, where exactly should I add this line to? I am totally lost. Thank you.

Han
whhjken1 is offline   Reply With Quote

Old   December 31, 2017, 23:32
Default
  #72
New Member
 
Will
Join Date: Feb 2016
Posts: 3
Rep Power: 10
mcoveri is on a distinguished road
Try adding

Code:
  - Wfpermissive \
Under the EXEC_INC block

In the make/options file in the iapws-if97-of source directory. See Passing compiler options to wmake?
mcoveri is offline   Reply With Quote

Old   January 1, 2018, 14:44
Default
  #73
New Member
 
Han
Join Date: Dec 2017
Location: USA
Posts: 9
Rep Power: 8
whhjken1 is on a distinguished road
Quote:
Originally Posted by mcoveri View Post
Try adding

Code:
  - Wfpermissive \
Under the EXEC_INC block

In the make/options file in the iapws-if97-of source directory. See Passing compiler options to wmake?
Hi Will,

Thanks for your suggestion. It didn't work with "-Wfpermissive ", but when I tried "-fpermissive ", all the errors turned into warnings. I tested the compiled lib by running a simple case, the results seem correct and all the properties vary with temperature. Thank you again for your kind help.

One last problem, the following information keep flashing on my terminal window when the simulation is running, but it didn't appear in the output log file. What can I do to remove these flashing from my terminal window?
Attached Images
File Type: png rho.png (10.3 KB, 23 views)
whhjken1 is offline   Reply With Quote

Old   January 7, 2018, 17:45
Default
  #74
New Member
 
Han
Join Date: Dec 2017
Location: USA
Posts: 9
Rep Power: 8
whhjken1 is on a distinguished road
Quote:
Originally Posted by mcoveri View Post
Try adding

Code:
  - Wfpermissive \
Under the EXEC_INC block

In the make/options file in the iapws-if97-of source directory. See Passing compiler options to wmake?
Hi Will,

I have run a channel flow and compared the results with CFX, they agree with each other quite well. Thanks again for your help.

Best,

Han
whhjken1 is offline   Reply With Quote

Old   June 10, 2019, 13:12
Default installation problem for IAPWS-IF97-OF
  #75
Member
 
Stanley John
Join Date: Sep 2018
Posts: 79
Rep Power: 7
sjohn2 is on a distinguished road
Hi all,

I am trying to install the the IAPWS-IF9 library to openfoam, using the link below:

https://openfoamwiki.net/index.php/C.../IAPWS-IF97-OF

I have cloned the files to OpenFoam-6/applications/utilities/

I get the following error after wmake:

Please see the attachment for details


The solver I am trying to use is rhoSimpleFoam

Any idea guys?
Attached Files
File Type: txt log1.txt (19.2 KB, 16 views)
sjohn2 is offline   Reply With Quote

Old   June 10, 2019, 15:10
Default
  #76
Senior Member
 
romant's Avatar
 
Roman Thiele
Join Date: Aug 2009
Location: Eindhoven, NL
Posts: 374
Rep Power: 20
romant is on a distinguished road
Hi John,


The library was originally written by me for up to version 2.4, a while ago .


It looks like a function in sensibleEnthalpy.H was changed from using 2 arguments to 3 arguments. Unfortunately, I do not have OpenFOAM installed on my computer anymore and will not be able to help you with this, but maybe someone else has an idea what was changed in release 6?


Cheers,
Roman
__________________
~roman
romant is offline   Reply With Quote

Old   June 13, 2019, 14:22
Default
  #77
Member
 
Stanley John
Join Date: Sep 2018
Posts: 79
Rep Power: 7
sjohn2 is on a distinguished road
Anyone else who has linked IAPWSIF97 library to OpenFoam-6?
sjohn2 is offline   Reply With Quote

Old   September 13, 2019, 05:40
Default How to add IAPWS-IF97 in OpenFOAM
  #78
New Member
 
Manoj
Join Date: Nov 2018
Posts: 6
Rep Power: 7
Manoj Paithane is on a distinguished road
Quote:
Originally Posted by lillberg View Post
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

How to add these file in OpenFOAM, Please elaborate more I am new to OpenFOAM.
I am running a simulation for superheated steam flow through pipe and using perfectGas as a equation of state which gives density values which is not the exact value. please guide me for this it will be very helpful for me.
Thanking you
Manoj Paithane is offline   Reply With Quote

Old   October 28, 2019, 20:35
Default
  #79
Member
 
Stanley John
Join Date: Sep 2018
Posts: 79
Rep Power: 7
sjohn2 is on a distinguished road
Hi Roman,

Looks like I am alone on this one. I have some basic knowledge on C++, but not at the level of OpenFoam programming am quickly working my way up. If you can give me some hints on one of the bugs then it would be useful to build on. One of the error

Quote:
In file included from thermoIAPWS/IAPWSthermos.C:31:0:
/home/sjohn2/OpenFOAM/OpenFOAM-6/src/thermophysicalModels/specie/lnInclude/sensibleEnthalpy.H:84:20: note: candidate: Foam::scalar Foam::sensibleEnthalpy<Thermo>::CpByCpv(const Thermo&, Foam::scalar, Foam::scalar) const [with Thermo = Foam::species::thermo<Foam::hIAPWSThermo<Foam::eos IAPWS<Foam::specie> >, Foam::sensibleEnthalpy>; Foam::scalar = double]
scalar CpByCpv
^~~~~~~
/home/sjohn2/OpenFOAM/OpenFOAM-6/src/thermophysicalModels/specie/lnInclude/sensibleEnthalpy.H:84:20: note: candidate expects 3 arguments, 2 provided
On comparison OpenFoam 2.4 and 6 sensibleEnthalpy.H files
OpenFoam 2.4

Quote:

#ifndef sensibleEnthalpy_H
#define sensibleEnthalpy_H

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

namespace Foam
{

/*---------------------------------------------------------------------------*\
Class sensibleEnthalpy Declaration
\*---------------------------------------------------------------------------*/

template<class Thermo>
class sensibleEnthalpy
{

public:

// Constructors

//- Construct
sensibleEnthalpy()
{}


// Member Functions

//- Return the instantiated type name
static word typeName()
{
return "sensibleEnthalpy";
}

// Fundamental properties

static word name()
{
return "h";
}

// Sensible enthalpy [J/kmol]
scalar he
(
const Thermo& thermo,
const scalar p,
const scalar T
) const
{
return thermo.hs(p, T);
}

// Heat capacity at constant pressure [J/(kmol K)]
scalar cpv
(
const Thermo& thermo,
const scalar p,
const scalar T
) const
{
return thermo.cp(p, T);
}

//- cp/cp []
scalar cpBycpv
(
const Thermo& thermo,
const scalar p,
const scalar T
) const
{
return 1;
}

// Sensible enthalpy [J/kg]
scalar HE
(
const Thermo& thermo,
const scalar p,
const scalar T
) const
{
return thermo.Hs(p, T);
}

//- Temperature from sensible enthalpy
// given an initial temperature T0
scalar THE
(
const Thermo& thermo,
const scalar h,
const scalar p,
const scalar T0
) const
{
return thermo.THs(h, p, T0);
}
};


// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

} // End namespace Foam

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#endif
OpenFoam 6
Quote:

#ifndef sensibleEnthalpy_H
#define sensibleEnthalpy_H

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

namespace Foam
{

/*---------------------------------------------------------------------------*\
Class sensibleEnthalpy Declaration
\*---------------------------------------------------------------------------*/

template<class Thermo>
class sensibleEnthalpy
{

public:

// Constructors

//- Construct
sensibleEnthalpy()
{}


// Member Functions

//- Return the instantiated type name
static word typeName()
{
return "sensibleEnthalpy";
}

// Fundamental properties

static word energyName()
{
return "h";
}

// Heat capacity at constant pressure [J/(kg K)]
scalar Cpv
(
const Thermo& thermo,
const scalar p,
const scalar T
) const
{
return thermo.Cp(p, T);
}

//- Cp/Cp []
scalar CpByCpv
(
const Thermo& thermo,
const scalar p,
const scalar T
) const
{
return 1;
}

// Sensible enthalpy [J/kg]
scalar HE
(
const Thermo& thermo,
const scalar p,
const scalar T
) const
{
return thermo.Hs(p, T);
}

//- Temperature from sensible enthalpy
// given an initial temperature T0
scalar THE
(
const Thermo& thermo,
const scalar h,
const scalar p,
const scalar T0
) const
{
return thermo.THs(h, p, T0);
}
};


// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

} // End namespace Foam

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#endif
Basically CpByCpv remains the same?
sjohn2 is offline   Reply With Quote

Old   June 30, 2020, 12:32
Default
  #80
Member
 
Join Date: Dec 2015
Posts: 74
Rep Power: 10
WhiteW is on a distinguished road
Hi to everyone.
I'm trying to use the IAPWS-IF97 water properties for OpenFOAM.
I installed Freesteam and compiled the library, now I can use it in openFOAM.
I would line to use it to calculate the steam properties for the design of a steam turbine, the range of pressure for the steam is from 1E4 Pa to 1E5 Pa.

However, I can use the library of Roman only in a range of pressure of high values, as specified in the example from 221e5 to 300e5 Pa.

Is it also possible to use it to calculate the properties of the steam in lower range of pressure?
In alternative, could I simply link Freesteam to OpenFOAM? Is there any example?

Thanks,
WhiteW
WhiteW is offline   Reply With Quote

Reply


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 17:23.