Skip to content

Commit

Permalink
update (#894)
Browse files Browse the repository at this point in the history
  • Loading branch information
EvenSol authored Jan 2, 2024
1 parent e421337 commit ba1b338
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -325,66 +325,42 @@ public void setReservoirFluid(SystemInterface thermoSystem, double gasVolume, do
this.gasVolume = gasVolume;
this.waterVolume = waterVolume;

if (gasVolume > 1e-10 && oilVolume > 1e-10) {
ThermodynamicOperations ops = new ThermodynamicOperations(thermoSystem);
ThermodynamicOperations ops = new ThermodynamicOperations(thermoSystem);
ops.TPflash();

if (waterVolume > 1e-10 && !thermoSystem.hasPhaseType("aqueous")) {
thermoSystem.addComponent("water", thermoSystem.getTotalNumberOfMoles());
ops.TPflash();
thermoSystem.initProperties();
SystemInterface thermoSystem2 = thermoSystem.clone();
thermoSystem.setEmptyFluid();
for (int j = 0; j < thermoSystem.getNumberOfPhases(); j++) {
double relFact = gasVolume / (thermoSystem2.getPhase(j).getVolume() * 1.0e-5);
if (j >= 1) {
if (j == 1) {
relFact = oilVolume / (thermoSystem2.getPhase(j).getVolume() * 1.0e-5);
// totalliquidVolume += oilVolume / thermoSystem2.getPhase(j).getMolarVolume();
} else if (j == 2) {
relFact = waterVolume / (thermoSystem2.getPhase(j).getVolume() * 1.0e-5);
// totalliquidVolume += waterVolume /
// thermoSystem2.getPhase(j).getMolarVolume();
}
}
for (int i = 0; i < thermoSystem.getPhase(j).getNumberOfComponents(); i++) {
thermoSystem.addComponent(thermoSystem.getPhase(j).getComponent(i).getComponentNumber(),
relFact * thermoSystem2.getPhase(j).getComponent(i).getNumberOfMolesInPhase(), j);
}
}

thermoSystem.initProperties();
SystemInterface thermoSystem2 = thermoSystem.clone();
thermoSystem.setEmptyFluid();
for (int j = 0; j < thermoSystem.getNumberOfPhases(); j++) {
String phaseType = thermoSystem.getPhase(j).getPhaseTypeName();
double relFact = gasVolume / (thermoSystem2.getPhase(j).getVolume() * 1.0e-5);
if (phaseType.equals("oil")) {
relFact = oilVolume / (thermoSystem2.getPhase(j).getVolume() * 1.0e-5);
// totalliquidVolume += oilVolume / thermoSystem2.getPhase(j).getMolarVolume();
} else if (phaseType.equals("aqueous")) {
relFact = waterVolume / (thermoSystem2.getPhase(j).getVolume() * 1.0e-5);
} else {
relFact = gasVolume / (thermoSystem2.getPhase(j).getVolume() * 1.0e-5);
}
} else {
ThermodynamicOperations ops = new ThermodynamicOperations(thermoSystem);
ops.TPflash();
thermoSystem.initProperties();
SystemInterface thermoSystem2 = thermoSystem.clone();
thermoSystem.setEmptyFluid();
double relFact = (gasVolume + oilVolume) / (thermoSystem2.getPhase("oil").getVolume("m3"));
for (int i = 0; i < thermoSystem.getNumberOfComponents(); i++) {
thermoSystem.addComponent(thermoSystem.getComponent(i).getComponentNumber(),
relFact * thermoSystem2.getComponent(i).getNumberOfMolesInPhase());
for (int i = 0; i < thermoSystem.getPhase(j).getNumberOfComponents(); i++) {
thermoSystem.addComponent(thermoSystem.getPhase(j).getComponent(i).getComponentNumber(),
relFact * thermoSystem2.getPhase(j).getComponent(i).getNumberOfMolesInPhase(), j);
}
double relFactWater = (waterVolume) / (thermoSystem2.getPhase("aqueous").getVolume("m3"));
thermoSystem.addComponent("water", relFactWater
* thermoSystem2.getPhase("aqueous").getComponent("water").getNumberOfMolesInPhase());
}

/*
* if (thermoSystem.hasPhaseType("gas")) { thermoSystem.setBeta(gasVolume /
* thermoSystem2.getPhase(0).getMolarVolume() / (gasVolume /
* thermoSystem2.getPhase(0).getMolarVolume() + oilVolume /
* thermoSystem2.getPhase(1).getMolarVolume())); }
*/

ThermodynamicOperations ops2 = new ThermodynamicOperations(thermoSystem);
ops2.TPflash();
thermoSystem.initProperties();
// thermoSystem.display();
// gasOutStream = new Stream();
// gasOutStream.setFluid(thermoSystem.phaseToSystem("gas"));
reservoirVolume = gasVolume + oilVolume + waterVolume;

OOIP =

getOilInPlace("Sm3");
OOIP = getOilInPlace("Sm3");
OGIP = getGasInPlace("Sm3");
// oilOutStream = new Stream();
// oilOutStream.setFluid(thermoSystem.phaseToSystem("oil"));

lowPressureLimit = 50.0;
}

Expand Down Expand Up @@ -867,6 +843,6 @@ public void setLowPressureLimit(double value, String unit) {

public double getLowPressureLimit(String unit) {
PressureUnit conver = new PressureUnit(lowPressureLimit, "bara");
return conver.getValue(unit);
return conver.getValue(unit);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -188,5 +188,31 @@ void testRunTransient() {
}
}

@Test
void testCalcWellFlow() {
neqsim.thermo.system.SystemInterface fluid1 =
new neqsim.thermo.system.SystemPrEos(373.15, 100.0);
fluid1.addComponent("water", 3.599);
fluid1.addComponent("nitrogen", 0.599);
fluid1.addComponent("CO2", 0.51);
fluid1.addComponent("methane", 62.8);
fluid1.setMixingRule(2);
fluid1.setMultiPhaseCheck(true);

SimpleReservoir reservoirOps = new SimpleReservoir("Well 1 reservoir");
reservoirOps.setReservoirFluid(fluid1, 1e9, 1.0, 10.0e7);
reservoirOps.setLowPressureLimit(10.0, "bara");

StreamInterface producedGasStream = reservoirOps.addGasProducer("gasproducer_1");
producedGasStream.setFlowRate(9.0, "MSm3/day");

WellFlow wellflow = new WellFlow("well flow unit");
wellflow.setInletStream(producedGasStream);

double permeability = 50.0; // milli darcy
// wellflow.setDarcyLawParameters(permeability, );
// wellflow.setWellProductionIndex(10.000100751427403E-3);
}


}

0 comments on commit ba1b338

Please sign in to comment.