Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addresses Issue #70 -- Constants precision nits #190

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
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
6 changes: 3 additions & 3 deletions src/solver/lid.c
Original file line number Diff line number Diff line change
Expand Up @@ -1041,22 +1041,22 @@ void validateLidProc(int j)
report_writeErrorMsg(ERR_LID_PARAMS, Msg);
}
else LidProcs[j].surface.alpha =
1.49 * sqrt(LidProcs[j].surface.surfSlope) /
PHI * sqrt(LidProcs[j].surface.surfSlope) /
LidProcs[j].surface.roughness;
}
else
{
//... compute surface overland flow coeff.
if ( LidProcs[j].surface.roughness > 0.0 )
LidProcs[j].surface.alpha = 1.49 / LidProcs[j].surface.roughness *
LidProcs[j].surface.alpha = PHI / LidProcs[j].surface.roughness *
sqrt(LidProcs[j].surface.surfSlope);
else LidProcs[j].surface.alpha = 0.0;
}

//... compute drainage mat layer's flow coeff.
if ( LidProcs[j].drainMat.roughness > 0.0 )
{
LidProcs[j].drainMat.alpha = 1.49 / LidProcs[j].drainMat.roughness *
LidProcs[j].drainMat.alpha = PHI / LidProcs[j].drainMat.roughness *
sqrt(LidProcs[j].surface.surfSlope);
}
else LidProcs[j].drainMat.alpha = 0.0;
Expand Down
2 changes: 1 addition & 1 deletion src/solver/link.c
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,7 @@ void conduit_validate(int j, int k)
// (factor of 0.3 is for circular pipe 95% full)
// NOTE: this factor was used in the past for a modified version of
// Kinematic Wave routing but is now deprecated.
aa = Conduit[k].beta / sqrt(32.2) *
aa = Conduit[k].beta / sqrt(GRAVITY) *
pow(Link[j].xsect.yFull, 0.1666667) * 0.3;
if ( aa >= 1.0 ) Conduit[k].superCritical = TRUE;
else Conduit[k].superCritical = FALSE;
Expand Down
3 changes: 1 addition & 2 deletions src/solver/subcatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
//-----------------------------------------------------------------------------
// Constants
//-----------------------------------------------------------------------------
const double MCOEFF = 1.49; // constant in Manning Eq.
const double MEXP = 1.6666667; // exponent in Manning Eq.
const double ODETOL = 0.0001; // acceptable error for ODE solver

Expand Down Expand Up @@ -403,7 +402,7 @@ void subcatch_validate(int j)

if ( area > 0.0 && Subcatch[j].subArea[i].N > 0.0 )
{
Subcatch[j].subArea[i].alpha = MCOEFF * Subcatch[j].width / area *
Subcatch[j].subArea[i].alpha = PHI * Subcatch[j].width / area *
sqrt(Subcatch[j].slope) / Subcatch[j].subArea[i].N;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/solver/transect.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ void getGeometry(TTransect *transect, int i, double y)
if ( aSum == 0.0 )
transect->hradTbl[i] = transect->hradTbl[i-1];
else
transect->hradTbl[i] = pow(qSum * Nchannel / 1.49 / aSum, 1.5);
transect->hradTbl[i] = pow(qSum * Nchannel / PHI / aSum, 1.5);
}

//=============================================================================
Expand Down
Loading