diff --git a/src/main/java/neqsim/processSimulation/measurementDevice/MultiPhaseMeter.java b/src/main/java/neqsim/processSimulation/measurementDevice/MultiPhaseMeter.java
index 049802db15..fa33ec465e 100644
--- a/src/main/java/neqsim/processSimulation/measurementDevice/MultiPhaseMeter.java
+++ b/src/main/java/neqsim/processSimulation/measurementDevice/MultiPhaseMeter.java
@@ -254,13 +254,13 @@ public double getMeasuredValue(String measurement, String unit) {
double GOR_via_corrected_volume = tempFluid.getPhase("gas").getCorrectedVolume()
/ tempFluid.getPhase("oil").getCorrectedVolume();
- //System.out.println("Stream 2 (results inside MPM) " + " GOR sm3/sm3 " + GOR_in_sm3_sm3
- // + " GOR Corrected by volume " + GOR_via_corrected_volume);
+ // System.out.println("Stream 2 (results inside MPM) " + " GOR sm3/sm3 " + GOR_in_sm3_sm3
+ // + " GOR Corrected by volume " + GOR_via_corrected_volume);
- //System.out.println("Stream 2 (results inside MPM) getPhase(gas).getCorrectedVolume() "
- // + tempFluid.getPhase("gas").getCorrectedVolume());
- //System.out.println("Stream 2 (results inside MPM) getPhase(oil).getCorrectedVolume() "
- // + tempFluid.getPhase("oil").getCorrectedVolume());
+ // System.out.println("Stream 2 (results inside MPM) getPhase(gas).getCorrectedVolume() "
+ // + tempFluid.getPhase("gas").getCorrectedVolume());
+ // System.out.println("Stream 2 (results inside MPM) getPhase(oil).getCorrectedVolume() "
+ // + tempFluid.getPhase("oil").getCorrectedVolume());
// GOR_via_corrected_volume and GOR_in_sm3_sm3 should not be so different ?
return tempFluid.getPhase("gas").getCorrectedVolume()
diff --git a/src/main/java/neqsim/processSimulation/processEquipment/reservoir/ReservoirCVDsim.java b/src/main/java/neqsim/processSimulation/processEquipment/reservoir/ReservoirCVDsim.java
new file mode 100644
index 0000000000..a1c488a196
--- /dev/null
+++ b/src/main/java/neqsim/processSimulation/processEquipment/reservoir/ReservoirCVDsim.java
@@ -0,0 +1,28 @@
+package neqsim.processSimulation.processEquipment.reservoir;
+
+import java.util.UUID;
+import neqsim.processSimulation.processEquipment.ProcessEquipmentBaseClass;
+import neqsim.thermo.system.SystemInterface;
+
+/**
+ *
+ * ReservoirCVDsim class.
+ *
+ *
+ * @author Even Solbraa
+ * @version $Id: ReservoirCVDsim.java 1234 2024-05-31 10:00:00Z esolbraa $
+ */
+public class ReservoirCVDsim extends ProcessEquipmentBaseClass {
+ private static final long serialVersionUID = 1000;
+
+ public ReservoirCVDsim(String name, SystemInterface reservoirFluid) {
+ super(name);
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void run(UUID id) {
+
+ }
+
+}
diff --git a/src/main/java/neqsim/processSimulation/processEquipment/reservoir/ReservoirDiffLibsim.java b/src/main/java/neqsim/processSimulation/processEquipment/reservoir/ReservoirDiffLibsim.java
new file mode 100644
index 0000000000..8ede346cdf
--- /dev/null
+++ b/src/main/java/neqsim/processSimulation/processEquipment/reservoir/ReservoirDiffLibsim.java
@@ -0,0 +1,28 @@
+package neqsim.processSimulation.processEquipment.reservoir;
+
+import java.util.UUID;
+import neqsim.processSimulation.processEquipment.ProcessEquipmentBaseClass;
+import neqsim.thermo.system.SystemInterface;
+
+/**
+ *
+ * ReservoirDiffLibsim class.
+ *
+ *
+ * @author Even Solbraa
+ * @version $Id: ReservoirDiffLibsim.java 1234 2024-05-31 10:00:00Z esolbraa $
+ */
+public class ReservoirDiffLibsim extends ProcessEquipmentBaseClass {
+ private static final long serialVersionUID = 1000;
+
+ public ReservoirDiffLibsim(String name, SystemInterface reservoirFluid) {
+ super(name);
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void run(UUID id) {
+
+ }
+
+}
diff --git a/src/main/java/neqsim/processSimulation/processEquipment/reservoir/ReservoirTPsim.java b/src/main/java/neqsim/processSimulation/processEquipment/reservoir/ReservoirTPsim.java
new file mode 100644
index 0000000000..2c930c6721
--- /dev/null
+++ b/src/main/java/neqsim/processSimulation/processEquipment/reservoir/ReservoirTPsim.java
@@ -0,0 +1,97 @@
+package neqsim.processSimulation.processEquipment.reservoir;
+
+import java.util.UUID;
+import neqsim.processSimulation.processEquipment.ProcessEquipmentBaseClass;
+import neqsim.processSimulation.processEquipment.stream.Stream;
+import neqsim.processSimulation.processEquipment.stream.StreamInterface;
+import neqsim.thermo.system.SystemInterface;
+import neqsim.thermodynamicOperations.ThermodynamicOperations;
+
+/**
+ *
+ * ReservoirTPsim class.
+ *
+ *
+ * @author Even Solbraa
+ * @version $Id: ReservoirTPsim.java 1234 2024-05-31 10:00:00Z esolbraa $
+ */
+public class ReservoirTPsim extends ProcessEquipmentBaseClass {
+ private static final long serialVersionUID = 1000;
+
+ private SystemInterface reservoirFluid = null;
+ private StreamInterface outStream = null;
+
+ private double pressure = 100.0;
+ private double temperature = 100.0;
+ private double flowRate = 100.0;
+ private String flowUnit = "kg/hr";
+ private String tUnit = "K";
+ private String pUnit = "bar";
+
+ private String prodPhaseName = "gas";
+
+ public SystemInterface getReserervourFluid() {
+ return reservoirFluid;
+ }
+
+ public ReservoirTPsim(String name, SystemInterface reservoirFluid) {
+ super(name);
+ this.reservoirFluid = reservoirFluid;
+ outStream = new Stream(getName() + "_out", reservoirFluid.clone());
+ }
+
+
+
+ /** {@inheritDoc} */
+ @Override
+ public void run(UUID id) {
+ SystemInterface fluid1 = ((SystemInterface) reservoirFluid).clone();
+ fluid1.setTemperature(temperature, tUnit);
+ fluid1.setPressure(pressure, pUnit);
+ fluid1.setTotalFlowRate(flowRate, flowUnit);
+
+ ThermodynamicOperations operations = new ThermodynamicOperations(fluid1);
+ operations.TPflash();
+
+ if (prodPhaseName.equals("gas") && fluid1.hasPhaseType("gas")) {
+ outStream.setFluid(fluid1.phaseToSystem("gas"));
+ } else if (prodPhaseName.equals("oil") && fluid1.hasPhaseType("oil")) {
+ outStream.setFluid(fluid1.phaseToSystem("oil"));
+ } else {
+ outStream.setFluid(fluid1.phaseToSystem(1));
+ }
+
+ }
+
+ public StreamInterface getOutStream() {
+ return outStream;
+ }
+
+ public void setPressure(double reservoirPressure, String pUnit) {
+ this.pressure = reservoirPressure;
+ this.pUnit = pUnit;
+ }
+
+ public void setTemperature(double reservoirTemperature, String tUnit) {
+ this.temperature = reservoirTemperature;
+ this.tUnit = tUnit;
+ }
+
+ public String getProdPhaseName() {
+ return prodPhaseName;
+ }
+
+ public void setProdPhaseName(String prodPhaseName) {
+ this.prodPhaseName = prodPhaseName;
+ }
+
+ public void setFlowRate(double flowRate, String flowUnit) {
+ this.flowRate = flowRate;
+ this.flowUnit = flowUnit;
+ }
+
+
+
+}
+
+
diff --git a/src/main/java/neqsim/processSimulation/processEquipment/util/MPFMfitter.java b/src/main/java/neqsim/processSimulation/processEquipment/util/MPFMfitter.java
new file mode 100644
index 0000000000..691f949255
--- /dev/null
+++ b/src/main/java/neqsim/processSimulation/processEquipment/util/MPFMfitter.java
@@ -0,0 +1,324 @@
+package neqsim.processSimulation.processEquipment.util;
+
+import java.util.UUID;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import neqsim.processSimulation.processEquipment.TwoPortEquipment;
+import neqsim.processSimulation.processEquipment.stream.StreamInterface;
+import neqsim.thermo.ThermodynamicConstantsInterface;
+import neqsim.thermo.system.SystemInterface;
+import neqsim.thermodynamicOperations.ThermodynamicOperations;
+
+/**
+ *
+ * GORfitter class.
+ *
+ *
+ * @author asmund
+ * @version $Id: $Id
+ */
+public class MPFMfitter extends TwoPortEquipment {
+ private static final long serialVersionUID = 1000;
+ static Logger logger = LogManager.getLogger(MPFMfitter.class);
+
+ double pressure = ThermodynamicConstantsInterface.referencePressure;
+ double temperature = 15.0;
+ private String referenceConditions = "standard"; // "actual";
+ private boolean fitAsGVF = false;
+
+ private double GOR = 120.0;
+ private double GVF;
+ String unitT = "C";
+ String unitP = "bara";
+
+ SystemInterface referenceFluidPackage = null;
+
+ @Deprecated
+ /**
+ *
+ * Constructor for MPFMfitter.
+ *
+ */
+ public MPFMfitter() {
+ super("MPFMfitter fitter");
+ }
+
+ /**
+ *
+ * Constructor for MPFMfitter.
+ *
+ *
+ * @param stream a {@link neqsim.processSimulation.processEquipment.stream.StreamInterface} object
+ */
+ @Deprecated
+ public MPFMfitter(StreamInterface stream) {
+ this("MPFMfitter", stream);
+ }
+
+ /**
+ *
+ * Constructor for MPFMfitter.
+ *
+ *
+ * @param name a {@link java.lang.String} object
+ * @param stream a {@link neqsim.processSimulation.processEquipment.stream.StreamInterface} object
+ */
+ public MPFMfitter(String name, StreamInterface stream) {
+ super(name, stream);
+ }
+
+ /**
+ *
+ * getGFV.
+ *
+ *
+ * @return a double
+ */
+ public double getGFV() {
+ return GVF;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ *
+ * Setter for the field inletStream
.
+ *
+ */
+ @Override
+ public void setInletStream(StreamInterface inletStream) {
+ this.inStream = inletStream;
+ try {
+ this.outStream = inletStream.clone();
+ } catch (Exception ex) {
+ logger.error(ex.getMessage(), ex);
+ }
+ }
+
+ /**
+ *
+ * Getter for the field pressure
.
+ *
+ *
+ * @return a double
+ */
+ @Override
+ public double getPressure() {
+ return pressure;
+ }
+
+ /**
+ *
+ * Setter for the field pressure
.
+ *
+ *
+ * @param pressure a double
+ * @param unitP a {@link java.lang.String} object
+ */
+ public void setPressure(double pressure, String unitP) {
+ this.pressure = pressure;
+ this.unitP = unitP;
+ }
+
+ /**
+ *
+ * getTemperature.
+ *
+ *
+ * @return a double
+ */
+ public double getTemperature() {
+ return temperature;
+ }
+
+ /**
+ *
+ * Setter for the field temperature
.
+ *
+ *
+ * @param temperature a double
+ * @param unitT a {@link java.lang.String} object
+ */
+ public void setTemperature(double temperature, String unitT) {
+ this.temperature = temperature;
+ this.unitT = unitT;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void run(UUID id) {
+ SystemInterface tempFluid = inStream.getThermoSystem().clone();
+ double flow = tempFluid.getFlowRate("kg/sec");
+
+ if (GOR < 1e-15) {
+ outStream.setThermoSystem(tempFluid);
+ return;
+ }
+
+ if (flow < 1e-6) {
+ outStream.setThermoSystem(tempFluid);
+ return;
+ }
+
+ if (GOR == 0 && tempFluid.hasPhaseType("gas")) {
+ tempFluid.removePhase(0);
+ ThermodynamicOperations thermoOps = new ThermodynamicOperations(tempFluid);
+ try {
+ thermoOps.TPflash();
+ } catch (Exception ex) {
+ logger.error(ex.getMessage(), ex);
+ }
+ outStream.setThermoSystem(tempFluid);
+ return;
+ }
+ if (!getReferenceConditions().equals("actual")) {
+ tempFluid.setTemperature(15.0, "C");
+ tempFluid.setPressure(ThermodynamicConstantsInterface.referencePressure, "bara");
+ }
+ ThermodynamicOperations thermoOps = new ThermodynamicOperations(tempFluid);
+ try {
+ thermoOps.TPflash();
+ } catch (Exception ex) {
+ logger.error(ex.getMessage(), ex);
+ }
+ if (!tempFluid.hasPhaseType("gas") || !tempFluid.hasPhaseType("oil")) {
+ outStream = inStream.clone();
+ return;
+ }
+ tempFluid.initPhysicalProperties("density");
+ double currGOR = tempFluid.getPhase("gas").getCorrectedVolume()
+ / tempFluid.getPhase("oil").getCorrectedVolume();
+
+ if (fitAsGVF) {
+ GOR = tempFluid.getPhase("oil").getCorrectedVolume() * getGOR()
+ / (tempFluid.getPhase("oil").getCorrectedVolume()
+ - tempFluid.getPhase("oil").getCorrectedVolume() * getGOR());
+ // GVF*Vo/(Vo-GVF*Vo)
+ // currGOR = tempFluid.getPhase("gas").getCorrectedVolume()
+ // / (tempFluid.getPhase("oil").getCorrectedVolume() +
+ // tempFluid.getPhase("gas").getCorrectedVolume());
+ }
+
+ double dev = getGOR() / currGOR;
+ // System.out.println("dev "+dev);
+
+ double[] moleChange = new double[tempFluid.getNumberOfComponents()];
+ for (int i = 0; i < tempFluid.getNumberOfComponents(); i++) {
+ moleChange[i] =
+ (dev - 1.0) * tempFluid.getPhase("gas").getComponent(i).getNumberOfMolesInPhase();
+ }
+ tempFluid.init(0);
+ for (int i = 0; i < tempFluid.getNumberOfComponents(); i++) {
+ tempFluid.addComponent(i, moleChange[i]);
+ }
+ tempFluid.setPressure((inStream.getThermoSystem()).getPressure());
+ tempFluid.setTemperature((inStream.getThermoSystem()).getTemperature());
+ tempFluid.setTotalFlowRate(flow, "kg/sec");
+ try {
+ thermoOps.TPflash();
+ } catch (Exception ex) {
+ logger.error(ex.getMessage(), ex);
+ }
+ tempFluid.initProperties();
+ outStream.setThermoSystem(tempFluid);
+ if (!tempFluid.hasPhaseType("gas")) {
+ GVF = 0.0;
+ } else if (tempFluid.hasPhaseType("gas") && tempFluid.hasPhaseType("oil")) {
+ GVF = tempFluid.getPhase("gas").getCorrectedVolume()
+ / (tempFluid.getPhase("oil").getCorrectedVolume()
+ + tempFluid.getPhase("gas").getCorrectedVolume());
+ } else {
+ GVF = Double.NaN;
+ }
+
+ outStream.setCalculationIdentifier(id);
+ setCalculationIdentifier(id);
+ }
+
+ /**
+ *
+ * getGOR.
+ *
+ *
+ * @return a double
+ */
+ public double getGOR() {
+ return GOR;
+ }
+
+ /**
+ *
+ * setGOR.
+ *
+ *
+ * @param gOR a double
+ */
+ public void setGOR(double gOR) {
+ fitAsGVF = false;
+ this.GOR = gOR;
+ }
+
+ /**
+ *
+ * setGVF.
+ *
+ *
+ * @param gvf a double
+ */
+ public void setGVF(double gvf) {
+ fitAsGVF = true;
+ this.GOR = gvf;
+ }
+
+ /**
+ *
+ * Getter for the field referenceConditions
.
+ *
+ *
+ * @return the referenceConditions
+ */
+ public String getReferenceConditions() {
+ return referenceConditions;
+ }
+
+ /**
+ *
+ * Setter for the field referenceConditions
.
+ *
+ *
+ * @param referenceConditions the referenceConditions to set
+ */
+ public void setReferenceConditions(String referenceConditions) {
+ this.referenceConditions = referenceConditions;
+ }
+
+ /**
+ *
+ * isFitAsGVF.
+ *
+ *
+ * @return the fitAsGVF
+ */
+ public boolean isFitAsGVF() {
+ return fitAsGVF;
+ }
+
+ /**
+ *
+ * Setter for the field fitAsGVF
.
+ *
+ *
+ * @param fitAsGVF the fitAsGVF to set
+ */
+ public void setFitAsGVF(boolean fitAsGVF) {
+ this.fitAsGVF = fitAsGVF;
+ }
+
+ public SystemInterface getReferenceFluidPackage() {
+ return referenceFluidPackage;
+ }
+
+ public void setReferenceFluidPackage(SystemInterface referenceFluidPackage) {
+ this.referenceFluidPackage = referenceFluidPackage;
+ }
+}
diff --git a/src/main/java/neqsim/thermo/system/SystemThermo.java b/src/main/java/neqsim/thermo/system/SystemThermo.java
index d39d5743db..8f6486903e 100644
--- a/src/main/java/neqsim/thermo/system/SystemThermo.java
+++ b/src/main/java/neqsim/thermo/system/SystemThermo.java
@@ -4460,13 +4460,12 @@ public void setMaxNumberOfPhases(int maxNumberOfPhases) {
public final void setMixingRule(int type) {
mixingRule = type;
if (numberOfPhases < 4) {
- resetPhysicalProperties(); // initPhysicalProperties();
+ resetPhysicalProperties();
}
for (int i = 0; i < maxNumberOfPhases; i++) {
if (isPhase(i)) {
getPhase(i).setMixingRule(type);
getPhase(i).initPhysicalProperties();
- // getPhase(i).getPhysicalProperties().getMixingRule().initMixingRules(getPhase(i));
}
}
}
diff --git a/src/test/java/neqsim/processSimulation/processEquipment/util/MPFMfitterTest.java b/src/test/java/neqsim/processSimulation/processEquipment/util/MPFMfitterTest.java
new file mode 100644
index 0000000000..8544e47848
--- /dev/null
+++ b/src/test/java/neqsim/processSimulation/processEquipment/util/MPFMfitterTest.java
@@ -0,0 +1,72 @@
+package neqsim.processSimulation.processEquipment.util;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import neqsim.processSimulation.measurementDevice.MultiPhaseMeter;
+import neqsim.processSimulation.processEquipment.stream.Stream;
+import neqsim.thermo.ThermodynamicConstantsInterface;
+import neqsim.thermo.system.SystemInterface;
+import neqsim.thermo.system.SystemSrkEos;
+
+public class MPFMfitterTest {
+ @Test
+ void testRun() {
+
+ SystemInterface refFluid = new SystemSrkEos(338.15, 50.0);
+ refFluid.addComponent("nitrogen", 1.205);
+ refFluid.addComponent("CO2", 1.340);
+ refFluid.addComponent("methane", 87.974);
+ refFluid.addComponent("ethane", 5.258);
+ refFluid.addComponent("propane", 3.283);
+ refFluid.addComponent("i-butane", 0.082);
+ refFluid.addComponent("n-butane", 0.487);
+ refFluid.addComponent("i-pentane", 0.056);
+ refFluid.addComponent("n-pentane", 1.053);
+ refFluid.addComponent("nC10", 4.053);
+ refFluid.setMixingRule(2);
+ refFluid.setMultiPhaseCheck(true);
+ refFluid.init(0);
+
+ SystemInterface testFluid = new SystemSrkEos(338.15, 50.0);
+ testFluid.addComponent("nitrogen", 1.205);
+ testFluid.addComponent("CO2", 1.340);
+ testFluid.addComponent("methane", 87.974);
+ testFluid.addComponent("ethane", 5.258);
+ testFluid.addComponent("propane", 3.283);
+ testFluid.addComponent("i-butane", 0.082);
+ testFluid.addComponent("n-butane", 0.487);
+ testFluid.addComponent("i-pentane", 0.056);
+ testFluid.addComponent("n-pentane", 1.053);
+ testFluid.addComponent("nC10", 4.053);
+ testFluid.setMixingRule(2);
+ testFluid.setMultiPhaseCheck(true);
+ testFluid.init(0);
+
+
+ Stream stream_1 = new Stream("Stream1", testFluid);
+
+ MPFMfitter MPFMfitter = new MPFMfitter("MPFM fitter", stream_1);
+ MPFMfitter.setReferenceFluidPackage(refFluid);
+ MPFMfitter.setTemperature(15.0, "C");
+ MPFMfitter.setPressure(ThermodynamicConstantsInterface.referencePressure, "bara");
+ MPFMfitter.setReferenceConditions("actual");
+ MPFMfitter.setGOR(10.1);
+
+ Stream stream_2 = new Stream("stream_2", MPFMfitter.getOutletStream());
+
+ MultiPhaseMeter multiPhaseMeter2 = new MultiPhaseMeter("test", stream_2);
+ multiPhaseMeter2.setTemperature(90.0, "C");
+ multiPhaseMeter2.setPressure(60.0, "bara");
+
+ neqsim.processSimulation.processSystem.ProcessSystem operations =
+ new neqsim.processSimulation.processSystem.ProcessSystem();
+ operations.add(stream_1);
+ operations.add(MPFMfitter);
+ operations.add(stream_2);
+ operations.add(multiPhaseMeter2);
+ operations.run();
+
+ Assertions.assertEquals(8.95393178, multiPhaseMeter2.getMeasuredValue("GOR", ""), 1e-3);
+
+ }
+}
diff --git a/src/test/java/neqsim/processSimulation/processSystem/CombinedOilGasFieldTest.java b/src/test/java/neqsim/processSimulation/processSystem/CombinedOilGasFieldTest.java
new file mode 100644
index 0000000000..5597ac739e
--- /dev/null
+++ b/src/test/java/neqsim/processSimulation/processSystem/CombinedOilGasFieldTest.java
@@ -0,0 +1,97 @@
+package neqsim.processSimulation.processSystem;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import org.junit.jupiter.api.Test;
+import neqsim.processSimulation.measurementDevice.MultiPhaseMeter;
+import neqsim.processSimulation.processEquipment.reservoir.ReservoirTPsim;
+
+public class CombinedOilGasFieldTest {
+
+ @Test
+ public void testreservoirTPsim() {
+
+ neqsim.thermo.system.SystemInterface wellFluid =
+ new neqsim.thermo.system.SystemPrEos(273.15 + 30.0, 65.00);
+ wellFluid.addComponent("nitrogen", 0.08);
+ wellFluid.addComponent("CO2", 3.56);
+ wellFluid.addComponent("methane", 87.36);
+ wellFluid.addComponent("ethane", 4.02);
+ wellFluid.addComponent("propane", 1.54);
+ wellFluid.addComponent("i-butane", 0.2);
+ wellFluid.addComponent("n-butane", 0.42);
+ wellFluid.addComponent("i-pentane", 0.15);
+ wellFluid.addComponent("n-pentane", 0.20);
+
+ wellFluid.addTBPfraction("C6_Oil", 0.24, 84.99 / 1000.0, 695.0 / 1000.0);
+ wellFluid.addTBPfraction("C7_Oil", 0.34, 97.87 / 1000.0, 718.0 / 1000.0);
+ wellFluid.addTBPfraction("C8_Oil", 0.33, 111.54 / 1000.0, 729.0 / 1000.0);
+ wellFluid.addTBPfraction("C9_Oil", 0.19, 126.1 / 1000.0, 749.0 / 1000.0);
+ wellFluid.addTBPfraction("C10_Oil", 0.15, 140.14 / 1000.0, 760.0 / 1000.0);
+ wellFluid.addTBPfraction("C11_Oil", 0.69, 175.0 / 1000.0, 830.0 / 1000.0);
+ wellFluid.addTBPfraction("C12_Oil", 0.5, 280.0 / 1000.0, 914.0 / 1000.0);
+ wellFluid.addTBPfraction("C13_Oil", 0.103, 560.0 / 1000.0, 980.0 / 1000.0);
+
+ wellFluid.addTBPfraction("C6_Gas", 0.0, 84.0 / 1000.0, 684.0 / 1000.0);
+ wellFluid.addTBPfraction("C7_Gas", 0.0, 97.9 / 1000.0, 742.0 / 1000.0);
+ wellFluid.addTBPfraction("C8_Gas", 0.0, 111.5 / 1000.0, 770.0 / 1000.0);
+ wellFluid.addTBPfraction("C9_Gas", 0.0, 126.1 / 1000.0, 790.0 / 1000.0);
+ wellFluid.addTBPfraction("C10_Gas", 0.0, 140.14 / 1000.0, 805.0 / 1000.0);
+ wellFluid.addTBPfraction("C11_Gas", 0.0, 175.0 / 1000.0, 815.0 / 1000.0);
+ wellFluid.addTBPfraction("C12_Gas", 0.0, 280.0 / 1000.0, 835.0 / 1000.0);
+ wellFluid.addTBPfraction("C13_Gas", 0.0, 450.0 / 1000.0, 850.0 / 1000.0);
+
+ wellFluid.setMixingRule("classic");
+ wellFluid.init(0);
+
+ neqsim.thermo.system.SystemInterface wellFluidGasWell =
+ (neqsim.thermo.system.SystemInterface) wellFluid.clone();
+ wellFluidGasWell.setMolarComposition(
+ new double[] {0.108, 3.379, 85.915, 4.250, 1.719, 0.275, 0.549, 0.201, 0.256, 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, 0.0, 0.0, 0.24, 0.34, 0.33, 0.19, 0.15, 0.69, 0.5, 0.03});
+
+
+ ReservoirTPsim reservoirGasTPsim = new ReservoirTPsim("TPreservoir", wellFluidGasWell);
+ reservoirGasTPsim.setTemperature(150.0, "C");
+ reservoirGasTPsim.setPressure(250.0, "bara");
+ reservoirGasTPsim.setFlowRate(50000.0, "kg/hr");
+ reservoirGasTPsim.setProdPhaseName("gas");
+
+ MultiPhaseMeter MPFMgas = new MultiPhaseMeter("Gas MPFM", reservoirGasTPsim.getOutStream());
+ MPFMgas.setTemperature(60.0, "C");
+ MPFMgas.setPressure(80.0, "bara");
+
+ // ReservoirCVDsim reservoirCVD = new ReservoirCVDsim();
+ // ReservoirDiffLibsim reservoirDiffLib = new ReservoirDiffLibsim();
+ /*
+ * neqsim.thermo.system.SystemInterface wellFluidOilWell =
+ * (neqsim.thermo.system.SystemInterface) wellFluid.clone();
+ * wellFluidOilWell.setMolarComposition( new double[] {0.047, 0.191, 39.022, 0.25, 0.053, 0.017,
+ * 0.022, 0.021, 0.015, 0.057, 0.176, 0.181, 0.177, 0.81, 15.353, 30.738, 12.869, 0.0, 0.0, 0.0,
+ * 0.0, 0.0, 0.0, 0.0, 0.0});
+ *
+ * Stream wellStreamOil = new Stream("Well Stream Oil Well", wellFluidOilWell);
+ * wellStreamOil.setFlowRate(50000.0, "kg/hr"); wellStreamOil.setTemperature(100.0, "C");
+ * wellStreamOil.setPressure(100.0, "bara");
+ */
+
+
+ // MultiPhaseMeter MPFMoil = new MultiPhaseMeter("Oil MPFM", wellStreamOil);
+ // MPFMoil.setTemperature(60.0, "C");
+ // MPFMoil.setPressure(20.0, "bara");
+
+ neqsim.processSimulation.processSystem.ProcessSystem operations =
+ new neqsim.processSimulation.processSystem.ProcessSystem();
+ operations.add(reservoirGasTPsim);
+ operations.add(MPFMgas);
+ operations.run();
+ assertEquals(8760.096083, MPFMgas.getMeasuredValue("GOR_std", ""), 1.0);
+
+ reservoirGasTPsim.setPressure(150.0, "bara");
+ operations.run();
+ assertEquals(14880.1810, MPFMgas.getMeasuredValue("GOR_std", ""), 1.0);
+
+
+
+ }
+
+}