-
Notifications
You must be signed in to change notification settings - Fork 14
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 - Failed to solve for molarVolume within the iteration limit. #241
Comments
Thanks for pointing at this. It is a weakness in the phase envelope algorithm not accepting components with mole fraction 0. We will fix this in a later release, and mark this as a bug. To run the script without any error, you can skip adding components where number of moles are 0.
|
Thanks, that does solve for this composition. However 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") |
All this seems to work in the new version and using the method: thermoOps = jNeqSim.thermodynamicOperations.ThermodynamicOperations(fluid1) See the tests in the notebook: |
I often get this error where composition has pseudo components. Is this particularly an error due to python envelope?
The snip of example code below.
from neqsim.thermo.thermoTools import *
import matplotlib.pyplot as plt
fluid1 = fluid("srk") # create a fluid using the SRK-EoS
fluid1.setTemperature(80, "C")
fluid1.setPressure(50, "bara")
fluid1.addComponent("nitrogen", 0)
fluid1.addComponent("CO2", 1.005)
fluid1.addComponent("H2S", 0)
fluid1.addComponent("methane", 24.62)
fluid1.addComponent("ethane", 2.704)
fluid1.addComponent("propane", 2.706)
fluid1.addComponent("i-butane", 1.309)
fluid1.addComponent("n-butane", 2.031)
fluid1.addComponent("i-pentane", 2.047)
fluid1.addComponent("n-pentane", 1.49)
fluid1.addTBPfraction("C6", 3.176, 85.3/1000.0, 0.6649)
fluid1.addTBPfraction("C7", 5.331, 93.2/1000.0, 0.7266)
fluid1.addTBPfraction("C8", 7.796, 105.1/1000.0, 0.7607)
fluid1.addTBPfraction("C9", 5.179, 119.4/1000.0, 0.7812)
fluid1.addPlusFraction("C10+", 40.616, 268/1000.0, 0.865)
fluid1.setMixingRule("classic")
fluid1.setMultiPhaseCheck(True)
fluid1.useVolumeCorrection(True)
TPflash(fluid1)
fluid1.getInterphaseProperties().setInterfacialTensionModel("gas", "oil", "Parachor")
fluid1.initProperties()
fluid1.display()
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("bubT")), list(thermoOps.getOperation().get("bubP")), label="BubblePoint")
plt.show()
The text was updated successfully, but these errors were encountered: