Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specific heat capacity of water #149

Closed
avinashresearch1 opened this issue Mar 16, 2023 · 3 comments
Closed

Specific heat capacity of water #149

avinashresearch1 opened this issue Mar 16, 2023 · 3 comments

Comments

@avinashresearch1
Copy link

Hi. Thanks for the excellent and extremely useful package!

I am trying to get a better understanding of querying for properties using Unitful but I am uncertain about the units of the results (it says J/K-1 but I am unable to get the expected specific cp even converting from moles:

using Unitful
import Unitful: bar, °C
water_model = SAFTVRMie(["water"]) # Also tried a few others e.g `PR` and `IAPWS95`.
cp = isobaric_heat_capacity(water_model, 1bar, 25°C)
@pw0908
Copy link
Member

pw0908 commented Mar 16, 2023

Hi! Thank you for the nice words!

For heat capacities, the output is using extensive units. You can see this by changing the molar amount:

julia> using Clapeyron, Unitful
julia> import Unitful: bar, °C, mol
julia> model = SAFTVRMie(["water"]);
julia> isobaric_heat_capacity(model,1bar,25°C,[1.0mol])
75.3275793331559 J K⁻¹
julia> isobaric_heat_capacity(model,1bar,25°C,[2.0mol])
150.65515866633206 J K⁻¹

Some functions which do provide intensive properties are molar_density and mass_density:

julia> molar_density(model,1bar,25°C)
55344.55768394381 mol m⁻³

julia> mass_density(model,1bar,25°C)
997.047039017707 kg m⁻³

We certainly should try to support the intensive versions of a few of the properties provided in Clapeyron...

@avinashresearch1
Copy link
Author

Thanks for the quick reply! I was able to get it to work with IAPWS95, but quite surprising the variation in results. Good reminder to pick good defaults :)

julia> using Clapeyron
julia> using Unitful
julia> import Unitful: bar, °C, mol, kg
julia> p_test = 1bar
1 bar
julia> T_test = 25°C
25 °C
julia> model = IAPWS95()
IAPWS95 with 1 component:
 "water"
julia> mw = model.consts.Mw
18.015268

julia> isobaric_heat_capacity(model, p_test, T_test,[1.0mol])/mw
4.181318830958147 J K^-1

julia> model_2 = SAFTVRMie(["water"])
SAFTVRMie{BasicIdeal} with 1 component:
 "water"
Contains parameters: Mw, segment, sigma, lambda_a, lambda_r, epsilon, epsilon_assoc, bondvol

julia> isobaric_heat_capacity(model_2, p_test, T_test,[1.0mol])/mw
2.948594793493912 J K^-1

julia> model_3 = GERG2008(["water"])
GERG2008 with 1 component:
 "water"

julia> isobaric_heat_capacity(model_3, p_test, T_test,[1.0mol])/mw
4.404685005385272 J K^-1

julia> model_4 = PCSAFT(["water"])
PCSAFT{BasicIdeal} with 1 component:
 "water"
Contains parameters: Mw, segment, sigma, epsilon, epsilon_assoc, bondvol

julia> isobaric_heat_capacity(model_4, p_test, T_test,[1.0mol])/mw
2.363334753223272 J K^-1

@pw0908
Copy link
Member

pw0908 commented Mar 21, 2023

Almost forgot! In the case for non-empirical equations of state (I.e. SAFTs or cubics), the ideal contribution doesn't include vibrations and rotations, which leads to significant underestimates of the heat capacity. See below:

julia> model = SAFTVRMie(["water"]);�������
julia> isobaric_heat_capacity(model,1e5,298.15)/model.params.Mw[1]
2.948638658240215

julia> model = SAFTVRMie(["water"];idealmodel=ReidIdeal);

julia> isobaric_heat_capacity(model,1e5,298.15)/model.params.Mw[1]
3.663218112417885

@pw0908 pw0908 closed this as completed May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants