From 80784376e0dbff8621d8900595fedf031419b7dc Mon Sep 17 00:00:00 2001 From: Patrick McDonagh Date: Thu, 6 Apr 2017 12:08:53 -0500 Subject: [PATCH] Bound fillage calculations to 0-100% --- .idea/kotlinc.xml | 7 + .idea/workspace.xml | 218 +++++++++++++++------- src/main/java/com/henrypump/poc/Card.java | 6 + 3 files changed, 168 insertions(+), 63 deletions(-) create mode 100644 .idea/kotlinc.xml diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml new file mode 100644 index 0000000..1c24f9a --- /dev/null +++ b/.idea/kotlinc.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 28abec5..ce70d94 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,9 +2,8 @@ - - - + + @@ -110,8 +109,8 @@ - - + + @@ -120,8 +119,8 @@ - - + + @@ -148,18 +147,20 @@ - + - + + + - + - - + + @@ -224,18 +225,24 @@ - - - + + + + + + + + + - + - + @@ -270,6 +277,73 @@ + + + + + + + + + + + + Displays the components produced by root project 'poc-java'. [incubating]<p><i>Task group: help<i> + Assembles and tests this project and all projects that depend on it.<p><i>Task group: build<i> + Displays the sub-projects of root project 'poc-java'.<p><i>Task group: help<i> + Generates IDEA project files (IML, IPR, IWS)<p><i>Task group: IDE<i> + Assembles main classes.<p><i>Task group: build<i> + <i>Task group: other<i> + Displays all buildscript dependencies declared in root project 'poc-java'.<p><i>Task group: help<i> + Generates Gradle wrapper files. [incubating]<p><i>Task group: Build Setup<i> + <i>Task group: other<i> + Assembles test classes.<p><i>Task group: build<i> + Generates Javadoc API documentation for the main source code.<p><i>Task group: documentation<i> + <i>Task group: other<i> + Assembles a jar archive containing the main classes.<p><i>Task group: build<i> + Displays the configuration model of root project 'poc-java'. [incubating]<p><i>Task group: help<i> + Generates IDEA module files (IML)<p><i>Task group: other<i> + Processes main resources.<p><i>Task group: other<i> + Displays the tasks runnable from root project 'poc-java'.<p><i>Task group: help<i> + Initializes a new Gradle build. [incubating]<p><i>Task group: Build Setup<i> + Cleans IDEA project files (IML, IPR)<p><i>Task group: IDE<i> + Generates an IDEA workspace file (IWS)<p><i>Task group: other<i> + Runs the unit tests.<p><i>Task group: verification<i> + Compiles main Java source.<p><i>Task group: other<i> + Displays the insight into a specific dependency in root project 'poc-java'.<p><i>Task group: help<i> + Runs all checks.<p><i>Task group: verification<i> + Assembles the outputs of this project.<p><i>Task group: build<i> + Deletes the build directory.<p><i>Task group: build<i> + Compiles test Java source.<p><i>Task group: other<i> + <i>Task group: other<i> + Displays all dependencies declared in root project 'poc-java'.<p><i>Task group: help<i> + Processes test resources.<p><i>Task group: other<i> + Displays a help message.<p><i>Task group: help<i> + <i>Task group: other<i> + Assembles and tests this project.<p><i>Task group: build<i> + Installs the 'archives' artifacts into the local Maven repository.<p><i>Task group: other<i> + Assembles and tests this project and all projects it depends on.<p><i>Task group: build<i> + <i>Task group: other<i> + <i>Task group: other<i> + Generates IDEA project file (IPR)<p><i>Task group: other<i> + Displays the properties of root project 'poc-java'.<p><i>Task group: help<i> + <i>Task group: other<i> + Configuration for archive artifacts. + Dependencies for source set 'main'. + Compile classpath for source set 'main'. + Compile dependencies for source set 'main'. + Configuration for default artifacts. + Runtime dependencies for source set 'main'. + Dependencies for source set 'test'. + Compile classpath for source set 'test'. + Compile dependencies for source set 'test'. + Runtime dependencies for source set 'test'. + + + + + + @@ -696,10 +770,9 @@ - @@ -717,7 +790,9 @@ + + @@ -772,8 +847,6 @@ - - @@ -784,6 +857,18 @@ + + + @@ -1057,7 +1142,7 @@ - + @@ -1066,7 +1151,7 @@ - + @@ -1074,7 +1159,7 @@ - + @@ -1096,7 +1181,7 @@ - + @@ -1115,8 +1200,8 @@ - - + + @@ -1404,7 +1489,6 @@ - @@ -1476,48 +1560,56 @@ - - - - - - - - - - - + + + + + + + + + - + - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/henrypump/poc/Card.java b/src/main/java/com/henrypump/poc/Card.java index fb6e5c3..276a733 100644 --- a/src/main/java/com/henrypump/poc/Card.java +++ b/src/main/java/com/henrypump/poc/Card.java @@ -366,9 +366,15 @@ public class Card { if (fillageEstimated > 100) fillageEstimated = 100.0; + if (fillageEstimated < 0.0) + fillageEstimated = 0.0; + if (fillageCalculated > 100) fillageCalculated = 100.0; + if (fillageCalculated < 0.0) + fillageCalculated = 0.0; + fluidLoad = downholeLoadSpan - frictionEstimate; pumpIntakePressure = fluidGradient * rodDepth - (fluidLoad / pumpArea); //printf("PIP = %f * %f - (%f / %f) = %f\n", fluidGradient, rodDepth, fluidLoad, pumpArea, pumpIntakePressure);