Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ gradle/*
gradlew
gradlew.bat

# Ignore test output
resources/Output/**


# Ignore Gradle GUI config
gradle-app.setting

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* GNU GPL v3 License
*
* Copyright 2021 Niccol� Tubini, Giuseppe Formetta, Riccardo Rigon
* Copyright 2021 Niccol� Tubini, Giuseppe Formetta, Riccardo Rigon
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -20,14 +20,15 @@
package it.geoframe.blogspot.geoframenewage.dam;

/**
* @author Niccol� Tubini, Giuseppe Formetta
* @author Niccol� Tubini, Giuseppe Formetta
*
*/
public class WeirDischarge {

double weirCoefficient;
double weirWidth;
double weirHeight;
double exponent = 3.0/2.0;

public WeirDischarge(double weirCoefficient, double weirWidth, double weirHeight) {

Expand All @@ -45,7 +46,7 @@ public double computeDischarge(double level) {

} else {

return weirCoefficient*weirWidth*Math.sqrt(2*9.81)*Math.pow(level-weirHeight, 3/2);
return weirCoefficient*weirWidth*Math.sqrt(2*9.81)*Math.pow(level-weirHeight, exponent);

}

Expand All @@ -59,7 +60,7 @@ public double computeDerivativeDischarge(double level) {

} else {

return 3/2*weirCoefficient*weirWidth*Math.sqrt(2*9.81)*Math.pow(level-weirHeight, 3/2-1);
return exponent*weirCoefficient*weirWidth*Math.sqrt(2*9.81)*Math.pow(level-weirHeight, exponent-1.0);

}

Expand Down