Skip to content

Commit

Permalink
Addwaterproducer (#778)
Browse files Browse the repository at this point in the history
* add water production report

* added more units for reading flow rate of phase

* added test for water
  • Loading branch information
EvenSol authored Jul 15, 2023
1 parent 2ed2128 commit f28934e
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,34 @@ public double getOilProdution(String unit) {
return volume;
}

/**
* <p>
* getWaterProdution.
* </p>
*
* @param unit a {@link java.lang.String} object
* @return a double
*/
public double getWaterProdution(String unit) {
double volume = 0.0;
for (int i = 0; i < gasProducer.size(); i++) {
volume += gasProducer.get(i).getStdWaterProduction();
}
for (int i = 0; i < oilProducer.size(); i++) {
volume += oilProducer.get(i).getStdWaterProduction();
}
for (int i = 0; i < waterProducer.size(); i++) {
volume += waterProducer.get(i).getStdWaterProduction();
}
if (unit.equals("Sm3/sec")) {
} else if (unit.equals("Sm3/day")) {
volume = volume * 60.0 * 60 * 24;
} else if (unit.equals("Sm3/hr")) {
volume = volume * 60.0 * 60;
}
return volume;
}

/** {@inheritDoc} */
@Override
public void runTransient(double dt, UUID id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public double getStdGasProduction() {
locStream.setPressure(1.01325);
ThermodynamicOperations ops = new ThermodynamicOperations(locStream);
ops.TPflash();
double volume = Double.NaN;
double volume = 0;
if (locStream.hasPhaseType("gas")) {
volume = locStream.getPhase("gas").getVolume("m3");
}
Expand All @@ -117,10 +117,30 @@ public double getStdOilProduction() {
locStream.setPressure(1.01325);
ThermodynamicOperations ops = new ThermodynamicOperations(locStream);
ops.TPflash();
double volume = Double.NaN;
double volume = 0;
if (locStream.hasPhaseType("oil")) {
volume = locStream.getPhase("oil").getVolume("m3");
}
return volume;
}

/**
* <p>
* getStdWaterProduction.
* </p>
*
* @return a double
*/
public double getStdWaterProduction() {
SystemInterface locStream = (stream.getFluid()).clone();
locStream.setTemperature(288.15);
locStream.setPressure(1.01325);
ThermodynamicOperations ops = new ThermodynamicOperations(locStream);
ops.TPflash();
double volume = 0;
if (locStream.hasPhaseType("aqueous")) {
volume = locStream.getPhase("aqueous").getVolume("m3");
}
return volume;
}
}
13 changes: 13 additions & 0 deletions src/main/java/neqsim/thermo/phase/Phase.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import neqsim.physicalProperties.PhysicalPropertyHandler;
import neqsim.thermo.ThermodynamicConstantsInterface;
import neqsim.thermo.component.ComponentInterface;
import neqsim.thermo.system.SystemInterface;
import neqsim.util.exception.InvalidInputException;
Expand Down Expand Up @@ -2137,6 +2138,18 @@ public double getFlowRate(String flowunit) {
return numberOfMolesInPhase * 60.0;
} else if (flowunit.equals("mole/hr")) {
return numberOfMolesInPhase * 3600.0;
} else if (flowunit.equals("Sm3/sec")) {
return numberOfMolesInPhase * ThermodynamicConstantsInterface.R
* ThermodynamicConstantsInterface.standardStateTemperature / 101325.0;
} else if (flowunit.equals("Sm3/hr")) {
return numberOfMolesInPhase * 3600.0 * ThermodynamicConstantsInterface.R
* ThermodynamicConstantsInterface.standardStateTemperature / 101325.0;
} else if (flowunit.equals("Sm3/day")) {
return numberOfMolesInPhase * 3600.0 * 24.0 * ThermodynamicConstantsInterface.R
* ThermodynamicConstantsInterface.standardStateTemperature / 101325.0;
} else if (flowunit.equals("MSm3/day")) {
return numberOfMolesInPhase * 3600.0 * 24.0 * ThermodynamicConstantsInterface.R
* ThermodynamicConstantsInterface.standardStateTemperature / 101325.0 / 1.0e6;
} else {
throw new RuntimeException("failed.. unit: " + flowunit + " not supported");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void testRun2() {
producedOilStream.setFlowRate(6500.0 / 0.86 * 1000.0 * 4, "kg/day");

StreamInterface producedWaterStream = reservoirOps.addWaterProducer("waterproducer_1");
producedWaterStream.setFlowRate(0.0 * 1000.0 * 4, "kg/day");
producedWaterStream.setFlowRate(10000, "kg/day");

StreamInterface injectorGasStream = reservoirOps.addGasInjector("gasinjector_1");
neqsim.thermo.system.SystemInterface fluidGas = fluid1.clone();
Expand All @@ -59,6 +59,6 @@ void testRun2() {
reservoirOps.runTransient(deltaTime);
}
Assertions.assertEquals(352.274030, reservoirOps.getReservoirFluid().getPressure("bara"), 0.1);

Assertions.assertEquals(11.698, reservoirOps.getWaterProdution("Sm3/day"), 0.1);
}
}

0 comments on commit f28934e

Please sign in to comment.