Skip to content

Difference in Molar Enthalpies between EoS and DFT #68

Closed

Description

@RolfStierle

Contributions.IdealGas uses different methods for EoS and DFT (see below).

Joback gives very small values for the IdealGas molar enthalpy (as fat as I tested all in the range ~1e-13 * JOULE).

import numpy as np

from feos.si import *
from feos.pcsaft import *

from feos.eos import EquationOfState, Contributions
from feos.eos import State as EosState
from feos.eos import PhaseEquilibrium as EosPhaseEquilibrium

from feos.dft import HelmholtzEnergyFunctional, PhaseEquilibrium
from feos.dft import State as DftState
from feos.dft import PhaseEquilibrium as DftPhaseEquilibrium

substances = ['nitrogen', 'methane']
params = PcSaftParameters.from_json(substances=substances, pure_path='pure_parameters.json', binary_path='binary_parameters.json', search_option=IdentifierOption.Name)

eos = EquationOfState.pcsaft(params)
dft = HelmholtzEnergyFunctional.pcsaft(params)

vle_eos = EosPhaseEquilibrium.bubble_point(eos, temperature_or_pressure=110*KELVIN, liquid_molefracs=np.array([0.1, 0.9]))
vle_dft = DftPhaseEquilibrium.bubble_point(dft, temperature_or_pressure=110*KELVIN, liquid_molefracs=np.array([0.1, 0.9]))

print(vle_eos.liquid.helmholtz_energy_contributions()) # Gives QSPR as IdealGas contribution
print(vle_dft.liquid.helmholtz_energy_contributions()) # Gives Joback as IdealGas contribution

print(vle_eos.liquid.molar_enthalpy(contributions=Contributions.ResidualNvt) - vle_dft.liquid.molar_enthalpy(contributions=Contributions.ResidualNvt)) #Gives very good agreement in the ResidualNvt contribution

print(vle_eos.liquid.molar_enthalpy(contributions=Contributions.IdealGas) - vle_dft.liquid.molar_enthalpy(contributions=Contributions.IdealGas)) # Gives large discrepancy in IdealGas contribution

Activity

  1. prehner commented on Nov 8, 2022

    @prehner
    Contributor

    Thanks for raising this issue. To be completely aware of what is happening, we would need the content of your pure_parameters.json file, but the fact that Joback gives ~0 and the other outputs suggest, that it does not contain Joback parameters. In this case the eos will fall back on the QSPR method whereas the functional will use Joback where all parameters are 0.

    It is indeed confusing behavior that we should attempt to make more transparent.

  2. added this to the v0.4.0 milestone on Dec 29, 2022
  3. prehner commented on Jan 12, 2023

    @prehner
    Contributor

    Closed in favor of #109

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions