feos-org / feos

FeOs - A Framework for Equations of State and Classical Density Functional Theory
Other
108 stars 22 forks source link

Added Henry's law constant #235

Closed prehner closed 3 months ago

prehner commented 3 months ago

Adds the calculation of Henry's law constants from an equation of state. Here, $H{i,s}$ is defined in the way it would be observed, as $H{i,s}=\lim_{x_i\to 0}\frac{y_ip}{x_i}=p_s^\mathrm{sat}\frac{\varphi_i^{\infty,\mathrm{L}}}{\varphi_i^{\infty,\mathrm{V}}}$

The function treats all components with $x_i=0$ as solutes and returns only the Henry's law constants of those components.

In some sense, this would be an effective Henry's law constant that already contains the corrections for the non-ideality of the vapor phase and the pressure dependence of the liquid phase. Because this mainly serves as a tool to compare to experimental results or simplified modelling approaches, I don't see an issue.

params = PcSaftParameters.from_json(["water", "nitrogen", "methanol", "carbon dioxide"], "esper2023.json", "rehner2023_binary.json")
eos = EquationOfState.pcsaft(params)

H = State.henrys_law_constant(eos, 300*KELVIN, np.array([0.6, 0.0, 0.4, 0.0]))
H
[2681433846.773456, 41766375.30479376] Pa

For the simple case of a binary system, a helper function can be used:

params = PcSaftParameters.from_json(["nitrogen", "water"], "../../../Code/feos/feos/parameters/pcsaft/esper2023.json", "../../../Code/feos/feos/parameters/pcsaft/rehner2023_binary.json")
eos = EquationOfState.pcsaft(params)
State.henrys_law_constant_binary(eos, 300*KELVIN)

$47.744~\mathrm{GPa}$