Skip to content

Commit

Permalink
uncomplicate
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Jan 8, 2025
1 parent 26629b9 commit 3dfa918
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/omaloon/math/OlMath.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ public class OlMath {
*
* returns the amount of fluid in liquid units that passes through the area over a certain time.
*/
public static float bernoulliFlowRate(float area, float pressureStart, float pressureEnd, float density, float time) {
float diff = -2f * (pressureEnd - pressureStart);
if (diff == 0) return 0f;
return (area * (diff/Math.abs(diff)) * Mathf.sqrt(Math.abs(diff) / density) * time * density)/(60f);
public static float bernoulliFlowRate(float opening, float pressureStart, float pressureEnd, float density) {
return opening * (pressureEnd - pressureStart) / density;
}
// TODO rename
}

0 comments on commit 3dfa918

Please sign in to comment.