commit a7073aae9c70e3eb913a18cb3fa49593855d03fd Author: Patrick McDonagh Date: Wed Feb 1 14:24:35 2017 -0600 AnalogIn, DigitalIn, DigitalOut, Simulation, and Card classes all working correctly so far diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..f73e28e --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_googlecode_json_simple_json_simple_1_1_1.xml b/.idea/libraries/Maven__com_googlecode_json_simple_json_simple_1_1_1.xml new file mode 100644 index 0000000..f3f3738 --- /dev/null +++ b/.idea/libraries/Maven__com_googlecode_json_simple_json_simple_1_1_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_mraa_mraa_1_5_1.xml b/.idea/libraries/Maven__io_mraa_mraa_1_5_1.xml new file mode 100644 index 0000000..4725f74 --- /dev/null +++ b/.idea/libraries/Maven__io_mraa_mraa_1_5_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__junit_junit_3_8_1.xml b/.idea/libraries/Maven__junit_junit_3_8_1.xml new file mode 100644 index 0000000..71b2993 --- /dev/null +++ b/.idea/libraries/Maven__junit_junit_3_8_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_mongodb_bson_3_4_2.xml b/.idea/libraries/Maven__org_mongodb_bson_3_4_2.xml new file mode 100644 index 0000000..3ad18d7 --- /dev/null +++ b/.idea/libraries/Maven__org_mongodb_bson_3_4_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_mongodb_mongodb_driver_3_4_2.xml b/.idea/libraries/Maven__org_mongodb_mongodb_driver_3_4_2.xml new file mode 100644 index 0000000..eb69c1d --- /dev/null +++ b/.idea/libraries/Maven__org_mongodb_mongodb_driver_3_4_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_mongodb_mongodb_driver_core_3_4_2.xml b/.idea/libraries/Maven__org_mongodb_mongodb_driver_core_3_4_2.xml new file mode 100644 index 0000000..c315f1a --- /dev/null +++ b/.idea/libraries/Maven__org_mongodb_mongodb_driver_core_3_4_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..ff20635 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..6ef8c4d --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..5939a05 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,583 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1485905737979 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dependency-reduced-pom.xml b/dependency-reduced-pom.xml new file mode 100644 index 0000000..65b434e --- /dev/null +++ b/dependency-reduced-pom.xml @@ -0,0 +1,41 @@ + + + 4.0.0 + com.henrypump.poc + poc-java + poc-java + 1.0-SNAPSHOT + http://maven.apache.org + + + + maven-shade-plugin + 3.0.0 + + + package + + shade + + + + + com.henrypump.poc.Well + + + + + + + + + + + junit + junit + 3.8.1 + test + + + + diff --git a/poc-java.iml b/poc-java.iml new file mode 100644 index 0000000..716e5f1 --- /dev/null +++ b/poc-java.iml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..08e377b --- /dev/null +++ b/pom.xml @@ -0,0 +1,59 @@ + + 4.0.0 + com.henrypump.poc + poc-java + jar + 1.0-SNAPSHOT + poc-java + http://maven.apache.org + + + junit + junit + 3.8.1 + test + + + + io.mraa + mraa + 1.5.1 + + + com.googlecode.json-simple + json-simple + 1.1.1 + + + + org.mongodb + mongodb-driver + 3.4.2 + + + + + + org.apache.maven.plugins + maven-shade-plugin + 3.0.0 + + + package + + shade + + + + + com.henrypump.poc.Well + + + + + + + + + diff --git a/src/main/java/com/henrypump/poc/AnalogIn.java b/src/main/java/com/henrypump/poc/AnalogIn.java new file mode 100644 index 0000000..b9f1328 --- /dev/null +++ b/src/main/java/com/henrypump/poc/AnalogIn.java @@ -0,0 +1,76 @@ +package com.henrypump.poc; + +/** + * Created by patrickjmcd on 2/1/17. + */ + +import mraa.Dir; +import mraa.Aio; +import mraa.mraa; +import mraa.Platform; +import mraa.Result; + +import static java.lang.Thread.sleep; + + +public class AnalogIn { + private int channel; + private Aio gpioPin; + private double lastValue; + private double rawMin; + private double rawMax; + private double euMin; + private double euMax; + + static { + try { + System.loadLibrary("mraajava"); + } catch (UnsatisfiedLinkError e) { + System.err.println( + "Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + + e); + System.exit(1); + } + } + + AnalogIn(int channel, double rawMin, double rawMax, double euMin, double euMax){ + Platform platform = mraa.getPlatformType(); + if (platform != Platform.INTEL_EDISON_FAB_C) { + System.err.println("Error: This program can only be run on edison"); + System.exit(Result.ERROR_INVALID_PLATFORM.swigValue()); + } + + this.channel = channel; + this.gpioPin = new Aio(this.channel); + this.rawMax = rawMax; + this.rawMin = rawMin; + this.euMax = euMax; + this.euMin = euMin; + } + + public long readRaw(){ + return gpioPin.read(); + } + + public double readScaled(){ + double pv = ((euMax - euMin)/(rawMax - rawMin)) * gpioPin.read() + (euMax - ((euMax - euMin)/(rawMax - rawMin)) * rawMax); + lastValue = pv; + return pv; + } + + public static void main(String[] args){ + System.out.println("Testing Analog Inputs Inputs..."); + boolean forceEnd = false; + AnalogIn testIn0 = new AnalogIn(0, 0, 1020, 0, 4.6); + + do { + try{ + System.out.println("Raw = " + testIn0.readRaw()); + System.out.println("Scaled = " + testIn0.readScaled()); + sleep(500); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } while (!forceEnd); + } +} diff --git a/src/main/java/com/henrypump/poc/App.java b/src/main/java/com/henrypump/poc/App.java new file mode 100644 index 0000000..e7d0ba5 --- /dev/null +++ b/src/main/java/com/henrypump/poc/App.java @@ -0,0 +1,13 @@ +package com.henrypump.poc; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} diff --git a/src/main/java/com/henrypump/poc/Card.java b/src/main/java/com/henrypump/poc/Card.java new file mode 100644 index 0000000..49782f9 --- /dev/null +++ b/src/main/java/com/henrypump/poc/Card.java @@ -0,0 +1,53 @@ +package com.henrypump.poc; + +/** + * Created by patrickjmcd on 1/31/17. + */ +public class Card { + // Card Points + private int maxPoints = 1500; + private double[] surfacePosition = new double[maxPoints]; + private double[] downholePosition = new double[maxPoints]; + private double[] surfaceLoad = new double[maxPoints]; + private double[] downholeLoad = new double[maxPoints]; + + //Card + private int strokeNumber; + private LPPair surfacePositionMax; + + public void setSurfacePosition(int i, double position){ + this.surfacePosition[i] = position; + }; + + public void setDownholePosition(int i, double position){ + this.downholePosition[i] = position; + }; + + public void setSurfaceLoad(int i, double load){ + this.surfaceLoad[i] = load; + }; + + public void setDownholeLoad(int i, double load){ + this.downholeLoad[i] = load; + }; + + public double[] getSurfacePosition() { + return this.surfacePosition; + } + + public double[] getDownholePosition() { + return this.downholePosition; + } + + public double[] getSurfaceLoad() { + return this.surfaceLoad; + } + + public double[] getDownholeLoad() { + return this.downholeLoad; + } + + public LPPair getSurfacePositionMax() { + return this.surfacePositionMax; + } +} diff --git a/src/main/java/com/henrypump/poc/DigitalIn.java b/src/main/java/com/henrypump/poc/DigitalIn.java new file mode 100644 index 0000000..d125cfe --- /dev/null +++ b/src/main/java/com/henrypump/poc/DigitalIn.java @@ -0,0 +1,96 @@ +package com.henrypump.poc; + +/** + * Created by patrickjmcd on 1/31/17. + */ + +/* + * Author: Brendan Le Foll + * Author: Petre Eftime + * Copyright (c) 2015 Intel Corporation. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +import mraa.Dir; +import mraa.Gpio; +import mraa.mraa; +import mraa.Platform; +import mraa.Result; + +public class DigitalIn { + private int channel; + private Gpio gpioPin; + private int lastValue; + + static { + try { + System.loadLibrary("mraajava"); + } catch (UnsatisfiedLinkError e) { + System.err.println( + "Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + + e); + System.exit(1); + } + } + + DigitalIn(int channel){ + Platform platform = mraa.getPlatformType(); + + if (platform != Platform.INTEL_EDISON_FAB_C) { + System.err.println("Error: This program can only be run on edison"); + System.exit(Result.ERROR_INVALID_PLATFORM.swigValue()); + } + + this.channel = channel; + this.gpioPin = new Gpio(this.channel); + gpioPin.dir(Dir.DIR_IN); + } + + public int read(){ + lastValue = gpioPin.read(); + return lastValue; + } + + public static void main(String[] args){ + System.out.println("Testing Digital Inputs. Script will loop until ch8 and ch9 both equal 1"); + boolean forceEnd = false; + DigitalIn testIn8 = new DigitalIn(8); + DigitalIn testIn9 = new DigitalIn(9); + + DigitalOut testOut2 = new DigitalOut(2); + DigitalOut testOut3 = new DigitalOut(3); + + int in8val, in9val; + do { + in8val = testIn8.read(); + in9val = testIn9.read(); + + testOut2.write(in8val); + testOut3.write(in9val); + + if (in8val == 1 && in9val == 1) forceEnd = true; + testOut2.write(0); + testOut3.write(0); + } while (!forceEnd); + } + +} + diff --git a/src/main/java/com/henrypump/poc/DigitalOut.java b/src/main/java/com/henrypump/poc/DigitalOut.java new file mode 100644 index 0000000..90ca71b --- /dev/null +++ b/src/main/java/com/henrypump/poc/DigitalOut.java @@ -0,0 +1,84 @@ +package com.henrypump.poc; + +/** + * Created by patrickjmcd on 2/1/17. + */ + +import mraa.Dir; +import mraa.Gpio; +import mraa.mraa; +import mraa.Platform; +import mraa.Result; + +import static java.lang.Thread.sleep; + +public class DigitalOut { + private int channel; + private Gpio gpioPin; + + static { + try { + System.loadLibrary("mraajava"); + } catch (UnsatisfiedLinkError e) { + System.err.println( + "Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + + e); + System.exit(1); + } + } + + DigitalOut(int channel){ + Platform platform = mraa.getPlatformType(); + + if (platform != Platform.INTEL_EDISON_FAB_C) { + System.err.println("Error: This program can only be run on edison"); + System.exit(Result.ERROR_INVALID_PLATFORM.swigValue()); + } + + this.channel = channel; + this.gpioPin = new Gpio(this.channel); + gpioPin.dir(Dir.DIR_OUT); + } + + public void write(int writeVal){ + gpioPin.write(writeVal); + } + + public static void main(String[] args){ + try { + DigitalOut testOut2 = new DigitalOut(2); + testOut2.write(1); + sleep(500); + testOut2.write(0); + + DigitalOut testOut3 = new DigitalOut(3); + testOut3.write(1); + sleep(500); + testOut3.write(0); + + DigitalOut testOut4 = new DigitalOut(4); + testOut4.write(1); + sleep(500); + testOut4.write(0); + + DigitalOut testOut5 = new DigitalOut(5); + testOut5.write(1); + sleep(500); + testOut5.write(0); + + DigitalOut testOut6 = new DigitalOut(6); + testOut6.write(1); + sleep(500); + testOut6.write(0); + + DigitalOut testOut7 = new DigitalOut(7); + testOut7.write(1); + sleep(500); + testOut7.write(0); + + } catch(InterruptedException ex) { + Thread.currentThread().interrupt(); + } + } + +} diff --git a/src/main/java/com/henrypump/poc/LPPair.java b/src/main/java/com/henrypump/poc/LPPair.java new file mode 100644 index 0000000..4f2c37c --- /dev/null +++ b/src/main/java/com/henrypump/poc/LPPair.java @@ -0,0 +1,23 @@ +package com.henrypump.poc; + +/** + * Created by patrickjmcd on 1/31/17. + */ +public class LPPair { + private double position; + private double load; + + public LPPair(double position, double load){ + this.position = position; + this.load = load; + }; + + public double getPosition(){ + return this.position; + }; + + public double getLoad(){ + return this.load; + }; + +} diff --git a/src/main/java/com/henrypump/poc/LPStatus.java b/src/main/java/com/henrypump/poc/LPStatus.java new file mode 100644 index 0000000..500bfa0 --- /dev/null +++ b/src/main/java/com/henrypump/poc/LPStatus.java @@ -0,0 +1,17 @@ +package com.henrypump.poc; + +/** + * Created by patrickjmcd on 1/31/17. + */ +public class LPStatus extends LPPair{ + private int status; + + public LPStatus(double position, double load, int status) { + super(position, load); + this.status = status; + } + + public int getStatus() { + return status; + } +} diff --git a/src/main/java/com/henrypump/poc/POC.java b/src/main/java/com/henrypump/poc/POC.java new file mode 100644 index 0000000..b465e4a --- /dev/null +++ b/src/main/java/com/henrypump/poc/POC.java @@ -0,0 +1,8 @@ +package com.henrypump.poc; + +/** + * Created by patrickjmcd on 2/1/17. + */ +public class POC { + +} diff --git a/src/main/java/com/henrypump/poc/Simulation.java b/src/main/java/com/henrypump/poc/Simulation.java new file mode 100644 index 0000000..873178f --- /dev/null +++ b/src/main/java/com/henrypump/poc/Simulation.java @@ -0,0 +1,72 @@ +package com.henrypump.poc; + +import java.io.BufferedReader; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; + +/** + * Created by patrickjmcd on 2/1/17. + */ +public class Simulation { + + private double[] position = new double[1000]; + private double[] load = new double[1000]; + private int lastFilledIndex = 0; + + private void parseCSV(String filename){ + BufferedReader br = null; + String line = ""; + String cvsSplitBy = ","; + int lineNum = 0; + try { + br = new BufferedReader(new FileReader(filename)); + while ((line = br.readLine()) != null) { + // use comma as separator + String[] splitLine = line.split(cvsSplitBy); + position[lineNum] = Double.parseDouble(splitLine[0]); + load[lineNum] = Double.parseDouble(splitLine[1]); + lineNum++; + } + + + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } finally { + + if (br != null) { + lastFilledIndex = lineNum - 1; + try { + br.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + } + + public double positionAtIndex(int ind){ + return position[ind]; + } + + public double loadAtIndex(int ind){ + return load[ind]; + } + + Simulation(String simFilePath){ + parseCSV(simFilePath); + } + + 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)); + } + } + + + + +} diff --git a/src/main/java/com/henrypump/poc/Well.java b/src/main/java/com/henrypump/poc/Well.java new file mode 100644 index 0000000..09a44ed --- /dev/null +++ b/src/main/java/com/henrypump/poc/Well.java @@ -0,0 +1,595 @@ +package com.henrypump.poc; + + +import org.json.simple.JSONArray; +import org.json.simple.JSONObject; +import org.json.simple.parser.JSONParser; +import org.json.simple.parser.ParseException; + +import static java.lang.Math.exp; +import static java.lang.Math.pow; +import static java.lang.Math.sqrt; + +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; + +/** + * Created by patrickjmcd on 1/31/17. + */ +public class Well { + 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; + + // USER INPUTS + private double dt; + private double tubingHeadPressure; + private double fluidGradient; + private double sbfriction; + private int numTapers; + private double tubingAnchorDepth; + private double pumpDiameter; + private double tubingID, tubingOD; + private double structuralRating; + private double[] c = new double[11]; + private double[] rodLength = new double[11]; + private double[] rodDiameter = new double[11]; + private double[] rodYM = new double[11]; + private double[] rodWeightPerFoot = new double[11]; + + + // CALCULATED TAPER PARAMETERS + private int nT1; // should always be equal to number of tapers + 1 + private double frictionEstimate; + private double theoreticalMaxFluidLoad; + private double[] a = new double[11]; + private double[] area = new double[11]; + private double[] pressure = new double[11]; + private double[] buoyantForce = new double[11]; + private double buoyantForceTotal; + private double[] stretch = new double[11]; + private double[] weightData = new double[11]; + private double weightDataTotal; + private double[] annularForceData = new double[11]; + private double annularForceDataTotal; + private double[] force = new double[11]; + private double[] alpha = new double[11]; + private double[] xOverA = new double[11]; + private double[] factor = new double[11]; + private int[] lagIndex = new int[11]; + private int[] lengthRequired = new int[11]; + private int[] centerPoint = new int[11]; + private double[] rodDepth = new double[11]; + private double rodDepthTotal; + private double[] rodWeightAir = new double[11]; + private double rodWeightAirTotal; + private double[] rodWeightFluid = new double[11]; + private double rodWeightFluidTotal; + + + private double pumpArea; + private double tubingCrossSectionalArea; + + // Intermediate Variables + private double loadBefore = 0.0; + private double loadAfter = 0.0; + private double loadBefore3 = 0.0; + private double loadAfter3 = 0.0; + + private int[] count = new int[11]; + private double sPositionPrevious; + + public double getDt() { + return dt; + } + + public void setDt(double dt) { + this.dt = dt; + } + + public double getTubingHeadPressure() { + return tubingHeadPressure; + } + + public void setTubingHeadPressure(double tubingHeadPressure) { + this.tubingHeadPressure = tubingHeadPressure; + } + + public double getFluidGradient() { + return fluidGradient; + } + + public void setFluidGradient(double fluidGradient) { + this.fluidGradient = fluidGradient; + } + + public double getSbfriction() { + return sbfriction; + } + + public void setSbfriction(double sbfriction) { + this.sbfriction = sbfriction; + } + + public int getNumTapers() { + return numTapers; + } + + public void setNumTapers(int numTapers) { + this.numTapers = numTapers; + } + + public double getTubingAnchorDepth() { + return tubingAnchorDepth; + } + + public void setTubingAnchorDepth(double tubingAnchorDepth) { + this.tubingAnchorDepth = tubingAnchorDepth; + } + + public double getPumpDiameter() { + return pumpDiameter; + } + + public void setPumpDiameter(double pumpDiameter) { + this.pumpDiameter = pumpDiameter; + this.pumpArea = pow(pumpDiameter, 2) * Math.PI; + } + + public double getTubingID() { + return tubingID; + } + + public void setTubingID(double tubingID) { + this.tubingID = tubingID; + this.tubingCrossSectionalArea = (Math.PI / 4) * (pow(this.tubingOD, 2) - pow(this.tubingID,2)); + } + + public double getTubingOD() { + return tubingOD; + } + + public void setTubingOD(double tubingOD) { + this.tubingOD = tubingOD; + this.tubingCrossSectionalArea = (Math.PI / 4) * (pow(this.tubingOD, 2) - pow(tubingID,2)); + + } + + public void setDampingFactor(int i, double c) { + this.c[i] = c; + } + + public double getDampingFactor(int i){ return c[i]; } + + public void setRodLength(int i, double rodLength) { + this.rodLength[i] = rodLength; + } + + public double getRodLength(int i){ return rodLength[i]; } + + public void setRodDiameter(int i, double rodDiameter) { + this.rodDiameter[i] = rodDiameter; + } + + public double getRodDiameter(int i){ return rodDiameter[i]; } + + public void setRodYM(int i, String material) { + + if (material.toLowerCase().equals("steel")) rodYM[i] = YM_STEEL; + else if (material.toLowerCase().equals("fiberglass")) rodYM[i] = YM_FIBERGLASS; + + } + + public double getRodYM(int i){ return rodYM[i]; } + + public String getRodMaterial(int i){ + if(rodYM[i] == YM_STEEL) + return "steel"; + if(rodYM[i] == YM_FIBERGLASS) + return "fiberglass"; + return "unknown"; + } + + public double getStructuralRating() { + return structuralRating; + } + + public void setStructuralRating(double structuralRating) { + this.structuralRating = structuralRating; + } + + public static double lookupRodWeightPerFoot(double i_ym, double i_diam) { + double wtPerFt; + if (i_ym == YM_STEEL) { + if (i_diam <= 2 && i_diam > 1.75) { + wtPerFt = 10.7; + } else if (i_diam <= 1.75 && i_diam > 1.65) { + wtPerFt = 8.2; + } else if (i_diam <= 1.65 && i_diam > 1.5) { + wtPerFt = 7; + } else if (i_diam <= 1.5 && i_diam > 1.375) { + wtPerFt = 6; + } else if (i_diam <= 1.375 && i_diam > 1.125) { + wtPerFt = 5; + } else if (i_diam <= 1.125 && i_diam > 1) { + wtPerFt = 3.676; + } else if (i_diam <= 1 && i_diam > 0.875) { + wtPerFt = 2.904; + } else if (i_diam <= 0.875 && i_diam > 0.75) { + wtPerFt = 2.224; + } else if (i_diam <= 0.75 && i_diam > 0.625) { + wtPerFt = 1.634; + } else if (i_diam <= 0.625 && i_diam > 0.5) { + wtPerFt = 1.13; + } else if (i_diam <= 0.5) { + wtPerFt = 0.72; + } else { + wtPerFt = 0; + } + } else if (i_ym == YM_FIBERGLASS) { + if (i_diam <= 1.25 && i_diam > 1.125) { + wtPerFt = 1.2879; + } else if (i_diam <= 1.125 && i_diam > 1) { + wtPerFt = 1.09; + } else if (i_diam <= 1 && i_diam > 0.875) { + wtPerFt = 0.8188; + } else if (i_diam <= 0.875 && i_diam > 0.75) { + wtPerFt = 0.6108; + } else if (i_diam <= 0.75) { + wtPerFt = 0.484; + } else { + wtPerFt = 0; + } + } else { + wtPerFt = 0; + } + return wtPerFt; + }; + + public void parseJSONFile(String jsonFilename){ + JSONParser parser = new JSONParser(); + try { + Object obj = parser.parse(new FileReader(jsonFilename)); + JSONObject well = (JSONObject) obj; + + Object newDeltaT = well.get("deltaT"); + if (newDeltaT != null) dt = (Double) newDeltaT; + + Object newPumpDiameter = well.get("pumpDiameter"); + if (newPumpDiameter != null) setPumpDiameter((Double) newPumpDiameter); + + Object newFluidGradient = well.get("fluidGradient"); + if (newFluidGradient != null) fluidGradient = (Double) newFluidGradient; + + Object newTubingID = well.get("tubingID"); + if (newTubingID != null) setTubingID((Double) newTubingID); + + Object newTubingOD = well.get("tubingOD"); + if (newTubingOD != null) setTubingOD((Double) newTubingOD); + + Object newTubingAnchorDepth = well.get("tubingAnchorDepth"); + if (newTubingAnchorDepth != null) tubingAnchorDepth = (Double) newTubingAnchorDepth; + + Object newStructuralRating = well.get("structuralRating"); + if (newStructuralRating != null) structuralRating = (Double) newStructuralRating; + + Object newStuffingBoxFriction = well.get("stuffingBoxFriction"); + if (newStuffingBoxFriction != null) setSbfriction((Double) newStuffingBoxFriction); + + Object newTubingHeadPressure = well.get("tubingOD"); + if (newTubingHeadPressure != null) setTubingOD((Double) newTubingHeadPressure); + + JSONArray tapers = (JSONArray) well.get("tapers"); + numTapers = tapers.size(); + for (int i = 0; i < numTapers; i++){ + int currentTaperNum = i + 1; + JSONObject taperObj = (JSONObject) tapers.get(i); + + Object newLength = taperObj.get("length"); + if (newLength != null) setRodLength(currentTaperNum, (Double) newLength); + + Object newDiameter = taperObj.get("diameter"); + 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"); + if (newDampingFactor != null) setDampingFactor(currentTaperNum, (Double) newDampingFactor); + } + + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } catch (ParseException e) { + e.printStackTrace(); + } + + } + + public void printTapers(){ + 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("Tubing Anchor Depth: " + getTubingAnchorDepth()); + System.out.println("Tubing Head Pressure: " + getTubingHeadPressure()); + System.out.println("Tubing ID: " + getTubingID()); + System.out.println("Tubing OD: " + getTubingOD()); + System.out.println("Number of Tapers: " + getNumTapers()); + System.out.println(""); + + for(int i = 1; i <= numTapers; i++){ + System.out.printf("=== Taper %d === \n", i); + System.out.println("Rod Length: " + getRodLength(i)); + System.out.println("Rod Diameter: " + getRodDiameter(i)); + System.out.println("Rod Damping Factor: " + getDampingFactor(i)); + System.out.println("Rod Material: " + getRodMaterial(i)); + System.out.println("Rod Young's Modulus: " + getRodYM(i)); + System.out.println(""); + } + + + }; + + public void updateTapers(){ + nT1 = numTapers + 1; + + // start by setting everything to 0 + a[0] = 0.0; + area[0] = 0.0; + area[numTapers + 1] = 0.0; + pressure[0] = tubingHeadPressure; + buoyantForce[0] = 0.0; + stretch[0] = 0.0; + weightData[0] = 0.0; + annularForceData[0] = 0.0; + force[0] = 0.0; + alpha[0] = 0.0; + xOverA[0] = 0.0; + factor[0] = 0.0; + lagIndex[0] = 0; + lengthRequired[0] = 0; + centerPoint[0] = 0; + rodDepth[0] = 0.0; + rodWeightAir[0] = 0.0; + rodWeightFluid[0] = 0.0; + buoyantForceTotal = 0.0; + weightDataTotal = 0.0; + annularForceDataTotal = 0.0; + rodDepthTotal = 0.0; + rodWeightAirTotal = 0.0; + rodWeightFluidTotal = 0.0; + + for(int i = 1; i < nT1; i++){ + rodWeightPerFoot[i] = lookupRodWeightPerFoot(rodYM[i], rodDiameter[i]); + } + + for (int area_i = 1; area_i < nT1; area_i++) + { + area[area_i] = (Math.PI / 4) * pow(rodDiameter[area_i], 2); + } + + for (int i = 1; i < nT1; i++) + { + a[i] = 1000 * sqrt(32.2 * rodYM[i] * area[i] / rodWeightPerFoot[i]); + rodDepth[i] = rodDepth[i - 1] + rodLength[i]; + pressure[i] = pressure[i - 1] + fluidGradient * rodLength[i]; + buoyantForce[i] = pressure[i] * (area[i + 1] - area[i]); + rodWeightAir[i] = rodWeightPerFoot[i] * rodLength[i]; + rodWeightFluid[i] = rodWeightAir[i] + buoyantForce[i]; + } + for (int j = 1; j < nT1; j++) + { + for (int k = j + 1; k < nT1; k++) + { + weightData[j] += rodWeightAir[k]; // how much weight is felt on each taper + } + for (int l = j; l < numTapers; l++) + { + annularForceData[j] += -buoyantForce[l]; //buoyant force exerted on each taper + } + force[j] = (-area[numTapers] * pressure[numTapers]) + weightData[j] - annularForceData[j]; + alpha[j] = (force[j] + rodWeightAir[j]) / (rodYM[j] * pow(10, 6) * area[j]); + stretch[j] = (stretch[j - 1] + (alpha[j] * rodLength[j])) - ((rodWeightPerFoot[j] * pow(rodLength[j], 2)) / (2 * rodYM[j] * pow(10, 6) * area[j])); + } + + for (int m = 1; m < nT1; m++) + { + xOverA[m] = rodLength[m] / a[m]; + lagIndex[m] = (int)(rodLength[m] / (a[m] * dt)); + factor[m] = (xOverA[m] - lagIndex[m] * dt) / dt; + centerPoint[m] = lagIndex[m] + 2; + lengthRequired[m] = 2 * (lagIndex[m] + 1) + 1; + } + + for (int t = 0; t < nT1; t++) + { + buoyantForceTotal += buoyantForce[t]; + rodWeightAirTotal += rodWeightAir[t]; + rodWeightFluidTotal += rodWeightFluid[t]; + rodDepthTotal += rodLength[t]; + annularForceDataTotal += annularForceData[t]; + weightDataTotal += weightData[t]; + } + + theoreticalMaxFluidLoad = fluidGradient* rodDepthTotal* pumpArea; + frictionEstimate = 0.10 * rodDepthTotal; + } + + private double position(int p) + //generate the downhole position of the given rod part + { + loadBefore = 0; + loadAfter = 0; + loadBefore3 = 0; + loadAfter3 = 0; + + //Temporary Variables + double a1 = a[p]; + double cd = c[p]; + double fact = factor[p]; + double rodLengthp = rodLength[p]; + int lagInd = lagIndex[p]; + double Y1 = rodYM[p] * pow(10, 6); + double A1 = area[p]; + int centerOfArray = centerPoint[p]; + + int iBefore = centerOfArray - lagInd; + int iAfter = centerOfArray + lagInd; + + double pumpPOS = 0; + //Do work + pumpPOS = exp((cd * rodLengthp) / (2 * a1)) * (topPosArray[p][iAfter] + fact * (topPosArray[p][ iAfter + 1] - topPosArray[p][iAfter])); + pumpPOS += exp(-(cd * rodLengthp) / (2 * a1)) * (topPosArray[p][iBefore] + fact * (topPosArray[p][iBefore - 1] - topPosArray[p][iBefore])); + pumpPOS = pumpPOS / 2; + double insideIntegral = 0; + int q = 1; + while (q < 2 * lagInd - 1) + { + insideIntegral += dt * (1 / (Y1 * A1)) * (exp(-(cd * (lagInd - q) * dt) / 2) * topLoadArray[p][iBefore + q]); + q++; + } + insideIntegral += 0.5 * dt * (1 / (Y1 * A1)) * (exp(-(cd * lagInd * dt) / 2) * topLoadArray[p][iBefore] + exp(-(cd * (-lagInd) * dt) / 2) * topLoadArray[p][iAfter]); + + loadBefore = exp(-(cd * lagInd * dt) / 2) * topLoadArray[p][iBefore] + fact * (exp(-(cd * (lagInd + 1) * dt) / 2) * topLoadArray[p][iBefore - 1] - exp(-(cd * lagInd * dt) / 2) * topLoadArray[p][iBefore]); + loadAfter = exp(-(cd * (-lagInd) * dt) / 2) * topLoadArray[p][iAfter] + fact * (exp(-(cd * (-lagInd - 1) * dt) / 2) * topLoadArray[p][iAfter + 1] - exp(-(cd * (-lagInd) * dt) / 2) * topLoadArray[p][iAfter]); + insideIntegral += 0.5 * fact * dt * (1 / (Y1 * A1)) * (loadBefore + exp(-(cd * (lagInd) * dt) / 2) * topLoadArray[p][iBefore]); + insideIntegral += 0.5 * fact * dt * (1 / (Y1 * A1)) * (loadAfter + exp(-(cd * (-lagInd) * dt) / 2) * topLoadArray[p][iAfter]); + insideIntegral = 0.5 * a1 * insideIntegral; + pumpPOS += insideIntegral; + + insideIntegral = 0; + int r = 1; + while (r < 2 * lagInd - 1) + { + insideIntegral += dt * (exp(-(cd * lagInd - r) * dt) / 2) * (topPosArray[p][iBefore + r]); + r++; + } + insideIntegral += 0.5 * dt * (exp(-(cd * lagInd * dt) / 2) * topPosArray[p][iBefore] + exp(-(cd * (-lagInd) * dt) / 2) * topPosArray[p][iAfter]); + loadBefore3 = exp(-(cd * (lagInd) * dt) / 2) * topPosArray[p][iBefore] + fact * (exp(-(cd * (lagInd + 1) * dt) / 2) * topPosArray[p][iBefore] - exp(-(cd * (lagInd) * dt) / 2) * topPosArray[p][iBefore]); + loadAfter3 = exp(-(cd * (-lagInd) * dt) / 2) * topPosArray[p][iAfter] + fact * (exp(-(cd * (-lagInd - 1) * dt) / 2) * topPosArray[p][iAfter] - exp(-(cd * (-lagInd) * dt) / 2) * topPosArray[p][iAfter]); + insideIntegral += 0.5 * fact * dt * (loadBefore3 + exp(-(cd * (lagInd) * dt) / 2) * topPosArray[p][iBefore]); + insideIntegral += 0.5 * fact * dt * (loadAfter3 + exp(-(cd * (-lagInd) * dt) / 2) * topPosArray[p][iAfter]); + insideIntegral = -((cd * rodLengthp) / 4) * (0.5 * (cd / (2 * a1))) * insideIntegral; + pumpPOS += insideIntegral; + //printf("Position: %f\n", pumpPOS); + return pumpPOS; + }; + + + private double load(int s) + //calculate the downhole load of the given rod part + { + //temporary variables + double a1 = a[s]; + double cd = c[s]; + double rodLengths = rodLength[s]; + int lagInd = lagIndex[s]; + double Y1 = rodYM[s] * pow(10, 6); + double A1 = area[s]; + int centerOfArray = centerPoint[s]; + + int iBefore = centerOfArray - lagInd; + int iAfter = centerOfArray + lagInd; + + double pumpLOAD = 0; + pumpLOAD = 0.5 * (a1 / (Y1 * A1)) * (1 / a1) * (loadBefore + loadAfter); + pumpLOAD += -((cd * rodLengths) / 4) * (0.5 * (cd / (2 * a1))) * (1 / a1) * (loadBefore3 + loadAfter3); + + double firstPart = 0; + double pointAfter = (topPosArray[s][iAfter + 1] - topPosArray[s][iAfter - 1]) / (2 * dt); + double pointBefore = (topPosArray[s][iBefore + 1] - topPosArray[s][iBefore - 1]) / (2 * dt); + firstPart = (exp((cd * rodLengths) / (2 * a1)) * pointAfter - exp(-(cd * rodLengths) / (2 * a1)) * pointBefore) / (2 * a1); + firstPart += (cd * exp((cd * rodLengths) / (2 * a1)) * topPosArray[s][iAfter] - cd * exp((-cd * rodLengths) / (2 * a1)) * topPosArray[s][iBefore]) / (4 * a1); + pumpLOAD = Y1 * A1 * (firstPart + pumpLOAD); + //printf("Load: %f\n", pumpLOAD); + return pumpLOAD; + }; + + public LPStatus calc(double sPosition, double sLoad){ + boolean useShift = false; + int loadMult = 1; + int tapersAllowed = 1; + double dPosition = 0; + double dLoad = 0; + int status = BAD_STATUS; + for (int ii = 1; ii < lengthRequired[1] + 1; ii++) + { + topPosArray[1][ii - 1] = topPosArray[1][ii]; + topLoadArray[1][ii - 1] = topLoadArray[1][ii]; + } + topPosArray[1][lengthRequired[1]] = -(sPosition / 12); //stores current position in feet + + if (sPosition > sPositionPrevious) + { + topLoadArray[1][lengthRequired[1]] = loadMult * (sLoad - rodWeightFluidTotal) - sbfriction; + } + else + { + topLoadArray[1][lengthRequired[1]] = loadMult * (sLoad - rodWeightFluidTotal) + sbfriction; + } + + int j = 1; + while (j <= tapersAllowed) + { + count[j]++; + if (count[j] >= lengthRequired[j]) + { + if ((j + 1) <= numTapers) + { + for (int jj = 2; jj < lengthRequired[j + 1] + 1; jj++) + { + topPosArray[j + 1][jj - 1] = topPosArray[j + 1][jj]; + topLoadArray[j + 1][jj - 1] = topLoadArray[j + 1][jj]; + } + topPosArray[j + 1][lengthRequired[j + 1]] = position(j); + topLoadArray[j + 1][lengthRequired[j + 1]] = load(j); + } + else + { + if (useShift) + { + dPosition = -12 * (position(j) + stretch[numTapers]); + } + else + { + dPosition = -12 * position(j); + } + dLoad = load(j) + force[numTapers]; + status = GOOD_STATUS; + } + count[j]--; + tapersAllowed += 1; + if (tapersAllowed > numTapers) + { + tapersAllowed = numTapers; + } + } + j++; + } + LPStatus downholeValues = new LPStatus(dPosition, dLoad, status); + return downholeValues; + }; + + public static void main( String[] args ){ + Well thisWell = new Well(); + thisWell.parseJSONFile(args[0]); + // thisWell.parseJSONFile("/Users/patrickjmcd/Henry_Pump/poc-java/wellSetup.json"); + thisWell.printTapers(); + } + + +} + + diff --git a/src/test/java/com/henrypump/poc/AppTest.java b/src/test/java/com/henrypump/poc/AppTest.java new file mode 100644 index 0000000..bfd1ff6 --- /dev/null +++ b/src/test/java/com/henrypump/poc/AppTest.java @@ -0,0 +1,38 @@ +package com.henrypump.poc; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} diff --git a/surface_data.csv b/surface_data.csv new file mode 100644 index 0000000..17b408d --- /dev/null +++ b/surface_data.csv @@ -0,0 +1,225 @@ +4.64,16672.381 +4.659,16737.803 +4.764,16782.326 +4.938,16840.232 +5.19,16883.494 +5.496,16923.469 +5.894,16959.471 +6.374,16989.896 +6.891,17013.334 +7.454,17029.477 +8.09,17039.424 +8.834,17045.361 +9.574,17049.744 +10.369,17054.877 +11.21,17062.381 +12.148,17072.83 +13.031,17086.168 +14.041,17102.182 +14.879,17121.842 +15.645,17147.896 +16.632,17185.137 +17.864,17239.094 +18.944,17313.938 +20.164,17410.57 +21.224,17525.693 +22.325,17652.646 +23.484,17783.574 +24.684,17911.789 +25.897,18033.344 +26.885,18147.111 +28.027,18253.877 +29.365,18355.057 +30.641,18451.98 +31.763,18545.645 +33.034,18636.889 +34.261,18726.482 +35.586,18815.236 +36.722,18903.488 +38.06,18991.074 +39.072,19077.174 +40.332,19160.645 +41.453,19240.619 +42.692,19317.031 +43.838,19390.963 +45.014,19464.404 +46.173,19539.668 +47.317,19618.697 +48.467,19702.682 +49.625,19792.195 +50.668,19887.719 +51.853,19989.891 +52.996,20099.311 +54.017,20215.732 +55.133,20337.32 +56.18,20460.592 +57.241,20580.904 +58.258,20693.855 +59.289,20796.635 +60.084,20888.838 +60.845,20972.051 +61.753,21049.012 +62.706,21122.16 +63.524,21192.703 +64.444,21260.172 +65.194,21322.939 +66.039,21378.824 +66.808,21425.791 +67.538,21462.459 +68.276,21488.197 +68.846,21503.113 +69.55,21507.861 +70.297,21503.383 +71.029,21491.074 +71.751,21472.383 +72.503,21448.83 +73.093,21421.699 +73.774,21391.834 +74.376,21359.457 +75.104,21324.482 +75.625,21286.799 +76.291,21246.74 +76.876,21205.303 +77.468,21163.947 +78.098,21124.252 +78.697,21087.281 +79.345,21053.406 +79.988,21022.221 +80.594,20993.033 +81.27,20965.166 +81.896,20938.434 +82.564,20913.268 +83.265,20890.604 +83.888,20871.619 +84.556,20857.477 +85.186,20849.084 +85.864,20846.957 +86.51,20851.316 +87.162,20862.129 +87.685,20879.09 +88.186,20901.73 +88.746,20929.258 +89.417,20960.771 +89.95,20995.289 +90.54,21031.992 +91.033,21070.367 +91.552,21110.191 +92.072,21151.301 +92.583,21193.346 +93.095,21235.52 +93.455,21276.723 +93.873,21315.705 +94.374,21351.379 +94.831,21383.021 +95.226,21410.303 +95.604,21433.039 +95.913,21451.074 +96.234,21464.061 +96.5,21471.564 +96.761,21472.99 +96.964,21468 +97.139,21456.709 +97.295,21439.631 +97.403,21418.006 +97.486,21398.451 +97.523,21367.055 +97.524,21340.041 +97.46,21317.926 +97.369,21283.129 +97.211,21251.475 +97.024,21223.736 +96.786,21185.479 +96.474,21133.533 +96.18,21084.486 +95.812,21029.443 +95.397,20968.041 +94.855,20900.678 +94.204,20869.2415 +93.553,20837.805 +92.915,20766.945 +92.15,20706.842 +91.541,20646.246 +90.705,20585.289 +89.986,20523.898 +89.115,20462.1 +88.422,20399.809 +87.494,20336.934 +86.655,20273.322 +85.803,20208.801 +84.822,20142.934 +83.874,20075.289 +82.799,20005.555 +81.743,19933.865 +80.603,19860.869 +79.471,19787.252 +78.329,19712.945 +77.192,19636.195 +75.934,19553.801 +74.894,19462.336 +73.566,19381.215 +72.402,19270.275 +71.108,19127.168 +69.83,19004.096 +68.522,18880.473 +67.462,18756.268 +66.519,18628.811 +65.277,18494.354 +63.888,18349.867 +62.604,18226.49 +61.243,18030.561 +60.041,17861.422 +58.685,17691.57 +57.462,17524.723 +56.186,17363.125 +54.861,17207.604 +53.747,17057.811 +52.697,16913.043 +51.434,16772.414 +49.993,16635.408 +48.743,16501.477 +47.351,16370.187 +46.177,16240.931 +44.689,16113.276 +43.5,15987.118 +42.148,15862.771 +41.034,15740.656 +39.706,15644.551 +38.486,15501.667 +37.293,15381.678 +36.021,15258.817 +34.801,15132.413 +33.599,15003.871 +32.437,14876.461 +31.236,14754.779 +29.983,14664.868 +28.794,14547.581 +27.592,14469.979 +26.408,14413.429 +25.314,14379.121 +24.097,14366.802 +23.017,14374.891 +21.85,14400.629 +20.739,14440.64 +19.554,14491.544 +18.633,14550.2 +17.751,14614.021 +16.773,14681.21 +15.64,14736.744 +14.741,14808.233 +13.679,14897.548 +12.78,14975.478 +11.935,15056.833 +11.048,15141.636 +10.209,15229.934 +9.408,15303.563 +8.798,15420.521 +8.123,15525.71 +7.458,15639.033 +6.831,15760.201 +6.347,15887.575 +5.87,16018.198 +5.502,16148.507 +5.211,16274.701 +4.961,16393.051 +4.784,16500.121 +4.662,16593.516 \ No newline at end of file diff --git a/target/classes/com/henrypump/poc/AnalogIn.class b/target/classes/com/henrypump/poc/AnalogIn.class new file mode 100644 index 0000000..b2f07f2 Binary files /dev/null and b/target/classes/com/henrypump/poc/AnalogIn.class differ diff --git a/target/classes/com/henrypump/poc/App.class b/target/classes/com/henrypump/poc/App.class new file mode 100644 index 0000000..047ccd3 Binary files /dev/null and b/target/classes/com/henrypump/poc/App.class differ diff --git a/target/classes/com/henrypump/poc/Card.class b/target/classes/com/henrypump/poc/Card.class new file mode 100644 index 0000000..9e57869 Binary files /dev/null and b/target/classes/com/henrypump/poc/Card.class differ diff --git a/target/classes/com/henrypump/poc/DigitalIn.class b/target/classes/com/henrypump/poc/DigitalIn.class new file mode 100644 index 0000000..082e196 Binary files /dev/null and b/target/classes/com/henrypump/poc/DigitalIn.class differ diff --git a/target/classes/com/henrypump/poc/DigitalOut.class b/target/classes/com/henrypump/poc/DigitalOut.class new file mode 100644 index 0000000..f533bfe Binary files /dev/null and b/target/classes/com/henrypump/poc/DigitalOut.class differ diff --git a/target/classes/com/henrypump/poc/LPPair.class b/target/classes/com/henrypump/poc/LPPair.class new file mode 100644 index 0000000..39b8a08 Binary files /dev/null and b/target/classes/com/henrypump/poc/LPPair.class differ diff --git a/target/classes/com/henrypump/poc/LPStatus.class b/target/classes/com/henrypump/poc/LPStatus.class new file mode 100644 index 0000000..df6e919 Binary files /dev/null and b/target/classes/com/henrypump/poc/LPStatus.class differ diff --git a/target/classes/com/henrypump/poc/POC.class b/target/classes/com/henrypump/poc/POC.class new file mode 100644 index 0000000..b15ac36 Binary files /dev/null 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 new file mode 100644 index 0000000..c669085 Binary files /dev/null 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 new file mode 100644 index 0000000..4fd0439 Binary files /dev/null and b/target/classes/com/henrypump/poc/Well.class differ diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties new file mode 100644 index 0000000..bc632cc --- /dev/null +++ b/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Wed Feb 01 14:16:23 CST 2017 +version=1.0-SNAPSHOT +groupId=com.henrypump.poc +artifactId=poc-java diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..a0eb504 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,10 @@ +com/henrypump/poc/LPPair.class +com/henrypump/poc/AnalogIn.class +com/henrypump/poc/Card.class +com/henrypump/poc/Simulation.class +com/henrypump/poc/DigitalIn.class +com/henrypump/poc/POC.class +com/henrypump/poc/App.class +com/henrypump/poc/Well.class +com/henrypump/poc/LPStatus.class +com/henrypump/poc/DigitalOut.class diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..3faf5db --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,10 @@ +/Users/patrickjmcd/Henry_Pump/poc-java/src/main/java/com/henrypump/poc/Well.java +/Users/patrickjmcd/Henry_Pump/poc-java/src/main/java/com/henrypump/poc/Simulation.java +/Users/patrickjmcd/Henry_Pump/poc-java/src/main/java/com/henrypump/poc/LPStatus.java +/Users/patrickjmcd/Henry_Pump/poc-java/src/main/java/com/henrypump/poc/AnalogIn.java +/Users/patrickjmcd/Henry_Pump/poc-java/src/main/java/com/henrypump/poc/LPPair.java +/Users/patrickjmcd/Henry_Pump/poc-java/src/main/java/com/henrypump/poc/App.java +/Users/patrickjmcd/Henry_Pump/poc-java/src/main/java/com/henrypump/poc/Card.java +/Users/patrickjmcd/Henry_Pump/poc-java/src/main/java/com/henrypump/poc/POC.java +/Users/patrickjmcd/Henry_Pump/poc-java/src/main/java/com/henrypump/poc/DigitalOut.java +/Users/patrickjmcd/Henry_Pump/poc-java/src/main/java/com/henrypump/poc/DigitalIn.java diff --git a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst new file mode 100644 index 0000000..c53cdd4 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst @@ -0,0 +1 @@ +com/henrypump/poc/AppTest.class diff --git a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst new file mode 100644 index 0000000..0c6111c --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst @@ -0,0 +1 @@ +/Users/patrickjmcd/Henry_Pump/poc-java/src/test/java/com/henrypump/poc/AppTest.java diff --git a/target/original-poc-java-1.0-SNAPSHOT.jar b/target/original-poc-java-1.0-SNAPSHOT.jar new file mode 100644 index 0000000..bae2bd9 Binary files /dev/null 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 new file mode 100644 index 0000000..4f47107 Binary files /dev/null and b/target/poc-java-1.0-SNAPSHOT.jar differ diff --git a/target/surefire-reports/TEST-com.henrypump.poc.AppTest.xml b/target/surefire-reports/TEST-com.henrypump.poc.AppTest.xml new file mode 100644 index 0000000..fbeefa1 --- /dev/null +++ b/target/surefire-reports/TEST-com.henrypump.poc.AppTest.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/surefire-reports/com.henrypump.poc.AppTest.txt b/target/surefire-reports/com.henrypump.poc.AppTest.txt new file mode 100644 index 0000000..17b617b --- /dev/null +++ b/target/surefire-reports/com.henrypump.poc.AppTest.txt @@ -0,0 +1,4 @@ +------------------------------------------------------------------------------- +Test set: com.henrypump.poc.AppTest +------------------------------------------------------------------------------- +Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006 sec diff --git a/target/test-classes/com/henrypump/poc/AppTest.class b/target/test-classes/com/henrypump/poc/AppTest.class new file mode 100644 index 0000000..50451dd Binary files /dev/null and b/target/test-classes/com/henrypump/poc/AppTest.class differ diff --git a/wellSetup.json b/wellSetup.json new file mode 100644 index 0000000..653fda3 --- /dev/null +++ b/wellSetup.json @@ -0,0 +1,25 @@ +{ + "deltaT": 0.06, + "pumpDiameter": 1.5, + "fluidGradient": 0.45, + "tubingID": 1.0, + "tubingOD": 1.225, + "tubingAnchorDepth": 8923.0, + "structuralRating": 320000.0, + "stuffingBoxFriction": 300.0, + "tubingHeadPressure": 200.0, + "tapers": [ + { + "length": 10095.0, + "diameter": 0.75, + "material": "steel", + "dampingFactor": 0.8 + }, + { + "length": 300.0, + "diameter": 1.5, + "material": "steel", + "dampingFactor": 0.8 + } + ] +}