Comments (2)
Hi!, i recommend to check the documentation (https://clapeyronthermo.github.io/Clapeyron.jl/dev/user_guide/custom_model/) or copy an existing EoS file to modify it to your patterns( https://github.com/ClapeyronThermo/Clapeyron.jl/blob/master/src/models/PeTS/PeTS.jl for example). note that in the general case, you need to define the residual helmholtz energy (a_res
)
Now. looking at the original Hayden-O'Connell paper (https://doi.org/10.1021/i260055a003), it seems that it is an specific case of a second order virial model, that is: Z(V,T,z) = 1 + BP/RT
.
in that case, it is better to define it as a SecondVirialModel
:
using Clapeyron
using Clapeyron: SecondVirialModel
struct MyParam <: EoSParam
B::PairParam{Float64}
end
@newmodel ConstantBVirial SecondVirialModel MyParam false #the false is to opt out of SAFT association parameters
#if your model is a subtype of a second virial model, you only need to define the second virial coefficient.
function Clapeyron.second_virial_coefficient_impl(model::ConstantBVirial,T,z=SA[1.0])
B = zero(T + eltype(z)) #adequate initial point
Bij = model.params.B
for i in @comps
for j in @comps
B += z[i]*z[j]*Bij[i,j]
end
end
return B/sum(z)
end
from clapeyron.jl.
As an aside to Andrés' answer: have you considered using other EoS? For example, PC-SAFT and PCP-SAFT both have parameters for acetic acid and seem to do quite well:
julia> model = PCSAFT(["acetic acid"])
PCSAFT{BasicIdeal, Float64} with 1 component:
"acetic acid"
Contains parameters: Mw, segment, sigma, epsilon, epsilon_assoc, bondvol
julia> saturation_temperature(model,1e5)
(391.61543076122626, 6.43973177383346e-5, 0.027157488839931063)
julia> model = PPCSAFT(["acetic acid"])
PPCSAFT{BasicIdeal} with 1 component:
"acetic acid"
Contains parameters: Mw, segment, sigma, epsilon, dipole, dipole2, epsilon_assoc, bondvol
julia> saturation_temperature(model,1e5)
(389.7331841526761, 6.444345768928592e-5, 0.031801246734323926)
Both have large parameter databases, so I think they should be suitable for most systems. Even the generic cubics do quite a decent job (in those cases you just need the critical properties):
julia> model = PR(["acetic acid"])
PR{BasicIdeal, PRAlpha, NoTranslation, vdW1fRule} with 1 component:
"acetic acid"
Contains parameters: a, b, Tc, Pc, Mw
julia> saturation_temperature(model,1e5)
(391.54160848876614, 8.25819698557481e-5, 0.0317628509893515)
Unless you are attached to using HOC, you might be better off just using an existing EoS.
from clapeyron.jl.
Related Issues (20)
- Parameter Estimation for sle_solubility HOT 14
- UNIFAC ether and aldehyde groups error HOT 3
- Defining a custom alpha HOT 2
- COFFEE equation of state
- EOS-CG 2021 HOT 7
- Induced-Association Interactions in SAFT HOT 16
- Saturation solves fail moving from 0.5.7 to 0.5.8 HOT 4
- Move CPA input to use SI values
- Units of property functions HOT 9
- Help with modelling activity coefficients in UNIFAC HOT 3
- Wrong conversion of parameters for water in CPA HOT 10
- Installation problems with precompilation (`Setfield` not defined) HOT 4
- Surprising default combining rule in association term HOT 3
- Evaluation of CPA at too high a density yields no error, just NaN HOT 4
- Possible issue with bubble and dew point estimation (or SAFT-gamma Mie) HOT 2
- Ask for help with sCPA calculating the molar volume of water HOT 7
- Simple example with activity coefficient model and antoine parameters for saturation pressure? HOT 3
- modified LKP and LKP-SJT
- Clarification/issue in SoftSAFT implementation HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clapeyron.jl.