Skip to content

Commit

Permalink
v484 - added additional units conversions (M. Chernos)
Browse files Browse the repository at this point in the history
  • Loading branch information
James Craig authored and James Craig committed Oct 28, 2024
1 parent 6580f1b commit ecbc931
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/DemandExpressionHandling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,10 @@ bool CDemandOptimizer::ConvertToExpressionTerm(const string s, expressionTerm* t
if (units == "CMS_TO_ACREFTD") {term->value=ACREFTD_PER_CMS; found=true;}
if (units == "INCHES_TO_MM" ) {term->value=MM_PER_INCH; found=true;}
if (units == "MM_TO_INCHES" ) {term->value=1.0/MM_PER_INCH; found=true;}
if (units == "FEET_TO_METER" ) {term->value=1.0/FEET_PER_METER; found=true;}
if (units == "METER_TO_FEET" ) {term->value=FEET_PER_METER; found=true;}
if (units == "CMS_TO_CFS" ) {term->value=1.0/CFS_PER_CMS; found=true;}
if (units == "CFS_TO_CMS" ) {term->value=CFS_PER_CMS; found=true;}
term->nested_exp1 =x_in;
term->type =TERM_CONVERT;
if (!found) {
Expand Down
1 change: 1 addition & 0 deletions src/RavenInclude.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ const double MJ_PER_M2_LANGLEY =0.04184;
const double INCH_PER_METER =39.37; ///< [m] to [in]
const double FEET_PER_METER =3.28; ///< [m] to [ft]
const double ACREFTD_PER_CMS =70.0456; ///< [acre-ft/d] to [m3/s]
const double CFS_PER_CMS =0.0283168; ///< [ft3/s] to [m3/s]
const double CDM_PER_DAY_PER_CMS =86.4; ///< [cdm/day] to [m3/s]
const double MPH_PER_KPH =1.609; ///< [kph] to [mph]
const double MPH_PER_MPS =2.237; ///< [m/s] to [mph]
Expand Down

0 comments on commit ecbc931

Please sign in to comment.