diff --git a/src/specificClass.js b/src/specificClass.js index 52c02ea..e93e0c5 100644 --- a/src/specificClass.js +++ b/src/specificClass.js @@ -120,9 +120,13 @@ class pumpingStation { this.logger.debug(`Using temperature: ${kelvinTemp} K for calculations`); const density = coolprop.PropsSI('D','T',kelvinTemp,'P',101325,'Water'); //density in kg/m3 at temp and surface pressure const g = 9.80665; + const pressure_Pa = this.measurements.type("pressure").variant("measured").position(position).getCurrentValue('Pa'); + const level = pressure_Pa / density * g; + + this.measurements.type("level").variant("predicted").position(position).value(level); //calculate how muc flow went in or out based on pressure difference - this.logger.debug(`Using pressure: ${pressure} for calculations`); + this.logger.debug(`Using pressure: ${value} for calculations`); } initBasinProperties() {