Skip to content

Commit

Permalink
Merge pull request #301 from equinor:update-jar
Browse files Browse the repository at this point in the history
test gradient flash
  • Loading branch information
EvenSol authored Nov 16, 2024
2 parents 5805676 + a2bf852 commit 77d3fde
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
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

0 comments on commit 77d3fde

Please sign in to comment.