-
Notifications
You must be signed in to change notification settings - Fork 52
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
Something new that's not in the database #193
Comments
Hi! julia> using Clapeyron
julia> model = SAFTgammaMie([("tetracosane",["CH3"=>2,"CH2"=>22])])
SAFTgammaMie{BasicIdeal, SAFTVRMie{BasicIdeal}} with 1 component:
"tetracosane": "CH3" => 2, "CH2" => 22
Group Type: unknown
Contains parameters: segment, shapefactor, lambda_a, lambda_r, sigma, epsilon, epsilon_assoc, bondvol
julia> crit_pure(model)
(857.6313015851466, 1.0961825768823908e6, 0.0022801353592358043) Hope this helps! |
of course, for that, you need to specify:
in this particular example,
note how we specify the amount of sites (
|
Thank you very much! I have a new question about it. Suppose I haven't found the PCSAFT model parameters for a new associated component, how do I build the model? Or do I need to use experimental data for regression, are there any examples of that? |
You have a few options. The best would be to build the model yourself using parameter estimation with experimental data (which we provide the tools for). If your species is lacking experimental data, you could consider group contribution approaches (such as gcPCSAFT which is also available in Clapeyron) where you can assemble species from groups. What species are you trying to model? |
As for examples, you can check out this jupyter notebook: https://github.com/ClapeyronThermo/Clapeyron.jl/blob/master/examples/parameter_estimation.ipynb |
Hi! |
Hi! Yes, you can indeed fit BIP using our regression tool. You'd have to fit the epsilon_12 (in SAFT equations) or the a_12 (in cubics) to get BIP (you can then convert this to a kij parameter). I realised there isn't a good example of this in the notebooks. In short, you can follow the example from the activity coefficient models in here: https://github.com/ClapeyronThermo/Clapeyron.jl/blob/master/examples/parameter_estimation.ipynb. Your parameters are now symmetric so you don't need to worry about the asymmetric keyword. Im currently working on updating the notebooks and docs. Im going to include more relevant examples in these. |
Hi! I'm sorry to trouble you. I noticed that when calculating gas-liquid equilibrium properties (such as bubble point function), T,x and P,x are usually specified to calculate the other two properties. Is it possible to specify the two variables of temperature and pressure to calculate the corresponding gas phase composition and liquid phase composition in gas-liquid equilibrium in Clapeyron? |
Hi! What you are describing is a flash algorithm. We support these in Clapeyron. Here is an example that will only look for VLE (the default method in Clapeyron makes no assumptions about the phase equilibrium type and is therefore quite slow): julia> model = PCSAFT(["water","carbon dioxide"])
PCSAFT{BasicIdeal, Float64} with 2 components:
"water"
"carbon dioxide"
Contains parameters: Mw, segment, sigma, epsilon, epsilon_assoc, bondvol
julia> (x,n,G) = tp_flash(model,1e5,298.15,[0.5,0.5],MichelsenTPFlash(equilibrium=:vle))
([0.9995531870252333 0.00044681297476665416; 0.033441597210702265 0.9665584027892977], [0.48270815023652947 0.00021577667636994686; 0.017291849763470462 0.4997842233236301], -6.574034182311726)
julia> x
2×2 Matrix{Float64}:
0.999553 0.000446813
0.0334416 0.966558
|
Hi! I'm sorry to bother you again. I'm trying to do some phase equilibrium calculations with Clapeyron. According to the p-xy example in the notebook, I used PR EOS to calculate the bubble point pressure and gas composition of methane and ethane system at 280K (experimental data from the literature), and the results are shown below. All 15 data points have obtained the calculated results. At the same time, when I calculated directly using the bubble_pressure function, I got a different result (some points have inconsistent results and some points could not be calculated). Could you help me to check it why?
|
Hi Jason, The reason for this because your mixture has a supercritical component (methane). Within Clapeyron, to generate initial guesses, we assume that we have an ideal mixture that obeys Raoult's law. Unfortunately, that also means that assume all components are subcritical. When that isn't the case, we make some basic approximations but it doesn't work very well frame from a species' critical point. At 280K, you are very far from methane's critical point (190K). This means our solvers will be using quite poor initial guesses. The workaround for this is to trace the vle region by re-using the previous solution as the initial guess for the next iteration. These are much better guesses and are more likely to run into the correct solution. Are you trying to run parameter estimation with these mixtures? |
Yes, thank you very much for your response and I believe Clapeyron is a very good tool to help me achieve this. |
If you are planning to do parameter estimation, I recommend you use tp_flash instead |
Hi! I'm so sorry to bother you again. I have several questions when using flash algorithm to do calculations:
|
Hi, I must apologies for the delay in my reply, I have just come back from a conference. I am a little bit confused: what is your objective here? Is it to just trace the phase envelope or to do parameter estimation. If your goal is to trace the phase envelope, then you should use the bubble_pressure and dew_pressure as these functions will follow the phase envelope exactly. Flash algorithms can be used but you will need to follow the phase envelope manually. If your goal is to do parameter estimation, then you'll want to fit to the composition in each phase at a given pressure and temperature. Here, the bubble and dew_pressure solvers are useless. This is why using flash algorithms is much better. From what you're saying, you seem to be more interested in just tracing the phase boundary. In that case, please take a look at the example notebooks. |
For some complex compounds, many models do not seem to work, such as the SAFTgammaMie model for the calculation of n-tetracosane, how to construct the model and give the corresponding model parameters, can you give an example?
The text was updated successfully, but these errors were encountered: