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

Adding fluid R1234ze(E) - ReidIdeal #292

Closed
Sush1090 opened this issue Sep 2, 2024 · 7 comments
Closed

Adding fluid R1234ze(E) - ReidIdeal #292

Sush1090 opened this issue Sep 2, 2024 · 7 comments

Comments

@Sush1090
Copy link
Contributor

Sush1090 commented Sep 2, 2024

Hello,

I am interested in adding R1234ze(E) refrigerant in the ReidIdeal model.
The IdealModel implementation exists already.

Would you know from where I can get the coefficients and add it in the CSV file?
I am not sure that the paper suggested for CoolProp here suffices for this implementation.

Thanking you
Sushrut

@longemen3000
Copy link
Member

i think that the best way to do this is to just fit the coefficients from the empiric model. you can access such empiric model in the following way:

using CoolProp #loads CoolProp csv files
ref_ideal = EmpiricIdeal("R1234ze(E)")

@longemen3000
Copy link
Member

longemen3000 commented Sep 2, 2024

i did something like this:

using CoolProp #loads CoolProp csv files
ref_ideal = EmpiricIdeal("R1234ze(E)")
n = 200
T = LinRange(169,420,n) #according to the paper, the reference model is valid from 169 to 420 K
Cp = Clapeyron.VT_isobaric_heat_capacity.(ref_ideal,1,T) #this function is independent of volume
H = hcat(ones(n),T,T.^2,T .^3,T .^4) #least squares linear regression
coeffs = H\Cp

this gives:

julia> coeffs
5-element Vector{Float64}:
 -31.191921817803298
   1.0823742985460638
  -0.003938209548961325
   7.64276485084316e-6
  -5.612056650834053e-9

and results in the following plot:

image

@Sush1090
Copy link
Contributor Author

Sush1090 commented Sep 2, 2024

@longemen3000 Thank you. This is very efficient.
There is one small point - there should be a discontinuity around 250 - 300K as that is the saturation temperature at 101325Pa (depending on the EoS). This is also visible in the IdealModel. Here is the example

image

With the polynomial it is not possible. Possibly there is some additional adjustment needed. I do not know how much it will affect the computation of other properties.

Thanking you,
Sushrut

@longemen3000
Copy link
Member

longemen3000 commented Sep 2, 2024

hmm, i do not see such discontinuity in the ideal model itself, are you sure are you calling the ideal model and not the full model?. in theory, a ideal gas model should not have any information about equilibria. I got this when using p = 1atm:

ref_ideal = EmpiricIdeal("R1234ze(E)")
n = 200
T = LinRange(169,420,n)
Cp = Clapeyron.VT_isobaric_heat_capacity.(ref_ideal,101325,T)
plot(Cp,T)

image

@longemen3000
Copy link
Member

for example this plot has the full model in addition to the ideal one:
image

@Sush1090
Copy link
Contributor Author

Sush1090 commented Sep 2, 2024

Ah yes indeed. I was using the full model.
Thank you.

@Sush1090
Copy link
Contributor Author

Sush1090 commented Sep 2, 2024

This is doing exactly what I was hoping for :)

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