From 992866e602eb5e061fde30b24ebc1efaa00947c7 Mon Sep 17 00:00:00 2001 From: mickey Date: Fri, 22 Feb 2013 10:51:05 -0500 Subject: [PATCH] Bug fixed - Wall reaction coefficient variable in water quality simulation is explicitly defined and added since epanet uses the roughness resistance variable as it and caused some error in step wise calculation. --- src/quality.c | 4 ++-- src/types.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/quality.c b/src/quality.c index cf3a094..cacbbe9 100755 --- a/src/quality.c +++ b/src/quality.c @@ -1458,7 +1458,7 @@ void ratecoeffs() { kw = Link[k].Kw; if (kw != 0.0) kw = piperate(k); - Link[k].R = kw; + Link[k].Rc = kw; R[k] = 0.0; } } /* End of ratecoeffs */ @@ -1541,7 +1541,7 @@ double pipereact(int k, double c, double v, long dt) /* Otherwise find bulk & wall reaction rates */ rbulk = bulkrate(c,Link[k].Kb,BulkOrder)*Bucf; - rwall = wallrate(c,Link[k].Diam,Link[k].Kw,Link[k].R); + rwall = wallrate(c,Link[k].Diam,Link[k].Kw,Link[k].Rc); /* Find change in concentration over timestep */ dcbulk = rbulk*(double)dt; diff --git a/src/types.h b/src/types.h index 81fe7f1..3374f8f 100755 --- a/src/types.h +++ b/src/types.h @@ -208,6 +208,7 @@ typedef struct /* LINK OBJECT */ double Kb; /* Bulk react. coeff */ double Kw; /* Wall react. coeff */ double R; /* Flow resistance */ + double Rc; /* Reaction cal */ //woohn 2/11/13 char Type; /* Link type */ char Stat; /* Initial status */ char Rpt; /* Reporting flag */