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

Can you add example for gas-polymer system using SL eos? #139

Open
YogeshkumarCD opened this issue Jan 18, 2023 · 1 comment
Open

Can you add example for gas-polymer system using SL eos? #139

YogeshkumarCD opened this issue Jan 18, 2023 · 1 comment

Comments

@YogeshkumarCD
Copy link

Sanchez Lacombe eos for like Polystyrene and CO2 system.

@longemen3000
Copy link
Member

hi!, yes, we could add one. some particularities on the current SL implementation:

  • we use ε (epsilon), v0 (vol, molar) and m (segment) instead of the T⋆, P⋆,ρ⋆ formulation. you can transform between those by doing:
P⋆ = R̄*T⋆/v0 -> v0 = R̄*T⋆/P⋆
T⋆ = ε/R̄ -> ε = R̄*T⋆
ρ⋆ = Mw/m*v0  m -> Mw/v0*ρ⋆ or Mw = m*v0*ρ⋆

  • we use the neau implementation, that is based in a consistent formulation at the pure component limit. (but this paper seems to disagree with that https://www.doi.org/10.1103/PhysRevApplied.8.044009 ?. we can define different mixing rules, but to be honest, there is a lot of discrepancies on how to implement SL in a way that is both physically consistent and gives accurate predictions.

  • for polymer-gas systems in SL context, normally the gas phase of the polymer is assumed zero. we can do that with some of our solvers (bubble_pressure, bubble_temperature, dew_pressure, dew_temperature and MichelsenTPFlash.

with that in mind, now we can go to a concrete example:

First, we need some parameters. for PS we can obtain some data from here (DOI: 10.1039/c8sm00794b) (note that they dont use the Neau formulation, so i would expect inaccurate results):

image

so, for CO2 (SI units): (P⋆,T⋆,ρ⋆) = (419.9e6,341.8,1.397e3)
and for PS (SI units): (P⋆,T⋆,ρ⋆) = (421.8e6,687.8,1.118e3)

so, we need in this particular implementation, the molecular weights. for CO2, Mw = 44.009 (g/mol). for PS, it depends, but we can suppose 20000 (g/mol) ? (we can also suppose the segment diameter and obtain the molecular weight from there)

using this utility function:

function sl_transform(P,T,rho, Mw)
  R = Clapeyron.#gas constant
  v0 = R*T/P
  epsilon = R*T
  m = (0.001*Mw)/(rho*v0) #Mw in g/mol
  return epsilon,v0,m
end

we obtain that (epsilon,vol,segment) for those two is:

CO2 (epsilon,vol,segment): (2841.8833228847775, 6.768000292652483e-6, 4.654625296462685)
PS: (5718.687388765798, 1.355781742239402e-5, 1319.4666294134743)

with the data, we can build our model. let's ignore the unlike values (kij, lij) for now.

we put this data in a CSV (we can just pass a string and Clapeyron will recognize it as a CSV if it starts with the correct text):

species_data = """Clapeyron Database File
SL example parameters [csvtype = like]
species,epsilon,vol,segment,Mw
CO2,2841.8833228847775, 6.768000292652483e-6, 4.654625296462685,44.009
PS20000,5718.687388765798, 1.355781742239402e-5, 1319.4666294134743,20000
"""
model = Clapeyron.SL(["CO2","PS20000"],userlocations = [species_data])

that should result in:

julia> model = Clapeyron.SL(["CO2","PS20000"],userlocations = [species_data])
SanchezLacombe{SLk0k1lMixingRule, BasicIdeal} with 2 components:
 "CO2"
 "PS20000"
Contains parameters: Mw, segment, epsilon, vol

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