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   December 3, 2012, 08:29
Default
  #41
Senior Member
 
Christian Lucas
Join Date: Aug 2009
Location: Braunschweig, Germany
Posts: 202
Rep Power: 18
Chris Lucas is on a distinguished road
Hi,

you don't need freesteam to install my openFoam freesteam connection. You need freesteam (or better the dynamic library) to run a case.

Have you installed (compiled) OpenFOAM correctly? The error suggests you haven't. The freesteam connection should not affect the other openfoam components. (Same is true for the real gas library classes)

You can copy the dynamic library (by hand) in the folder described in the tutorial README (OpenFOAM/lib/"systemCompilerName"). /usr/lib/ might also work.

Kind Regards,
Christian
Chris Lucas is offline   Reply With Quote

Old   January 2, 2013, 15:25
Default
  #42
Senior Member
 
Join Date: Nov 2012
Posts: 171
Rep Power: 14
hz283 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
Hi All,

I have the same problems about how the psi is calculated in BasicThermo.H. Conceptually, psi=rho/p=1/(R*T). But does anyone know how psi is calculated? Thank you in advance.

best regards,
H
hz283 is offline   Reply With Quote

Old   January 3, 2013, 16:08
Default
  #43
New Member
 
magazoni
Join Date: Jul 2012
Posts: 11
Rep Power: 14
magazoni is on a distinguished road
Hi Christian,

I compiled the IAPWS package.

Code:
cluster@node0:~/OpenFOAM/OpenFOAM-1.6-ext/src/thermophysicalModels/externalMedia/IAPWS_Waterproperties$ wmake libso
Making dependency list for source file IAPWSThermo/IAPWS-IF97.C
Making dependency list for source file IAPWSThermo/IAPWSThermos.C
SOURCE=IAPWSThermo/IAPWS-IF97.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -I/home/cluster/OpenFOAM/OpenFOAM-1.6-ext/src/finiteVolume/lnInclude -I/home/cluster/OpenFOAM/OpenFOAM-1.6-ext/src/thermophysicalModels/specie/lnInclude -I/home/cluster/OpenFOAM/OpenFOAM-1.6-ext/src/thermophysicalModels/basic/lnInclude -IlnInclude -I. -I/home/cluster/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude -I/home/cluster/OpenFOAM/OpenFOAM-1.6-ext/src/OSspecific/POSIX/lnInclude   -fPIC -c $SOURCE -o Make/linux64Gcc46DPOpt/IAPWS-IF97.o
SOURCE=IAPWSThermo/IAPWSThermos.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -I/home/cluster/OpenFOAM/OpenFOAM-1.6-ext/src/finiteVolume/lnInclude -I/home/cluster/OpenFOAM/OpenFOAM-1.6-ext/src/thermophysicalModels/specie/lnInclude -I/home/cluster/OpenFOAM/OpenFOAM-1.6-ext/src/thermophysicalModels/basic/lnInclude -IlnInclude -I. -I/home/cluster/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude -I/home/cluster/OpenFOAM/OpenFOAM-1.6-ext/src/OSspecific/POSIX/lnInclude   -fPIC -c $SOURCE -o Make/linux64Gcc46DPOpt/IAPWSThermos.o
IAPWSThermo/IAPWS-IF97.C: In function ‘void Foam::calculateProperties_h(SteamState, Foam::scalar&, Foam::scalar&, Foam::scalar&, Foam::scalar&, Foam::scalar&, Foam::scalar&, Foam::scalar&, Foam::scalar&, Foam::scalar&)’:
IAPWSThermo/IAPWS-IF97.C:240:62: warning: variable ‘cpv’ set but not used [-Wunused-but-set-variable]
IAPWSThermo/IAPWS-IF97.C: In function ‘Foam::scalar Foam::psiH(SteamState)’:
IAPWSThermo/IAPWS-IF97.C:432:62: warning: variable ‘cpv’ set but not used [-Wunused-but-set-variable]
IAPWSThermo/IAPWS-IF97.C:489:12: warning: ‘psiH’ may be used uninitialized in this function [-Wuninitialized]
IAPWSThermo/IAPWS-IF97.C: In function ‘Foam::scalar Foam::drhodh(SteamState)’:
IAPWSThermo/IAPWS-IF97.C:586:12: warning: ‘drhodh’ may be used uninitialized in this function [-Wuninitialized]
'/home/cluster/OpenFOAM/OpenFOAM-1.6-ext/lib/linux64Gcc46DPOpt/libIAPWSThermo.so' is up to date.
Now, I think that it is correct. But when I tried to simulate the IAPWS example, there are some errors,

Code:
cluster@node0:~/OpenFOAM/OpenFOAM-1.6-ext/tutorials/compressible/rhoPisoFoam/ras/IAPWS97_Pipe$ rhoPisoFoam 
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM Extend Project: Open source CFD        |
|  \\    /   O peration     | Version:  1.6-ext                               |
|   \\  /    A nd           | Web:      www.extend-project.de                 |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 1.6-ext-959ec266ba5c
Exec   : rhoPisoFoam
Date   : Jan 03 2013
Time   : 17:59:37
Host   : node0
PID    : 17372
Case   : /home/cluster/OpenFOAM/OpenFOAM-1.6-ext/tutorials/compressible/rhoPisoFoam/ras/IAPWS97_Pipe
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

--> FOAM Warning : 
    From function dlLibraryTable::open(const fileName& functionLibName)
    in file db/dlLibraryTable/dlLibraryTable.C at line 86
    could not load /home/cluster/OpenFOAM/OpenFOAM-1.6-ext/lib/linux64Gcc46DPOpt/libIAPWSThermo.so: undefined symbol: _ZNK4Foam14basicPsiThermo6drhodeEv
Create mesh for time = 0

Reading thermophysical properties

Selecting thermodynamics package IAPWSThermo


--> FOAM FATAL ERROR: 
Unknown basicPsiThermo type IAPWSThermo

Valid basicPsiThermo types are:

11
(
ePsiThermo<pureMixture<sutherlandTransport<specieThermo<janafThermo<perfectGas>>>>>
hsPsiThermo<pureMixture<sutherlandTransport<specieThermo<hConstThermo<perfectGas>>>>>
ePsiThermo<pureMixture<sutherlandTransport<specieThermo<eConstThermo<perfectGas>>>>>
hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>
hsPsiThermo<pureMixture<sutherlandTransport<specieThermo<janafThermo<perfectGas>>>>>
hPsiThermo<pureMixture<sutherlandTransport<specieThermo<hConstThermo<perfectGas>>>>>
ePsiThermo<pureMixture<constTransport<specieThermo<eConstThermo<perfectGas>>>>>
ePsiThermo<pureMixture<sutherlandTransport<specieThermo<hConstThermo<perfectGas>>>>>
hsPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>
ePsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>
hPsiThermo<pureMixture<sutherlandTransport<specieThermo<janafThermo<perfectGas>>>>>
)
    From function basicPsiThermo::New(const fvMesh&)
    in file psiThermo/basicPsiThermo/newBasicPsiThermo.C at line 64.
FOAM exiting
Do you know what is it?

Thank you,
Best regards,
Felipe Magazoni
magazoni is offline   Reply With Quote

Old   January 3, 2013, 16:24
Default
  #44
New Member
 
magazoni
Join Date: Jul 2012
Posts: 11
Rep Power: 14
magazoni is on a distinguished road
Christian,

Now it is working. I forgot to compile the themophysicalModels. Thanks very much.

Kind regards,
Felipe Magazoni
magazoni is offline   Reply With Quote

Old   January 7, 2013, 03:58
Default
  #45
Senior Member
 
Christian Lucas
Join Date: Aug 2009
Location: Braunschweig, Germany
Posts: 202
Rep Power: 18
Chris Lucas is on a distinguished road
Hi

@ hz283

have a look at the perfect gas class.

@ Felipe

did you change the freesteam source as stated in my tutorial case README file?

Christian
Chris Lucas is offline   Reply With Quote

Old   January 7, 2013, 11:57
Default
  #46
Senior Member
 
Join Date: Nov 2012
Posts: 171
Rep Power: 14
hz283 is on a distinguished road
Quote:
Originally Posted by Chris Lucas View Post
Hi

@ hz283

have a look at the perfect gas class.

@ Felipe

did you change the freesteam source as stated in my tutorial case README file?

Christian
Hi Christian,

In specieI.H, the gas constant is calculated as follows:

R=RR/molweight_, RR=Na*Kb is universal gas constant. For my understanding, here molweight_ is the molar weight for only one species. in Openfoam, is there some methods to calculate the R for multi-gas composition? This is useful for the update of density of multi-gas mixing case.

In the combustion solver, reactingFoam, the density is calculated like this:

Info<< "Creating combustion model\n" << endl;

autoPtr<combustionModels:siChemistryCombustionMo del> combustion
(
combustionModels:siChemistryCombustionModel::New
(
mesh
)
);

psiChemistryModel& chemistry = combustion->pChemistry();

hsCombustionThermo& thermo = chemistry.thermo();

basicMultiComponentMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y();

word inertSpecie(thermo.lookup("inertSpecie"));

volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
mesh
),
thermo.rho()
);


I read the source code and found that in this solver the rho is still updated through p_*psi using EoS in basicPsiThermo. If my understanding is correct, how the effect of multi-gas on the gas constant is taken into consideration here. Actually, in CHEMKIN source package, the EoS is like this: p=Sum(rho*Yk / Wk)*RR*Tk. the subscript k stand for the individual species.

Do you know something about this? Please help me point out if any incorrectness exists.

best,
H
mkraposhin and Zhiheng Wang like this.

Last edited by hz283; January 7, 2013 at 12:15.
hz283 is offline   Reply With Quote

Old   May 23, 2013, 06:03
Default newer version of OF
  #47
Senior Member
 
romant's Avatar
 
Roman Thiele
Join Date: Aug 2009
Location: Eindhoven, NL
Posts: 374
Rep Power: 21
romant is on a distinguished road
Hej,

did anybody get this to work on a newer version of OF, like 2.0, 2.1 or 2.2?

~roman
__________________
~roman
romant is offline   Reply With Quote

Old   May 23, 2013, 08:15
Default
  #48
Senior Member
 
Christian Lucas
Join Date: Aug 2009
Location: Braunschweig, Germany
Posts: 202
Rep Power: 18
Chris Lucas is on a distinguished road
Hi,

in OF 2.0 and OF 2.1 it should be simple to use the water properties. I’m not sure about OF 2.2.

1. Copy externalMedia folder. Should work fine under OF 2.1 .

2. Add the new functions (do not copy the files) in basicPsiThermo (OF 1.6 ext) to basicPsiThermo (OF 2.0). Only the 3rd script in makeBasicThermo.H (OF 1.6 ext) is needed for the water properties (2nd is used for real gas thermo)

3. Copy the changes in rhoPisoFOAM (pEqn) into your solver

4. Compile everything.

5. Have a look at the tutorial provided by me.

Hope I did not miss some code block you need. If it works, please report your result here .

Kind Regards,
Christian
Chris Lucas is offline   Reply With Quote

Old   May 23, 2013, 08:42
Default
  #49
Senior Member
 
romant's Avatar
 
Roman Thiele
Join Date: Aug 2009
Location: Eindhoven, NL
Posts: 374
Rep Power: 21
romant is on a distinguished road
It seems that the repo is down. at least the links provided in early posts to sourceforge do not work.
__________________
~roman
romant is offline   Reply With Quote

Old   May 23, 2013, 08:47
Default
  #50
Senior Member
 
Christian Lucas
Join Date: Aug 2009
Location: Braunschweig, Germany
Posts: 202
Rep Power: 18
Chris Lucas is on a distinguished road
Hi,

yes, OpenFOAM 1.6 ext is down at the moment. It should be back online soon.

I can send you the files, if you give me your mail adresse (e.g. via private message ..).

Regards,
Christian
Chris Lucas is offline   Reply With Quote

Old   June 26, 2013, 10:19
Default
  #51
Senior Member
 
Christian Lucas
Join Date: Aug 2009
Location: Braunschweig, Germany
Posts: 202
Rep Power: 18
Chris Lucas is on a distinguished road
Hi,

OpenFoam ext is back online, but the address changed. YOu can find the branch with the water properties here:

http://sourceforge.net/p/openfoam-ex...Thermo/~/tree/

Regards,
Christian
romant likes this.
Chris Lucas is offline   Reply With Quote

Old   June 26, 2013, 13:50
Default
  #52
New Member
 
FengWei
Join Date: Jun 2013
Posts: 5
Rep Power: 13
Fengwei is on a distinguished road
Quote:
Originally Posted by Chris Lucas View Post
Hi,

OpenFoam ext is back online, but the address changed. YOu can find the branch with the water properties here:

http://sourceforge.net/p/openfoam-ex...Thermo/~/tree/

Regards,
Christian
hello,Christian

Can you simply to explain the steps add equation of state in OF2.1.1? I want to add PR equation, which classes i need to have a modification? thank you very much ! sorry for my poor english.
Fengwei is offline   Reply With Quote

Old   June 27, 2013, 04:11
Default
  #53
Senior Member
 
Christian Lucas
Join Date: Aug 2009
Location: Braunschweig, Germany
Posts: 202
Rep Power: 18
Chris Lucas is on a distinguished road
HI,

have a look at

http://www.cfd-online.com/Forums/ope...rfect-gas.html

Christian
Chris Lucas is offline   Reply With Quote

Old   June 27, 2013, 09:29
Smile
  #54
New Member
 
FengWei
Join Date: Jun 2013
Posts: 5
Rep Power: 13
Fengwei is on a distinguished road
Quote:
Originally Posted by Chris Lucas View Post
Thank you very much for your answer!

wei
Fengwei is offline   Reply With Quote

Old   July 12, 2013, 06:36
Default
  #55
Senior Member
 
Join Date: Jan 2013
Posts: 372
Rep Power: 14
openfoammaofnepo is on a distinguished road
Dear Chris,

My question is not about how to implement the external library, but when to call the density from the external library in the OF solver, like rhoPimpleFOAM. DID you directly replace the line thermo.rho()? Or did you call the external to get the density in other places of the solver rhoPimpleFOAM?
Thank you very much.

Quote:
Originally Posted by Chris Lucas View Post
Hi,

OpenFoam ext is back online, but the address changed. YOu can find the branch with the water properties here:

http://sourceforge.net/p/openfoam-ex...Thermo/~/tree/

Regards,
Christian
openfoammaofnepo is offline   Reply With Quote

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

in OF 2.0 and OF 2.1 it should be simple to use the water properties. I’m not sure about OF 2.2.

1. Copy externalMedia folder. Should work fine under OF 2.1 .

2. Add the new functions (do not copy the files) in basicPsiThermo (OF 1.6 ext) to basicPsiThermo (OF 2.0). Only the 3rd script in makeBasicThermo.H (OF 1.6 ext) is needed for the water properties (2nd is used for real gas thermo)

3. Copy the changes in rhoPisoFOAM (pEqn) into your solver

4. Compile everything.

5. Have a look at the tutorial provided by me.

Hope I did not miss some code block you need. If it works, please report your result here .

Kind Regards,
Christian
I just tried this with OpenFOAM 2.2.1 and 2.1 (as 2.0 is only available when using the archive at the moment), it won't work, the file structure change and basicPsiThermo does not exist anymore. Now they have inheritance basicThermo->fluidThermo->psiThermo instead of basicThermo->basicPisThermo

I will try to look into it and see if it can be adopted to run your code.
__________________
~roman

Last edited by romant; August 16, 2013 at 11:08. Reason: more explanation
romant is offline   Reply With Quote

Old   August 17, 2013, 12:00
Default
  #57
Senior Member
 
Christian Lucas
Join Date: Aug 2009
Location: Braunschweig, Germany
Posts: 202
Rep Power: 18
Chris Lucas is on a distinguished road
HI,

You can download my library (also includes real gas thermodynamic classes) for OF 2.1 here:

git clone https://github.com/morgoth541/of_realFluid.git


Christian
romant likes this.
Chris Lucas is offline   Reply With Quote

Old   August 19, 2013, 06:18
Default
  #58
Senior Member
 
romant's Avatar
 
Roman Thiele
Join Date: Aug 2009
Location: Eindhoven, NL
Posts: 374
Rep Power: 21
romant is on a distinguished road
Quote:
Originally Posted by Chris Lucas View Post
HI,

You can download my library (also includes real gas thermodynamic classes) for OF 2.1 here:

git clone https://github.com/morgoth541/of_realFluid.git


Christian
Thanks, I will install it and report if everything works.
__________________
~roman
romant is offline   Reply With Quote

Old   August 19, 2013, 09:50
Default Compiling fails
  #59
Senior Member
 
romant's Avatar
 
Roman Thiele
Join Date: Aug 2009
Location: Eindhoven, NL
Posts: 374
Rep Power: 21
romant is on a distinguished road
Quote:
Originally Posted by Chris Lucas View Post
HI,

You can download my library (also includes real gas thermodynamic classes) for OF 2.1 here:

git clone https://github.com/morgoth541/of_realFluid.git


Christian
Hej,

I tried compiling it, however, the procedure fails. There is something wrong with the includes. I attached the full and the selective log file to this post. The selective log file will give you only the errors which occured. In which you will see that the linker has problems mostly with the following libraries
Code:
/usr/bin/ld: cannot find -lcompressibleTurbulenceModel
/usr/bin/ld: cannot find -lcompressibleRASModels
/usr/bin/ld: cannot find -lcompressibleLESModels
/usr/bin/ld: cannot find -llagrangianIntermediate
/usr/bin/ld: cannot find -lbasicThermophysicalModels
/usr/bin/ld: cannot find -lreactionThermophysicalModels
/usr/bin/ld: cannot find -lchemistryModel
/usr/bin/ld: cannot find -lradiationModels
/usr/bin/ld: cannot find -lsurfaceFilmModels
/usr/bin/ld: cannot find -lcombustionModels
I checked, but I can't find a problem in the options file of the different solvers where this problem occurs.
Attached Files
File Type: gz log.wmake.tar.gz (79.8 KB, 3 views)
File Type: txt error in wmake of water.txt (31.3 KB, 4 views)
__________________
~roman
romant is offline   Reply With Quote

Old   August 30, 2013, 12:02
Default IAPWS-IF97 water properties for OF 2.2.1
  #60
Senior Member
 
romant's Avatar
 
Roman Thiele
Join Date: Aug 2009
Location: Eindhoven, NL
Posts: 374
Rep Power: 21
romant is on a distinguished road
Hi Christian,

I tried adjusting your external thermo library so that I can compile it in an OF 2.2.1 environment. However, I get one specific error from the IAPWSThermos.C file when compiling.

Code:
/home/roman/Dropbox/uni/PhD/coding/IAPWSThermo/IAPWSThermo/IAPWSThermos.C:74: error: expected constructor, destructor, or type conversion before ‘;’ token
Where the file has the layout

Code:
//#include "makeBasicPsiThermo.H"
#include "makeThermo.H"
#include "IAPWSThermo.H"

// including dummy classes --> this classes do nothing 
// except satisfy the template structure
//#include "dummyEqnOfState.H"
//#include "dummyThermo.H"
//#include "dummyH.H"
//#include "dummyTransport.H"

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

namespace Foam
{

/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */

/*
makeBasicRealGasThermo
(
    IAPWSThermo,
    pureMixture,
    dummyTransport,
    dummyThermo,
    dummyH,
    dummyEqnOfState
);
*/

makeIAPWSThermo
(
    IAPWSThermo // <- this is where the error occurs
);


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

} // End namespace Foam
Is there any idea where this problem could come from?
__________________
~roman
romant 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 15:45
standard water properties Thilip Kumar CFX 1 September 20, 2008 11:51
water vapour properties manoj korde FLUENT 4 June 2, 2006 02:47
shallow water VS deep water Paul Main CFD Forum 10 August 30, 2004 12:56
properties of water ? mp Main CFD Forum 0 March 5, 2003 05:41


All times are GMT -4. The time now is 22:06.