Skip to content

Commit

Permalink
pdate
Browse files Browse the repository at this point in the history
  • Loading branch information
EvenSol committed Dec 25, 2023
1 parent 0c3e5e2 commit b0b6157
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,38 @@ public void add(ProcessEquipmentInterface operation) {
}
}

/**
* <p>
* add.
* </p>
*
*/
public void add(int position, ProcessEquipmentInterface operation) {
ArrayList<ProcessEquipmentInterface> units = this.getUnitOperations();

for (ProcessEquipmentInterface unit : units) {
if (unit == operation) {
return;
}
}

if (getAllUnitNames().contains(operation.getName())) {
String currClass = operation.getClass().getSimpleName();
int num = 1;
for (ProcessEquipmentInterface unit : units) {
if (unit.getClass().getSimpleName().equals(currClass)) {
num++;
}
}
operation.setName(currClass + Integer.toString(num));
}

getUnitOperations().add(position, operation);
if (operation instanceof ModuleInterface) {
((ModuleInterface) operation).initializeModule();
}
}

/**
* <p>
* add.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package neqsim.processSimulation.processEquipment.reservoir;

import org.junit.jupiter.api.Test;
import neqsim.processSimulation.processEquipment.compressor.Compressor;
import neqsim.processSimulation.processEquipment.pipeline.PipeBeggsAndBrills;
import neqsim.processSimulation.processEquipment.stream.StreamInterface;
import neqsim.processSimulation.processEquipment.util.Adjuster;
import neqsim.processSimulation.processEquipment.valve.ThrottlingValve;
import neqsim.processSimulation.processSystem.ProcessSystem;

public class WellFlowTest {
Expand Down Expand Up @@ -59,33 +61,34 @@ void testRunTransient() {
reservoirOps.setReservoirFluid(fluid1, 1e9, 10.0, 10.0e7);

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

WellFlow wellflow = new WellFlow("well flow unit");
wellflow.setInletStream(producedGasStream);
wellflow.setWellProductionIndex(5.000100751427403E-4);
wellflow.setWellProductionIndex(5.000100751427403E-3);

PipeBeggsAndBrills pipe = new PipeBeggsAndBrills(wellflow.getOutletStream());
pipe.setPipeWallRoughness(5e-6);
pipe.setLength(300.0);
pipe.setElevation(100);
pipe.setDiameter(0.325);
pipe.setElevation(300);
pipe.setDiameter(0.625);

PipeBeggsAndBrills pipeline = new PipeBeggsAndBrills(wellflow.getOutletStream());
pipeline.setPipeWallRoughness(5e-6);
pipeline.setLength(60000.0);
pipeline.setElevation(200);
pipeline.setDiameter(0.325);
pipeline.setDiameter(0.725);

// ThrottlingValve chokeValve = new ThrottlingValve("chocke");
// chokeValve.setInletStream(pipeline.getOutletStream());
// chokeValve.setOutletPressure(75.0, "bara");
ThrottlingValve chokeValve = new ThrottlingValve("chocke");
chokeValve.setInletStream(pipeline.getOutletStream());
chokeValve.setOutletPressure(55.0, "bara");


Adjuster adjuster = new Adjuster("adjuster");
adjuster.setTargetVariable(pipeline.getOutletStream(), "pressure", 80.0, "bara");
adjuster.setTargetVariable(pipeline.getOutletStream(), "pressure",
chokeValve.getOutletPressure(), "bara");
adjuster.setAdjustedVariable(producedGasStream, "flow", "MSm3/day");
adjuster.setMaxAdjustedValue(1.0);
adjuster.setMaxAdjustedValue(9.0);

ProcessSystem process = new ProcessSystem();
process.add(reservoirOps);
Expand All @@ -106,8 +109,33 @@ void testRunTransient() {

// process.setTimeStep(60 * 60 * 24 * 365);

for (int i = 0; i < 15; i++) {
for (int i = 0; i < 10; i++) {
reservoirOps.runTransient(60 * 60 * 24 * 365);
process.run();
System.out.println("production flow rate " + producedGasStream.getFlowRate("MSm3/day"));
System.out.println("reservoir pressure " + wellflow.getInletStream().getPressure("bara"));
System.out
.println("pres bottomhole " + wellflow.getOutletStream().getPressure("bara") + " bara");

System.out.println("xmas pressure " + pipe.getOutletStream().getPressure("bara") + " bara");
System.out
.println("top side pressure " + pipeline.getOutletStream().getPressure("bara") + " bara");
System.out
.println("Total produced gas " + reservoirOps.getGasProductionTotal("GMSm3") + " GMSm3");
System.out.println("gas velocity " + pipeline.getSuperficialVelocity());

}

Compressor compressor = new Compressor("subcomp");
compressor.setInletStream(pipe.getOutletStream());
pipeline.setInletStream(compressor.getOutletStream());

process.add(3, compressor);
// process.run();

for (int i = 0; i < 20; i++) {
reservoirOps.runTransient(60 * 60 * 24 * 365);
compressor.setOutletPressure(pipe.getOutletPressure() * 1.2);
process.run();
System.out.println("production flow rate " + producedGasStream.getFlowRate("MSm3/day"));
System.out.println("reservoir pressure " + wellflow.getInletStream().getPressure("bara"));
Expand All @@ -117,8 +145,17 @@ void testRunTransient() {
System.out.println("xmas pressure " + pipe.getOutletStream().getPressure("bara") + " bara");
System.out
.println("top side pressure " + pipeline.getOutletStream().getPressure("bara") + " bara");
System.out
.println("Total produced gas " + reservoirOps.getGasProductionTotal("GMSm3") + " GMSm3");
System.out.println("gas velocity " + pipeline.getSuperficialVelocity());

}



// we install a subsea compressor


}


Expand Down

0 comments on commit b0b6157

Please sign in to comment.