Equilibrium with electrolytes #402
-
|
Hi everyone! I'm getting started with Clapeyron.jl, and I'm trying to compute the vapor–liquid equilibrium compositions for a ternary mixture: alkane + water + sodium chloride. I understand that the tp_flash function can be used to calculate phase compositions at a given temperature and pressure, but I'm not sure how to properly exclude electrolytes (like NaCl) from the vapor phase, since they shouldn't appear there. I've also tried using bubble_temperature and dew_temperature, but these only return compositions at the bubble or dew point — not for arbitrary T and P. What I’m looking for is a way to:
Has anyone worked with electrolytes in tp_flash, or has any suggestions on how to handle this case? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
Hi @R-DeCassia, You can indeed solve for the VLE of an alkane + water + sodium chloride mixture using tp_flash. To exclude the ions from the vapor phase, you would just need to specify the julia> model = SAFTVREMie(["water","ethane"],["sodium","chloride"]) # you'll have to define a few parameters manually
Explicit Electrolyte Model with 4 components:
"water"
"ethane"
"sodium" (+1)
"chloride" (-1)
Neutral Model: SAFTVRMie{BasicIdeal, Float64}
Ion Model: MSABorn{Schreckenberg}
RSP Model: Schreckenberg
julia> T=298.15;
julia> p=1e5;
julia> z=[0.495,0.495,0.005,0.005];
julia> (x,n,G) = tp_flash(model,p,T,z, MichelsenTPFlash(noncondensables=["sodium","chloride"],K0=[1e4,1e-3,1e6,1e6]));
julia> x
2×4 Matrix{Float64}:
0.000291698 0.999708 0.0 0.0
0.979863 0.000335819 0.0099005 0.0099005where Note that I assumed you meant short-chained alkanes; if you're looking at longer chain alkanes, I would have to assume you're actually interested in LLE? |
Beta Was this translation helpful? Give feedback.
-
|
@pw0908, thank you for your response! I'm currently working on setting up a vapor–liquid–liquid (VLL) equilibrium for a system containing crude oil, water, and salt. For now, I’m approaching it step by step, starting with a simpler system: hexane (as a model alkane), water, and sodium chloride. I intend to perform these simulations at high pressures and low temperatures. Initially, I started with a vapor–liquid (VL) equilibrium model considering only a single liquid phase, to study the vapor–liquid equilibrium compositions of the ternary system: alkane + water + sodium chloride. Once I have a better understanding of the VLL behavior with these simpler components, I plan to move forward by defining pseudocomponents for the crude oil. |
Beta Was this translation helpful? Give feedback.
Hi @R-DeCassia,
You can indeed solve for the VLE of an alkane + water + sodium chloride mixture using tp_flash. To exclude the ions from the vapor phase, you would just need to specify the
nonvolatilesargument (although there is currently a typo in the code where you need to specifynoncondensablesinstead). Here's an example: