|
[Sponsors] |
water properties available for OF 2.2 and above |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 16, 2014, 03:38 |
water properties available for OF 2.2 and above
|
#1 |
Senior Member
Roman Thiele
Join Date: Aug 2009
Location: Eindhoven, NL
Posts: 374
Rep Power: 21 |
Hej,
I am happy to announce that with some help from Chris Lucas's connector for freesteam in the extend project, I have managed to develop a library which provides thermophysical properties for water based on the IAPWS-IF97 properties. Instructions on how to download, install and use them can be found here: https://github.com/romansCode/IAPWS-IF97-OF The thermophysicalProperties file looks like this when you want to use it: Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.3.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object thermophysicalProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // thermoType { type heRhoThermo; // Thermophysical model based on sensible enthalpy mixture pureMixture; // Only water transport IAPWSTransport; // (mu, k) thermo hIAPWS; // (Cp) equationOfState eosIAPWS; // (rho) specie specie; energy sensibleEnthalpy; } // outside the pressure and temperature range, the properties will be capped to // the min and max values at the range limits mixture { IAPWSProperties { TMax 1073; // max allowed temperature TMin 500; // minimal allowed temperature pMax 300e5; // max allowed pressure pMin 221e5; // min allowed pressure } specie { nMoles 1; molWeight 18; // Water } } // ************************************************************************* // as well.
__________________
~roman |
|
June 16, 2014, 16:46 |
|
#2 |
Senior Member
Christian Lucas
Join Date: Aug 2009
Location: Braunschweig, Germany
Posts: 202
Rep Power: 18 |
Hi,
cool work, shows that I'm a bit behind on my work . You should also add the solver as an example (e.g. based on my realGasRhoPisoSolver from my git repository), because most (all) OpenFOAM solver have the perfect gas law hardcoded in the pressure equation. Regards, Christian |
|
June 18, 2014, 11:34 |
|
#3 |
Senior Member
Roman Thiele
Join Date: Aug 2009
Location: Eindhoven, NL
Posts: 374
Rep Power: 21 |
I am not completely sure what you mean.
__________________
~roman |
|
June 19, 2014, 00:11 |
|
#4 |
New Member
nakku
Join Date: Jun 2014
Posts: 11
Rep Power: 12 |
Hi,
I want to use water for laminar and turbulence flow with openFOAM.Could you please help me how I can make it? Thank you. |
|
June 19, 2014, 03:39 |
|
#5 | |
Senior Member
Roman Thiele
Join Date: Aug 2009
Location: Eindhoven, NL
Posts: 374
Rep Power: 21 |
Quote:
In the controlDict you have to add Code:
libs { "libfreesteam.so" "libIAPWSRangeThermo.so" }
__________________
~roman |
||
June 22, 2014, 13:29 |
|
#6 |
Senior Member
Christian Lucas
Join Date: Aug 2009
Location: Braunschweig, Germany
Posts: 202
Rep Power: 18 |
Hi,
the problem in the pressure equation is related to the time derivative. The pressure equation is based on the mass balance, thus the time derivative of the pressure equation is equivalent to drho/dt. In the standard OpenFOAM solver, this density time derivative is changed to d(psi*p)/dt (fvm::ddt(psi,p)), with psi=drho/dp@T=constant. This is correct for a perfect gas. However, it is incorrect for a real fluid like water (simply check it by using e.q. the a van der waals equation). Thus, the time derivative in the pressure equation must be changed. One possibility is to use a total differential. In this case, the time derivate in the pressure equation is psi2*dp/dt+psiH*dh/dt (psi2*fvm::ddt(p)+psiH*fvc::ddt(h)) (please note that psi is now outside the fvm::ddt function) psi2=drho/dp@h=constant psiH=drho/dh@p=constant Best Regards Christian |
|
June 23, 2014, 04:31 |
|
#7 | |
Senior Member
Roman Thiele
Join Date: Aug 2009
Location: Eindhoven, NL
Posts: 374
Rep Power: 21 |
Quote:
However, this should at least be correct for the steady state solvers for now, if I get this correctly. I will hopefully soon provide a transient solver for these kind of problems.
__________________
~roman |
||
June 24, 2014, 06:55 |
|
#8 |
Senior Member
Roman Thiele
Join Date: Aug 2009
Location: Eindhoven, NL
Posts: 374
Rep Power: 21 |
I checked in OpenFOAM 2.3, what you state for the density based solvers is correct (all solvers in the compressible category, most solvers start with rho....Foam. However, in the pressure based buoyant solvers solvers (in the category heat transfer, most start with buoyant...Foam, except for the buoyantBoussinesq) http://openfoam.org/docs/user/standard-solvers.php the following formulation for the pressure derivative is true:
Code:
fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh)) So I think for the solvers in the category "Heat transfer and buoyancy driven flows" no change is required. A change is only required for the density based solvers in the category "Compressible flows". Could this be right?
__________________
~roman |
|
October 21, 2014, 03:09 |
|
#9 | |
New Member
Cong Gu
Join Date: Jun 2013
Posts: 10
Rep Power: 13 |
Quote:
Edit: I think it is because of this. The rho in fvc::ddt(rho) is calculated from the previous p_rgh, for example, called p_rgh_0. So the current density should be rho + psi*(p_rgh - p_rgh_0). The correction term comes in when we take the time derivative of rho. Last edited by gucong; October 21, 2014 at 18:19. |
||
|
|