Skip to content
Closed
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
3 changes: 3 additions & 0 deletions .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@ Makefile
# Runtime artifacts
Raven
Raven_errors.txt

# Directories
test/
321 changes: 230 additions & 91 deletions src/EnergyTransport.cpp
100644 → 100755

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/Makefile
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ LDFLAGS :=
CXXFLAGS += -std=c++11 -fPIC

# OPTION 1) include netcdf - uncomment following two commands (assumes netCDF path = /usr/local):
#CXXFLAGS += -Dnetcdf
#LDLIBS += -L/usr/local -lnetcdf
CXXFLAGS += -Dnetcdf
LDLIBS += -L/usr/local -lnetcdf

# OPTION 2) include lp_solve for water management optimization- uncomment following two commands (assumes liblpsolve55.a in ../lib/lp_solve_unix/ folder):
CXXFLAGS += -D_LPSOLVE_
LDLIBS += -L../lib/lp_solve_unix -llpsolve55
#CXXFLAGS += -D_LPSOLVE_
#LDLIBS += -L../lib/lp_solve_unix -llpsolve55

# OPTION 3) if you use a OSX/BSD system, uncomment the LDFLAGS line below
# this is to allow for use a 1Gb stack, see http://linuxtoosx.blogspot.ca/2010/10/stack-overflow-increasing-stack-limit.html
Expand Down
20 changes: 19 additions & 1 deletion src/Reservoir.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void CReservoir::BaseConstructor(const string Name,const long SubID)
_SBID=SubID;

_pDownSB=NULL;

_mixing_depth=5.0;
_lakebed_thick=1.0;
_lakebed_cond =0.0;
_lake_convcoeff=2.0;
Expand Down Expand Up @@ -403,6 +403,14 @@ long CReservoir::GetSubbasinID () const { return _SBID; }
//
double CReservoir::GetStorage () const { return GetVolume(_stage); }

/// \returns reservoir hypoliminion storage [m3]
//
double CReservoir::GetHypolimnionStorage () const { return GetVolume(_stage-_mixing_depth); }

/// \returns reservoir old hypoliminion storage [m3]
//
double CReservoir::GetOldHypolimnionStorage () const { return GetVolume(_stage_last-_mixing_depth); }

//////////////////////////////////////////////////////////////////
/// \returns current stage [m]
//
Expand Down Expand Up @@ -449,6 +457,16 @@ double CReservoir::GetSurfaceArea () const { return GetArea(_stage); }
//
double CReservoir::GetOldSurfaceArea () const { return GetArea(_stage_last); }

//////////////////////////////////////////////////////////////////
/// \returns current mixing area [m2]
//
double CReservoir::GetMixingArea () const { return GetArea(_stage-_mixing_depth); }

//////////////////////////////////////////////////////////////////
/// \returns current old mixing area [m2]
//
double CReservoir::GetOldMixingArea () const { return GetArea(_stage_last-_mixing_depth); }

//////////////////////////////////////////////////////////////////
/// \returns lakebed thickness [m]
//
Expand Down
5 changes: 5 additions & 0 deletions src/Reservoir.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class CReservoir
string _name; ///< reservoir name
long _SBID; ///< subbasin ID
double _max_capacity; ///< maximum reservoir capacity [m3]
double _mixing_depth;

double _lakebed_thick; ///< lakebed thickness [m]
double _lakebed_cond; ///< lakebed thermal conductivity [MJ/m/K/d]
Expand Down Expand Up @@ -178,6 +179,8 @@ class CReservoir

double GetStorage () const; //[m3]
double GetOldStorage () const; //[m3]
double GetHypolimnionStorage () const; //[m3]
double GetOldHypolimnionStorage () const; //[m3]
double GetOutflowRate () const; //[m3/s]
double GetOldOutflowRate () const; //[m3/s]
double GetIntegratedOutflow (const double &tstep) const; //[m3]
Expand All @@ -191,6 +194,8 @@ class CReservoir
double GetOldStage () const; //[m]
double GetSurfaceArea () const; //[m2]
double GetOldSurfaceArea () const; //[m2]
double GetMixingArea () const; //[m2]
double GetOldMixingArea () const; //[m2]
double GetLakebedThickness () const; //[m]
double GetLakebedConductivity () const; //[MJ/m/K/d]
double GetLakeConvectionCoeff () const; //[MJ/m2/d/K]
Expand Down
5 changes: 5 additions & 0 deletions src/Transport.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ class CConstituentModel
double *_aMout_res; ///< array storing reservoir mass outflow [mg/d] or heat loss [MJ/d] [size: nSubBasins]
double *_aMout_res_last; ///< array storing reservoir mass outflow [mg/d] or enthalpy outflow [MJ/d] at start of timestep [size: nSubBasins]
double *_aMresRain; ///< array storing reservoir rain inputs [mg/d] or enthalpy input [MJ/d] [size: nSubBasins]

double *_aMres_epo; ///< array used for storing epolimnion layer masses [mg] or enthalpy [MJ] [size: nSubBasins]
double *_aMres_epo_last; ///< array used for storing epolimnion layer masses [mg] at start of timestep [size: nSubBasins]
double *_aMres_hyp; ///< array used for storing hypolimnion layer masses [mg] or enthalpy [MJ] [size: nSubBasins]
double *_aMres_hyp_last; ///< array used for storing hypolimnion layer masses [mg] at start of timestep [size: nSubBasins]

// Mass balance tracking variables
double *_channel_storage; ///< array storing channel storage [mg] or [MJ] [size: nSubBasins]
Expand Down
Loading