Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix minor error in test #918

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public class MultiPhaseMeter extends StreamMeasurementDeviceBaseClass {
private static final long serialVersionUID = 1000;
static Logger logger = LogManager.getLogger(MultiPhaseMeter.class);

double pressure = 10.0;
double temperature = 298.15;
double pressure = 1.01325;
double temperature = 288.15;
String unitT;
String unitP;

Expand Down Expand Up @@ -111,15 +111,15 @@ public double getMeasuredValue(String unit) {
*/
public double getMeasuredValue(String measurement, String unit) {
if (measurement.equals("mass rate")) {
return stream.getThermoSystem().getFlowRate(unit);
return stream.getFlowRate(unit);
}

if (stream.getThermoSystem().getFlowRate("kg/hr") < 1e-10) {
if (stream.getFlowRate("kg/hr") < 1e-10) {
return Double.NaN;
}

if (measurement.equals("GOR")) {
SystemInterface tempFluid = stream.getThermoSystem().clone();
SystemInterface tempFluid = stream.getFluid().clone();
tempFluid.setTemperature(temperature, unitT);
tempFluid.setPressure(pressure, unitP);
ThermodynamicOperations thermoOps = new ThermodynamicOperations(tempFluid);
Expand Down Expand Up @@ -231,6 +231,7 @@ public double getMeasuredValue(String measurement, String unit) {
return 0.0;
} else if (measurement.equals("GOR_std")) {
SystemInterface tempFluid = stream.getThermoSystem().clone();

tempFluid.setTemperature(15.0, "C");
tempFluid.setPressure(ThermodynamicConstantsInterface.referencePressure, "bara");
ThermodynamicOperations thermoOps = new ThermodynamicOperations(tempFluid);
Expand All @@ -247,6 +248,22 @@ public double getMeasuredValue(String measurement, String unit) {
return Double.NaN;
}
tempFluid.initPhysicalProperties("density");

double GOR_in_sm3_sm3 = tempFluid.getPhase("gas").getFlowRate("Sm3/hr")
/ tempFluid.getPhase("oil").getFlowRate("m3/hr");
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) 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()
/ tempFluid.getPhase("oil").getCorrectedVolume();
} else {
Expand Down
Loading
Loading