From e0582a8bff4cd38b1feb4acfa82806d90f4fbbd9 Mon Sep 17 00:00:00 2001 From: yuniersoad Date: Tue, 14 May 2013 19:38:40 +0000 Subject: [PATCH] Fixing conversion error in ENgetnodevalue EN_TANKDIAM The Tank.A(area) is calculated as: Tank[j].A = PI*SQR(Tank[j].A/Ucf[ELEV])/4.0; //diameter is stored in Tank[j].A so the right equation to get the diameter back is sqrt(4.0/PI*Tank[index-Njuncs].A)*Ucf[ELEV]; --- src/epanet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/epanet.c b/src/epanet.c index 34e8d53..69095a4 100755 --- a/src/epanet.c +++ b/src/epanet.c @@ -1460,7 +1460,7 @@ int DLLEXPORT ENgetnodevalue(int index, int code, float *value) v = 0.0; if ( index > Njuncs ) { - v = 4.0/PI*sqrt(Tank[index-Njuncs].A)*Ucf[ELEV]; + v = sqrt(4.0/PI*Tank[index-Njuncs].A)*Ucf[ELEV]; } break;