equinor / neqsim

NeqSim is a library for calculation of fluid behavior, phase equilibrium and process simulation

Home Page:https://equinor.github.io/neqsimhome/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

:bug: Incorrect Separator Behavior: Equal Liquid and Gas Phase Production

Sviatose opened this issue · comments

Description
The two phase separator is currently exhibiting unexpected behavior, as it is producing liquid and gas phases with equal flow rates.

To Reproduce
Steps to reproduce the behavior:

  1. Go to /workspaces/neqsim/src/test/java/neqsim/processSimulation/processSystem/waterDegasserTest.java
  2. Run test runProcess2
  3. Check the gas and liquid flow rates out of the separator (lines 245-246)

Expected behavior
A gas flow rate should be much lower then liquid flow rate (for the provided test conditions)

Example

    neqsim.processSimulation.processEquipment.heatExchanger.Heater heater_TP_setter_CFU = 
      new neqsim.processSimulation.processEquipment.heatExchanger.Heater("TP_SETTER_CFU", degasser.getWaterOutStream());
    heater_TP_setter_CFU.setOutPressure(6.22176469039917 - 0.5, "bara");
    heater_TP_setter_CFU.setOutTemperature(77.92657470703125, "C");

    neqsim.processSimulation.processEquipment.separator.Separator separator_CFU
    = new neqsim.processSimulation.processEquipment.separator.Separator("SEPARATOR_CFU", heater_TP_setter_CFU.getOutletStream());

    System.out.println("Total flow rate to separator in kg/day: " + heater_TP_setter_CFU.getOutletStream().getFlowRate("kg/hr")*24);// here is the bug
    System.out.println("Total gas flow rate from separator in kg/day: " + separator_CFU.getGasOutStream().getFlowRate("kg/hr")*24);// here is the bug
    System.out.println("Total liquid flow rate from separator in kg/day: " + separator_CFU.getLiquidOutStream().getFlowRate("kg/hr")*24);
Total flow rate to separator in kg/day: 883841.8389631216
Total gas flow rate from separator in kg/day: 883841.8389631216
Total liquid flow rate from separator in kg/day: 883841.8389631216

Great bug report with test. I will have a look.

Did you forget to set the temperature out?
If this is not know, you could have used a valve. If the same temperature as for inlet stream, you should set it to that.

neqsim.processSimulation.processEquipment.heatExchanger.Heater TP_setter_hydrocyclone =
new neqsim.processSimulation.processEquipment.heatExchanger.Heater(
"TP_SETTER_HYDROCYCLONE_AFTER_1ST_SEPARATOR", separator_VA_01.getWaterOutStream());
TP_setter_hydrocyclone.setOutPressure(61.0700675688386, "bara");
TP_setter_hydrocyclone.run();

hydrocyclone_main.setEntrainment(0.01, "mole", "feed", "aqueous", "gas");

you add 1% of the water to the gas in this (did you mean to add water to gas it should be
hydrocyclone_main.setEntrainment(0.01, "mole", "feed", "gas", "aqueous");

for fluid to test separator you should clone the fluid to the first stage separator and set the composition.

To be able to mix the fluids with pseudocomponents, you need to do like this (use one basis fluid)

neqsim.thermo.system.SystemSrkCPAstatoil fluid_test_separator = fluid1.clone();
fluid_test_separator.setMolarComposition(new double[] {0.15, 2.35521735969531e-003,
    4.08789934579643e-002, 0.368428826847070, 0.05236965335060, 3.05388164099689e-002,
    3.79517339704697e-003, 1.07659554327202e-002, 3.34941594776651e-003, 4.44976204442086e-003,
    5.12045113841502e-003, 8.61084195264582e-003, 1.12202354604739e-002, 6.84786693345152e-003,
    7.66033733147483e-003, 3.61717376417156e-003, 2.69924953579736e-003, 1.71199871320840e-003,
    1.63521808584951e-003});

I have updated the test. Can you check if is ok now (the test works as far as I see).

Did you forget to set the temperature out? If this is not know, you could have used a valve. If the same temperature as for inlet stream, you should set it to that.

neqsim.processSimulation.processEquipment.heatExchanger.Heater TP_setter_hydrocyclone = new neqsim.processSimulation.processEquipment.heatExchanger.Heater( "TP_SETTER_HYDROCYCLONE_AFTER_1ST_SEPARATOR", separator_VA_01.getWaterOutStream()); TP_setter_hydrocyclone.setOutPressure(61.0700675688386, "bara"); TP_setter_hydrocyclone.run();

After checking code for heater, I thin it should work also without setting temperature. Then it will assume same temperature out as in inlet. I think it however is good practice to set it if possible.