Skip to content

Commit

Permalink
cvd and multiphase corrections for reservoir (#1023)
Browse files Browse the repository at this point in the history
* cvdfor reservoir

* added some implementation of TPflash reservoir

* update

* fix error in simulation

* update

* update init(0)

* start adding MPFM fitter
  • Loading branch information
EvenSol authored Jun 3, 2024
1 parent 599bebc commit 2604617
Show file tree
Hide file tree
Showing 8 changed files with 653 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package neqsim.processSimulation.processEquipment.reservoir;

import java.util.UUID;
import neqsim.processSimulation.processEquipment.ProcessEquipmentBaseClass;
import neqsim.thermo.system.SystemInterface;

/**
* <p>
* ReservoirCVDsim class.
* </p>
*
* @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) {

}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package neqsim.processSimulation.processEquipment.reservoir;

import java.util.UUID;
import neqsim.processSimulation.processEquipment.ProcessEquipmentBaseClass;
import neqsim.thermo.system.SystemInterface;

/**
* <p>
* ReservoirDiffLibsim class.
* </p>
*
* @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) {

}

}
Original file line number Diff line number Diff line change
@@ -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;

/**
* <p>
* ReservoirTPsim class.
* </p>
*
* @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;
}



}


Loading

0 comments on commit 2604617

Please sign in to comment.