-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathtest_liquid_remover.py
More file actions
68 lines (61 loc) · 2.45 KB
/
test_liquid_remover.py
File metadata and controls
68 lines (61 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
from ecalc_neqsim_wrapper.thermo import STANDARD_PRESSURE_BARA, STANDARD_TEMPERATURE_KELVIN
from libecalc.process.fluid_stream.fluid_model import EoSModel, FluidComposition, FluidModel
from libecalc.process.fluid_stream.fluid_stream import FluidStream
def test_liquid_remover_removes_liquid(fluid_service, liquid_remover_factory):
composition = FluidComposition(
nitrogen=3,
CO2=1,
methane=62,
ethane=15,
propane=13,
i_butane=1,
n_butane=2,
i_pentane=1,
n_pentane=1,
n_hexane=1,
water=25,
)
fluid_model = FluidModel(eos_model=EoSModel.SRK, composition=composition)
fluid = fluid_service.create_fluid(
fluid_model=fluid_model,
pressure_bara=STANDARD_PRESSURE_BARA,
temperature_kelvin=STANDARD_TEMPERATURE_KELVIN,
)
inlet_stream = FluidStream.from_standard_rate(
standard_rate_m3_per_day=100000,
fluid_model=fluid.fluid_model,
fluid_properties=fluid.properties,
)
remover = liquid_remover_factory()
outlet_stream = remover.propagate_stream(inlet_stream)
assert inlet_stream.vapor_fraction_molar < 1.0
assert outlet_stream.vapor_fraction_molar == 1.0
expected_gas_mass_fraction = (
inlet_stream.vapor_fraction_molar * outlet_stream.fluid.molar_mass / inlet_stream.fluid.molar_mass
)
expected_mass_rate = inlet_stream.mass_rate_kg_per_h * expected_gas_mass_fraction
assert outlet_stream.mass_rate_kg_per_h < inlet_stream.mass_rate_kg_per_h
assert outlet_stream.mass_rate_kg_per_h == expected_mass_rate
def test_liquid_remover_passthrough_when_no_liquid(fluid_service, liquid_remover_factory):
composition = FluidComposition(
nitrogen=3,
CO2=1,
methane=80,
ethane=10,
propane=6,
)
fluid_model = FluidModel(eos_model=EoSModel.SRK, composition=composition)
fluid = fluid_service.create_fluid(
fluid_model=fluid_model,
pressure_bara=STANDARD_PRESSURE_BARA,
temperature_kelvin=STANDARD_TEMPERATURE_KELVIN,
)
inlet_stream = FluidStream.from_standard_rate(
standard_rate_m3_per_day=100000,
fluid_model=fluid.fluid_model,
fluid_properties=fluid.properties,
)
remover = liquid_remover_factory()
outlet_stream = remover.propagate_stream(inlet_stream)
assert inlet_stream.vapor_fraction_molar == 1.0
assert outlet_stream.mass_rate_kg_per_h == inlet_stream.mass_rate_kg_per_h