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

ERROR neqsim.thermo.phase.PhaseEos - Fails with pseudo components #267

Open
sface-admin opened this issue May 13, 2024 · 1 comment
Open

Comments

@sface-admin
Copy link

This is an extension of previously raised issue #241
I get similar error for another gas composition, where all components are non zero. Notice that error starts with addition of C7 pseudo onwards. See the script below,

fluid1 = fluid("srk")
fluid1.setTemperature(40, "C")
fluid1.setPressure(50, "bara")
fluid1.addComponent("nitrogen", 0.88)
fluid1.addComponent("CO2", 5.7)
fluid1.addComponent("methane", 86.89)
fluid1.addComponent("ethane", 3.59)
fluid1.addComponent("propane", 1.25)
fluid1.addComponent("i-butane", 0.19)
fluid1.addComponent("n-butane", 0.35)
fluid1.addComponent("i-pentane", 0.12)
fluid1.addComponent("n-pentane", 0.12)
fluid1.addTBPfraction("C6", 0.15, 86/1000.0, 0.672)
fluid1.addTBPfraction("C7", 0.2, 96/1000.0, 0.737)
fluid1.addTBPfraction("C8", 0.22, 106/1000.0, 0.767)
fluid1.addTBPfraction("C9", 0.13, 121/1000.0, 0.783)
fluid1.addPlusFraction("C10+", 0.21, 172/1000.0, 0.818)
fluid1.setMixingRule("classic")
fluid1.setMultiPhaseCheck(True)
fluid1.useVolumeCorrection(True)
initPhysicalProperties()
thermoOps = jNeqSim.thermodynamicOperations.ThermodynamicOperations(fluid1)
thermoOps.calcPTphaseEnvelope()
plt.plot(list(thermoOps.getOperation().get("dewT")), list(thermoOps.getOperation().get("dewP")), label="DewPoint")
plt.plot(list(thermoOps.getOperation().get("bubT")), list(thermoOps.getOperation().get("bubP")), label="BubblePoint")
plt.show()

@EvenSol
Copy link
Collaborator

EvenSol commented May 13, 2024

Thanks again for reporting this.
However I have problems to reproduce the error.
The follwing script work fine on my computer:


from neqsim.thermo import fluid
from neqsim import jNeqSim
import matplotlib.pyplot as plt 
fluid1 = fluid("srk")
fluid1.setTemperature(40, "C")
fluid1.setPressure(50, "bara")
fluid1.addComponent("nitrogen", 0.88)
fluid1.addComponent("CO2", 5.7)
fluid1.addComponent("methane", 86.89)
fluid1.addComponent("ethane", 3.59)
fluid1.addComponent("propane", 1.25)
fluid1.addComponent("i-butane", 0.19)
fluid1.addComponent("n-butane", 0.35)
fluid1.addComponent("i-pentane", 0.12)
fluid1.addComponent("n-pentane", 0.12)
fluid1.addTBPfraction("C6", 0.15, 86/1000.0, 0.672)
fluid1.addTBPfraction("C7", 0.2, 96/1000.0, 0.737)
fluid1.addTBPfraction("C8", 0.22, 106/1000.0, 0.767)
fluid1.addTBPfraction("C9", 0.13, 121/1000.0, 0.783)
fluid1.addPlusFraction("C10+", 0.21, 172/1000.0, 0.818)
fluid1.setMixingRule("classic")
fluid1.setMultiPhaseCheck(True)
fluid1.useVolumeCorrection(True)

thermoOps = jNeqSim.thermodynamicOperations.ThermodynamicOperations(fluid1)
thermoOps.calcPTphaseEnvelope()
plt.plot(list(thermoOps.getOperation().get("dewT2")), list(thermoOps.getOperation().get("dewP2")), label="DewPoint")
plt.plot(list(thermoOps.getOperation().get("bubT2")), list(thermoOps.getOperation().get("bubP2")), label="BubblePoint")
plt.show()

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