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

test gradient flash #301

Merged
merged 1 commit into from
Nov 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified src/neqsim/lib/java11/neqsim-3.0.5.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion src/neqsim/thermo/thermoTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -1266,7 +1266,7 @@ def TPgradientFlash(testSystem, height, temperature):
None
"""
testFlash = thermodynamicoperations(testSystem)
testFlash.TPgradientFlash(height, temperature)
return testFlash.TPgradientFlash(height, temperature)


def TVflash(testSystem, volume, unit="m3"):
Expand Down
17 changes: 17 additions & 0 deletions tests/thermo/test_ThermoTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
fluidComposition,
fluidflashproperties,
hydt,
TPgradientFlash
)
from numpy import isnan

Expand Down Expand Up @@ -555,3 +556,19 @@ def test_TPflash():
assert fluid1.getPhase("gas").getZ() == approx(1.0262852545644505, rel=1e-6)
TPflash(fluid1, temperature=293.15, pressure=125.0)
assert fluid1.getPhase("gas").getZ() == approx(1.0262852545644505, rel=1e-6)


def test_gradient_flash():
fluid1 = fluid("srk") # create a fluid using the SRK-EoS
fluid1.setTemperature(70.0, "C")
fluid1.setPressure(100.0, "bara")
fluid1.addComponent("nitrogen", 1.0, "mol/sec")
fluid1.addComponent("CO2", 1.0, "mol/sec")
fluid1.addComponent("methane", 97.0, "mol/sec")
fluid1.addComponent("propane", 1.0, "mol/sec")
fluid1.setMixingRule("classic") # classic will use binary kij
# True if more than two phases could be present
TPflash(fluid1)

deep_fluid = TPgradientFlash(fluid1, 1000.0, 273.15+70.0+10.0)
assert deep_fluid.getComponent('CO2').getx() == 0.010905853658496048
Loading