@@ -1,4 +1,43 @@ |
<?xml version="1.0" encoding="UTF-8"?> |
+<!-- |
+DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
+ |
+Copyright (c) 2006, 2016 Oracle and/or its affiliates. All rights reserved. |
+ |
+Oracle and Java are registered trademarks of Oracle and/or its affiliates. |
+Other names may be trademarks of their respective owners. |
+ |
+The contents of this file are subject to the terms of either the GNU |
+General Public License Version 2 only ("GPL") or the Common |
+Development and Distribution License("CDDL") (collectively, the |
+"License"). You may not use this file except in compliance with the |
+License. You can obtain a copy of the License at |
+http://www.netbeans.org/cddl-gplv2.html |
+or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the |
+specific language governing permissions and limitations under the |
+License. When distributing the software, include this License Header |
+Notice in each file and include the License file at |
+nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this |
+particular file as subject to the "Classpath" exception as provided |
+by Oracle in the GPL Version 2 section of the License file that |
+accompanied this code. If applicable, add the following below the |
+License Header, with the fields enclosed by brackets [] replaced by |
+your own identifying information: |
+"Portions Copyrighted [year] [name of copyright owner]" |
+ |
+If you wish your version of this file to be governed by only the CDDL |
+or only the GPL Version 2, indicate your decision by adding |
+"[Contributor] elects to include this software in this distribution |
+under the [CDDL or GPL Version 2] license." If you do not indicate a |
+single choice of license, a recipient has the option to distribute |
+your version of this file under either the CDDL, the GPL Version 2 or |
+to extend the choice of license to its licensees as provided above. |
+However, if you add GPL Version 2 code and therefore, elected the GPL |
+Version 2 license, then the option applies only if the new code is |
+made subject to such option by the copyright holder. |
+ |
+Contributor(s): |
+--> |
<project default="-deploy-ant" basedir="."> |
<target name="-init" if="deploy.ant.enabled"> |
<property file="${deploy.ant.properties.file}"/> |
@@ -16,7 +55,7 @@ |
<isset property="tomcat.password"/> |
</not> |
</condition> |
- </fail> |
+ </fail> |
</target> |
<target name="-deploy-ant" if="deploy.ant.enabled" depends="-init,-check-credentials"> |
<echo message="Deploying ${deploy.ant.archive} to ${Context(path)}"/> |
@@ -4,7 +4,7 @@ |
import java.util.ArrayList; |
|
/** |
-* Last Updated: 5-February-2016 |
+* Last Updated: 3-May-2017 |
* @author Tyler Wible |
* @since 1-August-2014 |
*/ |
@@ -31,6 +31,7 @@ |
double topWidth = -1; |
double hydraulicRadius = -1; |
double hydraulicDepth = -1; |
+ double normalDischarge = -1; |
String warningMessage = "?"; |
|
//Gets |
@@ -52,6 +53,9 @@ |
public double getHydraulicDepth(){ |
return hydraulicDepth; |
} |
+ public double getNormalDischarge(){ |
+ return normalDischarge; |
+ } |
public String getWarningMessage(){ |
return warningMessage; |
} |
@@ -60,7 +64,7 @@ |
public void setDepthType(String depthType){ |
this.depthType = depthType; |
} |
- public void setGeometryType(boolean irregularGeometry){ |
+ public void setIrregularGeometryTF(boolean irregularGeometry){ |
this.irregularGeometry = irregularGeometry; |
} |
public void setDepth(double depth){ |
@@ -485,7 +489,7 @@ |
if(irregularGeometry){ |
//Calculate discharge using Manning's equation (in metric) for a "irregular" cross-section (list of xy points) |
ChannelGeometry geo = new ChannelGeometry(); |
- geo.setGeometryType(false); |
+ geo.setIrregularGeometryTF(true); |
geo.setDepth(guessDepth); |
geo.setCrossSection(crossSection); |
|
@@ -498,7 +502,7 @@ |
}else{ |
//Calculate discharge using Manning's equation (in metric) for a "regular" cross-section (trapezoid, triangle, rectangle) |
ChannelGeometry geo = new ChannelGeometry(); |
- geo.setGeometryType(true); |
+ geo.setIrregularGeometryTF(false); |
geo.setDepth(guessDepth); |
geo.setBottomWidth(bottomWidth); |
geo.setSideSlope(sideSlope); |
@@ -525,6 +529,43 @@ |
return guessDepth; |
} |
/** |
+ * Calculates normal discharge based on Manning's equation for a regular or |
+ * irregular cross-section geometry based on the provided depth and |
+ * **currently not used but useful for future development** |
+ * channel cross-section |
+ * @return the discharge for the provided depth and cross-section |
+ * @throws IOException |
+ */ |
+ public double calcNormalDischarge() throws IOException{ |
+ double Q_manning = -1; |
+ if(irregularGeometry){ |
+ //Calculate discharge using Manning's equation (in metric) for a "irregular" cross-section (list of xy points) |
+ ChannelGeometry geo = new ChannelGeometry(); |
+ geo.setIrregularGeometryTF(true); |
+ geo.setDepth(depth); |
+ geo.setCrossSection(crossSection); |
+ |
+ //Calculate discharge using Manning's equation (in metric) |
+ double A = geo.calcIrregularArea(); |
+ double R = geo.calcIrregularHydraulicRadius(); |
+ Q_manning = (1./n) * A * Math.pow(R, 2./3.) * Math.sqrt(bedSlope); |
+ |
+ }else{ |
+ //Calculate discharge using Manning's equation (in metric) for a "regular" cross-section (trapezoid, triangle, rectangle) |
+ ChannelGeometry geo = new ChannelGeometry(); |
+ geo.setIrregularGeometryTF(false); |
+ geo.setDepth(depth); |
+ geo.setBottomWidth(bottomWidth); |
+ geo.setSideSlope(sideSlope); |
+ |
+ //Calculate discharge using Manning's equation (in metric) |
+ double A = geo.calcTrapezoidalArea(); |
+ double R = geo.calcTrapezoidalHydraulicRadius(); |
+ Q_manning = (1./n) * A * Math.pow(R, 2./3.) * Math.sqrt(bedSlope); |
+ } |
+ return Q_manning; |
+ } |
+ /** |
* Calculates critical depth based Froude Number set equal 1 (critical open |
* channel flow) for a regular or irregular cross-section geometry based on |
* the provided discharge and channel cross-section |
@@ -546,7 +587,7 @@ |
if(irregularGeometry){ |
//Calculate Froude number (in metric) for a "irregular" cross-section (list of xy points) |
ChannelGeometry geo = new ChannelGeometry(); |
- geo.setGeometryType(false); |
+ geo.setIrregularGeometryTF(true); |
geo.setDepth(guessDepth); |
geo.setCrossSection(crossSection); |
|
@@ -559,7 +600,7 @@ |
}else{ |
//Calculate Froude number (in metric) for a "regular" cross-section (trapezoid, triangle, rectangle) |
ChannelGeometry geo = new ChannelGeometry(); |
- geo.setGeometryType(true); |
+ geo.setIrregularGeometryTF(false); |
geo.setDepth(guessDepth); |
geo.setBottomWidth(bottomWidth); |
geo.setSideSlope(sideSlope); |