diff --git a/.idea/libraries/Maven__de_vandermeer_asciilist_0_0_3.xml b/.idea/libraries/Maven__de_vandermeer_asciilist_0_0_3.xml
new file mode 100644
index 0000000..337ec71
--- /dev/null
+++ b/.idea/libraries/Maven__de_vandermeer_asciilist_0_0_3.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__de_vandermeer_asciitable_0_2_5.xml b/.idea/libraries/Maven__de_vandermeer_asciitable_0_2_5.xml
new file mode 100644
index 0000000..1dee845
--- /dev/null
+++ b/.idea/libraries/Maven__de_vandermeer_asciitable_0_2_5.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_apache_commons_commons_lang3_3_4.xml b/.idea/libraries/Maven__org_apache_commons_commons_lang3_3_4.xml
new file mode 100644
index 0000000..78cfcd3
--- /dev/null
+++ b/.idea/libraries/Maven__org_apache_commons_commons_lang3_3_4.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 5939a05..1ffb95e 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -1,7 +1,24 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -16,79 +33,84 @@
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -103,6 +125,9 @@
+
+
+
-
-
-
+
+
+
@@ -441,7 +467,7 @@
-
+
@@ -450,15 +476,15 @@
-
+
-
+
-
+
@@ -481,14 +507,6 @@
-
-
-
-
-
-
-
-
@@ -505,19 +523,25 @@
-
+
-
-
-
+
+
+
+
+
-
+
-
-
-
+
+
+
+
+
+
+
@@ -533,51 +557,141 @@
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/poc-java.iml b/poc-java.iml
index 716e5f1..cbe8276 100644
--- a/poc-java.iml
+++ b/poc-java.iml
@@ -16,5 +16,8 @@
+
+
+
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 08e377b..774a2be 100644
--- a/pom.xml
+++ b/pom.xml
@@ -31,6 +31,12 @@
mongodb-driver
3.4.2
+
+
+ de.vandermeer
+ asciitable
+ 0.2.5
+
diff --git a/src/main/java/com/henrypump/poc/Card.java b/src/main/java/com/henrypump/poc/Card.java
index 49782f9..5353e70 100644
--- a/src/main/java/com/henrypump/poc/Card.java
+++ b/src/main/java/com/henrypump/poc/Card.java
@@ -1,5 +1,14 @@
package com.henrypump.poc;
+import de.vandermeer.asciitable.v2.RenderedTable;
+import de.vandermeer.asciitable.v2.V2_AsciiTable;
+import de.vandermeer.asciitable.v2.render.V2_AsciiTableRenderer;
+import de.vandermeer.asciitable.v2.render.WidthAbsoluteEven;
+import de.vandermeer.asciitable.v2.themes.V2_E_TableThemes;
+import static java.lang.Math.abs;
+import static java.lang.Math.pow;
+import static java.lang.Math.sqrt;
+
/**
* Created by patrickjmcd on 1/31/17.
*/
@@ -10,10 +19,48 @@ public class Card {
private double[] downholePosition = new double[maxPoints];
private double[] surfaceLoad = new double[maxPoints];
private double[] downholeLoad = new double[maxPoints];
+ private int numPointsUsed;
//Card
private int strokeNumber;
private LPPair surfacePositionMax;
+ private LPPair surfacePositionMin;
+ private LPPair surfaceLoadMax;
+ private LPPair surfaceLoadMin;
+ private LPPair downholePositionMax;
+ private LPPair downholePositionMin;
+ private LPPair downholeLoadMax;
+ private LPPair downholeLoadMin;
+
+ private LPPair topCorner;
+ private LPPair bottomCorner;
+
+ private double surfaceStrokeLength;
+ private double downholeNetStrokeLength;
+ private double downholeGrossStrokeLength;
+ private double downholeAdjustedGrossStrokeLength;
+ private double downholeLoadSpan;
+ private double fluidLoad;
+ private double pumpIntakePressure;
+ private double fluidLevel;
+ private double fillageEstimated;
+ private double fillageCalculated;
+ private double tubingMovement;
+ private double strokeSpeed;
+
+ private double plungerTravel;
+ private double dailyProduction;
+ private double structuralLoading;
+
+ private double polishedRodHorsepower;
+ private double pumpHorsepower;
+
+ private long strokeStartTime;
+
+ Card(int strokeNumber){
+ this.strokeNumber = strokeNumber;
+ strokeStartTime = System.currentTimeMillis();
+ }
public void setSurfacePosition(int i, double position){
this.surfacePosition[i] = position;
@@ -50,4 +97,281 @@ public class Card {
public LPPair getSurfacePositionMax() {
return this.surfacePositionMax;
}
+
+ public int getStrokeNumber() {
+ return strokeNumber;
+ }
+
+ public double getSurfaceStrokeLength() {
+ return surfaceStrokeLength;
+ }
+
+ public double getDownholeNetStrokeLength() {
+ return downholeNetStrokeLength;
+ }
+
+ public double getDownholeGrossStrokeLength() {
+ return downholeGrossStrokeLength;
+ }
+
+ public double getDownholeAdjustedGrossStrokeLength() {
+ return downholeAdjustedGrossStrokeLength;
+ }
+
+ public double getDownholeLoadSpan() {
+ return downholeLoadSpan;
+ }
+
+ public double getFluidLoad() {
+ return fluidLoad;
+ }
+
+ public double getFillageEstimated() {
+ return fillageEstimated;
+ }
+
+ public double getFillageCalculated() {
+ return fillageCalculated;
+ }
+
+ public double getTubingMovement() {
+ return tubingMovement;
+ }
+
+ public double getPlungerTravel() {
+ return plungerTravel;
+ }
+
+ public double getDailyProduction() {
+ return dailyProduction;
+ }
+
+ public double getStructuralLoading() {
+ return structuralLoading;
+ }
+
+ public int getNumPointsUsed() {
+ return numPointsUsed;
+ }
+
+ public void setNumPointsUsed(int numPointsUsed) {
+ this.numPointsUsed = numPointsUsed;
+ }
+
+ private void calculateSPM(){
+ long now = System.currentTimeMillis();
+ long strokeMillis = now - strokeStartTime;
+ strokeSpeed = 60000.0 / (double)(now - strokeStartTime);
+ }
+
+ private static double lineResolve(double x1, double x2, double y1, double y2, double xTest)
+ {
+ double line_m = (y2 - y1) / (x2 - x1);
+ double line_b = y1 - line_m * x1;
+ double yTest = line_m * xTest + line_b;
+ return yTest;
+ }
+
+ private static LPPair positionMax(double[] positionArr, double[] loadArr, int arrSize) {
+ double maxPos = positionArr[0];
+ double loadAtMaxP = Double.MIN_VALUE;
+
+ for(int i = 0; i < arrSize; i++) {
+ maxPos = Math.max(maxPos, positionArr[i]);
+ if (maxPos == positionArr[i]) loadAtMaxP = loadArr[i];
+ }
+ return new LPPair(maxPos, loadAtMaxP);
+ }
+
+ private static LPPair positionMin(double[] positionArr, double[] loadArr, int arrSize) {
+ double minPos = positionArr[0];
+ double loadAtMinP = Double.MAX_VALUE;
+
+ for(int i = 0; i < arrSize; i++) {
+ minPos = Math.min(minPos, positionArr[i]);
+ if (minPos == positionArr[i]) loadAtMinP = loadArr[i];
+ }
+ return new LPPair(minPos, loadAtMinP);
+ }
+
+ private static LPPair loadMax(double[] positionArr, double[] loadArr, int arrSize) {
+ double maxLoad = loadArr[0];
+ double posAtMaxL = Double.MIN_VALUE;
+
+ for(int i = 0; i < arrSize; i++) {
+ maxLoad = Math.max(maxLoad, loadArr[i]);
+ if (maxLoad == positionArr[i]) posAtMaxL = positionArr[i];
+ }
+ return new LPPair(posAtMaxL, maxLoad);
+ }
+
+ private static LPPair loadMin(double[] positionArr, double[] loadArr, int arrSize) {
+ double minLoad = loadArr[0];
+ double posAtMinL = Double.MAX_VALUE;
+
+ for(int i = 0; i < arrSize; i++) {
+ minLoad = Math.min(minLoad, loadArr[i]);
+ if (minLoad == positionArr[i]) posAtMinL = positionArr[i];
+ }
+ return new LPPair(posAtMinL, minLoad);
+ }
+
+ private double distanceToLine(double pos, double load)
+ {
+ double x1 = downholePositionMin.getPosition();
+ double x2 = downholePositionMax.getPosition();
+ double y1 = downholeLoadMin.getLoad();
+ double y2 = downholeLoadMax.getLoad();
+
+ return abs((y2-y1)*pos - (x2-x1)*load + x2*y1 - y2*x1) / sqrt(pow(y2-y1, 2) + pow(x2-x1,2));
+ };
+
+ void calcStrokeData(int numSlices, double fluidGradient, double rodDepth, double anchorDepth, double tubingCSA,
+ double pumpArea, double frictionEstimate, double structuralRating)
+ {
+ calculateSPM();
+ surfacePositionMax = positionMax(surfacePosition, surfaceLoad, numPointsUsed);
+ surfaceLoadMax = loadMax(surfacePosition, surfaceLoad, numPointsUsed);
+ surfacePositionMin = positionMin(surfacePosition, surfaceLoad, numPointsUsed);
+ surfaceLoadMin = loadMin(surfacePosition, surfaceLoad, numPointsUsed);
+
+ downholePositionMax = positionMax(downholePosition, downholeLoad, numPointsUsed);
+ downholeLoadMax = loadMax(downholePosition, downholeLoad, numPointsUsed);
+ downholePositionMin = positionMin(downholePosition, downholeLoad, numPointsUsed);
+ downholeLoadMin = loadMin(downholePosition, downholeLoad, numPointsUsed);
+
+ surfaceStrokeLength = surfacePositionMax.getPosition() - surfacePositionMin.getPosition();
+ downholeGrossStrokeLength = downholePositionMax.getPosition() - downholePositionMin.getPosition();
+ downholeLoadSpan = downholeLoadMax.getLoad() - downholeLoadMin.getLoad();
+
+ double dxSurf = (surfacePositionMax.getPosition() - surfacePositionMin.getPosition()) / (float) numSlices;
+ double dxDown = (downholePositionMax.getPosition() - downholePositionMin.getPosition()) / (float) numSlices;
+
+ pumpHorsepower = 0.0;
+ polishedRodHorsepower = 0.0;
+ double dhDistanceTop = 0.0;
+ double dhDistanceBottom = 0.0;
+
+ for (int i = 1; i < numSlices+1; i++)
+ {
+ double suPosTarget = surfacePositionMin.getPosition() + ((double) i * dxSurf);
+ double dhPosTarget = downholePositionMin.getPosition() + ((double) i * dxDown);
+ double suLoadAtTargetTop = 0.0;
+ double suLoadAtTargetBottom = 0.0;
+ double dhLoadAtTargetTop = 0.0;
+ double dhLoadAtTargetBottom = 0.0;
+
+ for(int j = 0; j < numPointsUsed - 1; j++)
+ {
+ if (downholePosition[j] <= dhPosTarget && downholePosition[j+1] > dhPosTarget){
+ dhLoadAtTargetTop = lineResolve(downholePosition[j], downholePosition[j+1], downholeLoad[j], downholeLoad[j+1], dhPosTarget);
+ }
+
+ if (downholePosition[j] > dhPosTarget && downholePosition[j+1] >= dhPosTarget){
+ dhLoadAtTargetBottom = lineResolve(downholePosition[j], downholePosition[j+1], downholeLoad[j], downholeLoad[j+1], dhPosTarget);
+ }
+
+ if (surfacePosition[j] <= suPosTarget && surfacePosition[j+1] > suPosTarget){
+ suLoadAtTargetTop = lineResolve(surfacePosition[j], surfacePosition[j+1], surfaceLoad[j], surfaceLoad[j+1], suPosTarget);
+ }
+
+ if (surfacePosition[j] > suPosTarget && surfacePosition[j+1] >= suPosTarget){
+ suLoadAtTargetBottom = lineResolve(surfacePosition[j], surfacePosition[j+1], surfaceLoad[j], surfaceLoad[j+1], suPosTarget);
+ }
+ }
+
+ polishedRodHorsepower += (dxSurf / 12.0) * (suLoadAtTargetTop - suLoadAtTargetBottom) * (strokeSpeed / 33000.0);
+ pumpHorsepower += (dxDown / 12.0) * (dhLoadAtTargetTop - dhLoadAtTargetBottom) * (strokeSpeed / 33000.0);
+
+ double tDistance = distanceToLine(dhPosTarget, dhLoadAtTargetTop);
+ double bDistance = distanceToLine(dhPosTarget, dhLoadAtTargetBottom);
+
+ if (tDistance > dhDistanceTop)
+ {
+ dhDistanceTop = tDistance;
+ topCorner = new LPPair(dhPosTarget, dhLoadAtTargetTop);
+ }
+
+ if (bDistance > dhDistanceBottom)
+ {
+ dhDistanceBottom = bDistance;
+ bottomCorner = new LPPair(dhPosTarget, dhLoadAtTargetBottom);
+ }
+ }
+
+ downholeAdjustedGrossStrokeLength = downholePositionMax.getPosition() - topCorner.getPosition();
+ downholeNetStrokeLength = bottomCorner.getPosition() - downholePositionMin.getPosition();
+ fillageCalculated = (downholeNetStrokeLength / downholeAdjustedGrossStrokeLength) * 100.0;
+ fillageEstimated =(downholeNetStrokeLength / downholeGrossStrokeLength) * 100.0;
+
+ if (fillageEstimated > 100)
+ fillageEstimated = 100.0;
+
+ if (fillageCalculated > 100)
+ fillageCalculated = 100.0;
+
+ fluidLoad = (downholeLoadMax.getLoad() - downholeLoadMin.getLoad()) - frictionEstimate;
+ pumpIntakePressure = fluidGradient * rodDepth - (fluidLoad / pumpArea);
+ //printf("PIP = %f * %f - (%f / %f) = %f\n", fluidGradient, rodDepth, fluidLoad, pumpArea, pumpIntakePressure);
+ fluidLevel = pumpIntakePressure / fluidGradient;
+ tubingMovement = 12 * (rodDepth - anchorDepth) * fluidLoad / (30500000 * tubingCSA);
+ structuralLoading = (surfaceLoadMax.getLoad() / (structuralRating * 100)) * 100;
+ };
+
+ public void printCard(String printType, boolean printDataTableToo){
+ if(printType.toLowerCase().equals("table")) {
+ V2_AsciiTable pointsTable = new V2_AsciiTable();
+ pointsTable.addRule();
+ pointsTable.addRow("Surface Position", "Surface Load", "Downhole Position", "Downhole Load");
+ pointsTable.addRule();
+ for (int i = 0; i < numPointsUsed; i++) {
+ pointsTable.addRow(surfacePosition[i], surfaceLoad[i], downholePosition[i], downholeLoad[i]);
+ }
+ pointsTable.addRule();
+ V2_AsciiTableRenderer rend = new V2_AsciiTableRenderer();
+ rend.setTheme(V2_E_TableThemes.UTF_LIGHT.get());
+ rend.setWidth(new WidthAbsoluteEven(100));
+ RenderedTable rt = rend.render(pointsTable);
+ System.out.println(rt);
+ System.out.println();
+ } else if (printType.toLowerCase().equals("csv")){
+ System.out.println("surf_pos,surf_load,down_pos,down_load");
+ for (int i = 0; i < numPointsUsed; i++) {
+ System.out.printf("%f,%f,%f,%f\n", surfacePosition[i], surfaceLoad[i], downholePosition[i], downholeLoad[i]);
+ }
+ System.out.println();
+ }
+
+ if(printDataTableToo){
+ V2_AsciiTable dataTable = new V2_AsciiTable();
+ dataTable.addRule();
+ dataTable.addRow("Card " + strokeNumber, "Value");
+ dataTable.addStrongRule();
+ dataTable.addRow("Fill % (Est.)", fillageEstimated);
+ dataTable.addRow("Fill % (Calc.)", fillageCalculated);
+ dataTable.addRule();
+ dataTable.addRow("Surf. Stroke Length", surfaceStrokeLength);
+ dataTable.addRow("Down. Gross Stroke", downholeGrossStrokeLength);
+ dataTable.addRow("Down. Net Stroke", downholeNetStrokeLength);
+ dataTable.addRow("Tubing Movement", tubingMovement);
+ dataTable.addRule();
+ dataTable.addRow("Polished Rod HP", polishedRodHorsepower);
+ dataTable.addRow("Pump HP", pumpHorsepower);
+ dataTable.addRule();
+ dataTable.addRow("Stroke Speed", strokeSpeed);
+ dataTable.addRule();
+ dataTable.addRow("Fluid Load", fluidLoad);
+ dataTable.addRow("Pump Intake Pressure", pumpIntakePressure);
+ dataTable.addRow("Fluid Level", fluidLevel);
+ dataTable.addRule();
+ dataTable.addRow("Structural Loading", structuralLoading);
+ dataTable.addRule();
+ V2_AsciiTableRenderer rend = new V2_AsciiTableRenderer();
+ rend.setTheme(V2_E_TableThemes.UTF_LIGHT.get());
+ rend.setWidth(new WidthAbsoluteEven(50));
+ RenderedTable rt = rend.render(dataTable);
+ System.out.println(rt);
+ System.out.println();
+ }
+ }
}
diff --git a/src/main/java/com/henrypump/poc/POC.java b/src/main/java/com/henrypump/poc/POC.java
index b465e4a..89712d8 100644
--- a/src/main/java/com/henrypump/poc/POC.java
+++ b/src/main/java/com/henrypump/poc/POC.java
@@ -3,6 +3,78 @@ package com.henrypump.poc;
/**
* Created by patrickjmcd on 2/1/17.
*/
-public class POC {
+public class POC implements Runnable{
+ private Well thisWell;
+ private Simulation sim;
+ private int simLoops;
+ private double tubingMovement;
+ private double pumpIntakePressure;
+ private double fluidLoad;
+ private double fluidLevel;
+ private Thread t;
+
+
+ POC(String wellName, String wellSetupJsonFile, String simFileName, int simLoops){
+ thisWell = new Well(wellName);
+ thisWell.parseJSONFile(wellSetupJsonFile);
+ thisWell.printTapers();
+ sim = new Simulation(simFileName);
+ this.simLoops = simLoops;
+ }
+
+ public void run(){
+
+ int loopCounter = 0, loopLimit = simLoops;
+ long sleepMilliseconds = (long) (thisWell.getDt() * 1000);
+
+ LPStatus downholePoint;
+ while (loopCounter < loopLimit) {
+ Card thisCard = new Card(loopCounter);
+ for (int i = 0; i <= sim.getLastFilledIndex(); i++) {
+ thisCard.setSurfacePosition(i, sim.getPositionAtIndex(i));
+ thisCard.setSurfaceLoad(i, sim.getLoadAtIndex(i));
+ downholePoint = thisWell.calc(sim.getPositionAtIndex(i), sim.getLoadAtIndex(i));
+ if (downholePoint.getStatus() == Well.GOOD_STATUS) {
+ thisCard.setDownholePosition(i, downholePoint.getPosition());
+ thisCard.setDownholeLoad(i, downholePoint.getLoad());
+ }
+ try {
+ Thread.sleep(sleepMilliseconds);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ }
+ thisCard.setNumPointsUsed(sim.getLastFilledIndex());
+ thisCard.calcStrokeData(150, thisWell.getFluidGradient(),
+ thisWell.getRodDepthTotal(), thisWell.getTubingAnchorDepth(),
+ thisWell.getTubingCrossSectionalArea(), thisWell.getPumpArea(),
+ thisWell.getFrictionEstimate(), thisWell.getStructuralRating());
+ thisCard.printCard("none", true);
+ loopCounter++;
+ }
+ }
+
+ public void start () {
+ System.out.println("Starting POC");
+ if (t == null) {
+ t = new Thread (this, "POC-Thread");
+ t.start ();
+ }
+ }
+
+
+ public static void main(String[] args) {
+ POC thisPOC = new POC("Barney", args[0], args[1], 3);
+ thisPOC.start();
+
+ try {
+ Thread.sleep(15000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ POC otherPOC = new POC("NotBarney", args[0], args[1], 4);
+ otherPOC.start();
+ }
}
diff --git a/src/main/java/com/henrypump/poc/Simulation.java b/src/main/java/com/henrypump/poc/Simulation.java
index 873178f..6e7bff2 100644
--- a/src/main/java/com/henrypump/poc/Simulation.java
+++ b/src/main/java/com/henrypump/poc/Simulation.java
@@ -10,8 +10,8 @@ import java.io.IOException;
*/
public class Simulation {
- private double[] position = new double[1000];
- private double[] load = new double[1000];
+ private double[] position = new double[1500];
+ private double[] load = new double[1500];
private int lastFilledIndex = 0;
private void parseCSV(String filename){
@@ -47,14 +47,16 @@ public class Simulation {
}
}
- public double positionAtIndex(int ind){
+ public double getPositionAtIndex(int ind){
return position[ind];
}
- public double loadAtIndex(int ind){
+ public double getLoadAtIndex(int ind){
return load[ind];
}
+ public int getLastFilledIndex() {return lastFilledIndex; }
+
Simulation(String simFilePath){
parseCSV(simFilePath);
}
@@ -62,7 +64,7 @@ public class Simulation {
public static void main(String[] args){
Simulation sim = new Simulation(args[0]);
for(int i = 0; i <= sim.lastFilledIndex; i++){
- System.out.println("Position: " + sim.positionAtIndex(i) + ", Load: "+ sim.loadAtIndex(i));
+ System.out.println("Position: " + sim.getPositionAtIndex(i) + ", Load: "+ sim.getLoadAtIndex(i));
}
}
diff --git a/src/main/java/com/henrypump/poc/Well.java b/src/main/java/com/henrypump/poc/Well.java
index 09a44ed..bb4d60c 100644
--- a/src/main/java/com/henrypump/poc/Well.java
+++ b/src/main/java/com/henrypump/poc/Well.java
@@ -18,14 +18,15 @@ import java.io.IOException;
* Created by patrickjmcd on 1/31/17.
*/
public class Well {
+ private String wellName;
private double[][] topPosArray = new double[10][100];
private double[][] topLoadArray = new double[10][100];
// CONSTANTS
private static double YM_STEEL = 30.5;
private static double YM_FIBERGLASS = 7.2;
- private static final int BAD_STATUS = 0;
- private static final int GOOD_STATUS = 0;
+ public static final int BAD_STATUS = 0;
+ public static final int GOOD_STATUS = 1;
// USER INPUTS
private double dt;
@@ -85,6 +86,10 @@ public class Well {
private int[] count = new int[11];
private double sPositionPrevious;
+ Well(String wellName){
+ this.wellName = wellName;
+ }
+
public double getDt() {
return dt;
}
@@ -196,6 +201,22 @@ public class Well {
return "unknown";
}
+ public double getFrictionEstimate() {
+ return frictionEstimate;
+ }
+
+ public double getRodDepthTotal() {
+ return rodDepthTotal;
+ }
+
+ public double getPumpArea() {
+ return pumpArea;
+ }
+
+ public double getTubingCrossSectionalArea() {
+ return tubingCrossSectionalArea;
+ }
+
public double getStructuralRating() {
return structuralRating;
}
@@ -298,7 +319,6 @@ public class Well {
if (newDiameter != null) setRodDiameter(currentTaperNum, (Double) newDiameter);
Object newMaterial = taperObj.get("material");
- System.out.println("found material " + (String) newMaterial);
if (newMaterial != null) setRodYM(currentTaperNum, (String) newMaterial);
Object newDampingFactor = taperObj.get("dampingFactor");
@@ -312,16 +332,19 @@ public class Well {
} catch (ParseException e) {
e.printStackTrace();
}
+ updateTapers();
}
public void printTapers(){
+ System.out.println("!!!!!! " + wellName + " !!!!!!");
System.out.println("=== INPUT PARAMETERS ===");
System.out.println("DeltaT: " + getDt());
System.out.println("Fluid Gradient: " + getFluidGradient());
System.out.println("Pump Diameter: " + getPumpDiameter());
System.out.println("Stuffing Box Friction: " + getSbfriction());
System.out.println("Structural Rating: " + getStructuralRating());
+ System.out.println("Friction Estimate: " + getFrictionEstimate());
System.out.println("Tubing Anchor Depth: " + getTubingAnchorDepth());
System.out.println("Tubing Head Pressure: " + getTubingHeadPressure());
System.out.println("Tubing ID: " + getTubingID());
@@ -583,7 +606,7 @@ public class Well {
};
public static void main( String[] args ){
- Well thisWell = new Well();
+ Well thisWell = new Well("Barney");
thisWell.parseJSONFile(args[0]);
// thisWell.parseJSONFile("/Users/patrickjmcd/Henry_Pump/poc-java/wellSetup.json");
thisWell.printTapers();
diff --git a/target/classes/com/henrypump/poc/Card.class b/target/classes/com/henrypump/poc/Card.class
index 9e57869..5b0670f 100644
Binary files a/target/classes/com/henrypump/poc/Card.class and b/target/classes/com/henrypump/poc/Card.class differ
diff --git a/target/classes/com/henrypump/poc/POC.class b/target/classes/com/henrypump/poc/POC.class
index b15ac36..30898ce 100644
Binary files a/target/classes/com/henrypump/poc/POC.class and b/target/classes/com/henrypump/poc/POC.class differ
diff --git a/target/classes/com/henrypump/poc/Simulation.class b/target/classes/com/henrypump/poc/Simulation.class
index c669085..3bfb2c2 100644
Binary files a/target/classes/com/henrypump/poc/Simulation.class and b/target/classes/com/henrypump/poc/Simulation.class differ
diff --git a/target/classes/com/henrypump/poc/Well.class b/target/classes/com/henrypump/poc/Well.class
index 4fd0439..5060538 100644
Binary files a/target/classes/com/henrypump/poc/Well.class and b/target/classes/com/henrypump/poc/Well.class differ
diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties
index bc632cc..b526ead 100644
--- a/target/maven-archiver/pom.properties
+++ b/target/maven-archiver/pom.properties
@@ -1,5 +1,5 @@
#Generated by Maven
-#Wed Feb 01 14:16:23 CST 2017
+#Wed Feb 01 18:42:01 CST 2017
version=1.0-SNAPSHOT
groupId=com.henrypump.poc
artifactId=poc-java
diff --git a/target/original-poc-java-1.0-SNAPSHOT.jar b/target/original-poc-java-1.0-SNAPSHOT.jar
index bae2bd9..f5cae30 100644
Binary files a/target/original-poc-java-1.0-SNAPSHOT.jar and b/target/original-poc-java-1.0-SNAPSHOT.jar differ
diff --git a/target/poc-java-1.0-SNAPSHOT.jar b/target/poc-java-1.0-SNAPSHOT.jar
index 4f47107..a3f4fc8 100644
Binary files a/target/poc-java-1.0-SNAPSHOT.jar and b/target/poc-java-1.0-SNAPSHOT.jar differ