WellTest class no longer depends on Well class
This will allow it to be run from another thread if necessary
This commit is contained in:
@@ -129,7 +129,8 @@ public class POC implements Runnable{
|
||||
if (newWellTest){
|
||||
System.out.println("Previous kFactor = " + thisWell.db.getLatestKFactor());
|
||||
Date nowDate = Date.from(Instant.now());
|
||||
thisWell.wellTest = new WellTest(nowDate, 24.0, .35, .20, .15, 1.25, thisWell);
|
||||
double lastProductionMeasured = thisWell.db.getPreviousDailyTotal(nowDate);
|
||||
thisWell.wellTest = new WellTest(nowDate, 24.0, .35, .20, .15, 1.25, lastProductionMeasured);
|
||||
thisWell.db.newWellTest(thisWell.wellTest);
|
||||
System.out.println("Well Test @ " + nowDate.toString());
|
||||
System.out.println("kFactor: " + thisWell.wellTest.getkFactor());
|
||||
|
||||
@@ -14,7 +14,7 @@ public class WellTest {
|
||||
private double kFactor, oilRatio, waterRatio, gasMCFRatio;
|
||||
|
||||
|
||||
public WellTest(Date testStart, double testHours, double totalFluidBBL, double testOilBBL, double testWaterBBL, double testGasMCF, Well well) {
|
||||
public WellTest(Date testStart, double testHours, double totalFluidBBL, double testOilBBL, double testWaterBBL, double testGasMCF, double prevDailyTotal) {
|
||||
this.testStart = testStart;
|
||||
this.testHours = testHours;
|
||||
this.totalFluidBBL = totalFluidBBL;
|
||||
@@ -27,9 +27,9 @@ public class WellTest {
|
||||
this.gasMCFRatio = this.testGasMCF / this.totalFluidBBL;
|
||||
|
||||
this.kFactor = 1.0;
|
||||
double lastProductionMeasured = well.db.getPreviousDailyTotal(this.testStart);
|
||||
if(lastProductionMeasured != -1.0){;
|
||||
this.kFactor = this.totalFluidBBL / lastProductionMeasured;
|
||||
|
||||
if(prevDailyTotal != -1.0){;
|
||||
this.kFactor = this.totalFluidBBL / prevDailyTotal;
|
||||
} else {
|
||||
System.out.println("No production data in db");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user