Package hec.rss.model

Class Storage

All Implemented Interfaces:
AsciiSerializable, FieldAccessor, TSLocation, AltInputReportInfc, RssModelVariableConstants, RssReturnStatusConstants, RssTSLocation, Serializable, Cloneable, Comparable, Observer, rma.lang.Modifiable

public class Storage extends Continuity implements AltInputReportInfc
See Also:
  • Field Details

    • KNOWN_STORAGE_CONST

      public static final int KNOWN_STORAGE_CONST
      Lookback Condition: Specified Constant Storage
      See Also:
    • KNOWN_STORAGE_TS

      public static final int KNOWN_STORAGE_TS
      Lookback Condition: Specified Storage Time Series
      See Also:
    • KNOWN_ELEVATION_CONST

      public static final int KNOWN_ELEVATION_CONST
      Lookback Condition: Specified Constant Elevation
      See Also:
    • KNOWN_ELEVATION_TS

      public static final int KNOWN_ELEVATION_TS
      Lookback Condition: Specified Elevation Time Series
      See Also:
    • KNOWN_GUIDECURVE

      public static final int KNOWN_GUIDECURVE
      Lookback Condition: Storage and Elevation set to Guide Curve
      See Also:
    • KNOWN_ELEV_FREL_CON

      public static final int KNOWN_ELEV_FREL_CON
      Lookback Condition: Elevation is calculated from Inflow and Outflow except on the first time step is set to the Specified Constant
      See Also:
    • KNOWN_ELEV_FREL_TS

      public static final int KNOWN_ELEV_FREL_TS
      Lookback Condition: Elevation is calculated from Inflow and Outflow except on the first time step is set to the Specified Time Series Value
      See Also:
    • KNOWN_STOR_FREL_CON

      public static final int KNOWN_STOR_FREL_CON
      Lookback Condition: Storage is calculated from Inflow and Outflow except on the first time step is set to the Specified Constant
      See Also:
    • KNOWN_STOR_FREL_TS

      public static final int KNOWN_STOR_FREL_TS
      Lookback Condition: Storage is calculated from Inflow and Outflow except on the first time step is set to the Specified Time Series Value
      See Also:
    • KNOWN_FREL_GC

      public static final int KNOWN_FREL_GC
      Lookback Condition: Storage and Elevation are calculated from Inflow and Outflow except on the first time step they are set to the Guide Curve Value
      See Also:
    • FIRST_HINDCAST_COND

      public static final int FIRST_HINDCAST_COND
      See Also:
    • LAST_HINDCAST_COND

      public static final int LAST_HINDCAST_COND
      See Also:
    • SEEPAGE_NONE

      public static final int SEEPAGE_NONE
      See Also:
    • SEEPAGE_CONST

      public static final int SEEPAGE_CONST
      See Also:
    • SEEPAGE_FUNC

      public static final int SEEPAGE_FUNC
      See Also:
    • EVAP_NONE

      public static final int EVAP_NONE
      See Also:
    • EVAP_MONTHLY

      public static final int EVAP_MONTHLY
      See Also:
    • EVAP_TS

      public static final int EVAP_TS
      See Also:
    • DAYS_PER_MONTH

      public static final int[] DAYS_PER_MONTH
    • DSDT_TO_Q_ENGLISH

      public static final double DSDT_TO_Q_ENGLISH
      See Also:
    • DSDT_TO_Q_SI

      public static final double DSDT_TO_Q_SI
      See Also:
    • DSDT_TO_Q

      public static double DSDT_TO_Q
    • AREA_CONV_ENGLISH

      public static double AREA_CONV_ENGLISH
    • AREA_CONV_SI

      public static double AREA_CONV_SI
    • AREA_CONV

      public static double AREA_CONV
    • EVAPLEN_CONV_ENGLISH

      public static double EVAPLEN_CONV_ENGLISH
    • EVAPLEN_CONV_SI

      public static double EVAPLEN_CONV_SI
    • EVAPLEN_CONV

      public static double EVAPLEN_CONV
  • Constructor Details

    • Storage

      public Storage()
    • Storage

      public Storage(Element elem)
  • Method Details

    • initTSVals

      protected void initTSVals(int istep)
      set estimated values for un-initialized time series variables at the given time step. Must be called from within RssSystem.compute after initialization of forecast.
      Overrides:
      initTSVals in class Function
      Parameters:
      istep -
    • getPreviousElevationEst33

      public double getPreviousElevationEst33(RunTimeStep rts)
    • getElevationEst33

      public double getElevationEst33(RunTimeStep rts)
    • getPreviousOutflowEst33

      public double getPreviousOutflowEst33(RunTimeStep rts)
    • getOutflowEst33

      public double getOutflowEst33(RunTimeStep rts)
    • getEvapSeepVol

      public double getEvapSeepVol(RunTimeStep rts)
      return the total local flow volume for the given time step
      Parameters:
      rts -
      Returns:
    • getElevationEst

      public double getElevationEst(RunTimeStep rts)
      get the most recent elevation estimate for the given time step Must be called after initForecast(), never call with a null argument for rts!
      Parameters:
      rts -
      Returns:
      elevation in ft or m
    • setPumpVol

      public void setPumpVol(RunTimeStep rts, double pumpvol, double pumpvolcap)
    • incrementPumpVolume

      public double incrementPumpVolume(RunTimeStep rts, double vol)
      increment the reservoir storage by given amount and update elevation, returns the actual change in storage
      Parameters:
      rts -
      vol -
      Returns:
    • incrementPumpVolumeCap

      public void incrementPumpVolumeCap(RunTimeStep rts, double cap)
    • isNodeComputed

      public boolean isNodeComputed(int iorder, RssNode node, Integer idir)
      returns true if node is computed by the function, the storage function does not compute the flow at any node so it is always false
      Overrides:
      isNodeComputed in class Function
      Parameters:
      iorder - index of node in element vector
      node - node object
      idir - integer indicating whether node is inflow or outflow
      Returns:
      true if computed, else false
    • cleanupFromDeSerialization

      public void cleanupFromDeSerialization()
      Overrides:
      cleanupFromDeSerialization in class Function
    • setupForSerialization

      public void setupForSerialization()
      Called just before ascii serialization. Prepares the paired data values by setting there dss record path names
      Overrides:
      setupForSerialization in class Function
    • getHindcastDataList

      public void getHindcastDataList(Vector hvec)
      Description copied from class: Function
      Default implementation of getHindcastDataList does not add any records to the list. This method is overriden in specific functions that require hindcast data.
      Overrides:
      getHindcastDataList in class Function
    • computesEvaporation

      public boolean computesEvaporation()
    • setComputesEvaporation

      public void setComputesEvaporation(boolean b)
    • computesSeepage

      public boolean computesSeepage()
    • setComputesSeepage

      public void setComputesSeepage(boolean b)
    • useConicInterpolation

      public boolean useConicInterpolation()
    • setUseConicInterpolation

      public void setUseConicInterpolation(boolean b)
    • setInitialConicDepth

      public void setInitialConicDepth(hec.data.ParamDouble pd)
      initial conic depth for below first elevation for conic interpolation. This value is not necessarily required for conic interpolation
    • setInitialConicDepth

      public void setInitialConicDepth(double val)
    • getInitialConicDepth

      public void getInitialConicDepth(hec.data.ParamDouble pd)
    • getInitialConicDepth

      public double getInitialConicDepth()
    • setFirstStorageValue

      public void setFirstStorageValue(hec.data.ParamDouble pd)
      storage below first elevation for conic interpolation
    • setFirstStorageValue

      public void setFirstStorageValue(double val)
    • getFirstStorageValue

      public void getFirstStorageValue(hec.data.ParamDouble pd)
    • getFirstStorageValue

      public double getFirstStorageValue()
    • clone

      public Object clone()
      Description copied from class: Function
      clone method
      Overrides:
      clone in class Function
    • isInstantaneousInput

      public boolean isInstantaneousInput()
      utility to see if computations are based on instantaneous flows or period average flows
    • initElevStorAndElevAreaPV

      public void initElevStorAndElevAreaPV()
      Fill elevation storage and elevation area transient PairedValues data from conic storage or CapacityVector
    • applyHindcastData

      public void applyHindcastData(HindcastData hd)
      applies specific hindcast data for compute
      Overrides:
      applyHindcastData in class Function
    • getActiveTSProxies

      public Vector getActiveTSProxies(Vector vec, int iotype)
      returns a vector of required input, or generated output TSRecordProxies used in the current alternative default implementation function, assume all records are active
      Overrides:
      getActiveTSProxies in class Function
    • updateTSProxyList

      public void updateTSProxyList()
      regenerates the list of all TSProxies required for this location This list includes all records that are generated by this function even if the records are held in another objects (e.g. RssNode) proxy list
      Overrides:
      updateTSProxyList in class Function
    • getTSRecordProxies

      public Vector getTSRecordProxies()
      override Function method to only return elevation or storage proxies as required
      Overrides:
      getTSRecordProxies in class RssTSLocationObject
    • getComputedTSRecordProxies

      public Vector getComputedTSRecordProxies(Vector v)
      returns a vector of computed ts record proxies assuming the downstream flow is computed overrides method in Function class
      Overrides:
      getComputedTSRecordProxies in class Function
    • getElevationArray

      public double[] getElevationArray()
      returns the elevation time series array
    • getElevation

      public double getElevation(RunTimeStep time)
      returns the elevation value at the given time (assumes that elevation has already been computed)
    • getStorage

      public double getStorage(RunTimeStep time)
      returns the storage value at the given time (assumes that storage has already been computed)
    • getMaxStorage

      public double getMaxStorage()
      returns the full storage value
    • getMinStorage

      public double getMinStorage()
      returns the empty storage value
    • calcEvapFlow

      public double calcEvapFlow(RunTimeStep runtime)
      calc evaporation flow in cfs or cms based on averaged elevation over time step
    • calcEvapFlow

      public double calcEvapFlow(RunTimeStep runtime, double elev0, double elev1, boolean saveTS)
      calculate evaporation in cfs/cms for specified start and end elevation
    • hasEvap

      public boolean hasEvap()
    • getMonthlyEvap

      public double[] getMonthlyEvap()
    • setMonthlyEvap

      public boolean setMonthlyEvap(double[] e)
    • getEvapType

      public int getEvapType()
    • setEvapType

      public boolean setEvapType(int cond)
    • getEvapArray

      public double[] getEvapArray()
      returns the evaporation time series array, may return null
    • getSeepArray

      public double[] getSeepArray()
      returns the seepage time series array
    • getSpillArray

      public double[] getSpillArray()
    • calcSeepageFlow

      public double calcSeepageFlow(RunTimeStep runtime)
      calc seepage flow in cfs or cms based on averaged elevation over time step
    • calcSeepageFlow

      public double calcSeepageFlow(RunTimeStep runtime, double prevElev, double elev, boolean saveTS)
    • hasSeepage

      public boolean hasSeepage()
    • getConstSeepage

      public void getConstSeepage(hec.data.ParamDouble pd)
    • setConstSeepage

      public void setConstSeepage(hec.data.ParamDouble pd)
    • getConstSeepage

      public double getConstSeepage()
    • setConstSeepage

      public void setConstSeepage(double s)
    • getSeepageValues

      public PairedValues getSeepageValues()
    • setSeepageValues

      public void setSeepageValues(PairedValues e)
    • getElevationStorageValues

      public PairedValues getElevationStorageValues()
    • getElevationAreaValues

      public PairedValues getElevationAreaValues()
    • setCapacityValues

      public void setCapacityValues(PairedValues stor, PairedValues area)
    • getSeepageType

      public int getSeepageType()
    • setSeepageType

      public boolean setSeepageType(int cond)
    • getInitialStorage

      public double getInitialStorage()
    • setInitialStorage

      public void setInitialStorage(double s)
    • getInitialElevation

      public double getInitialElevation()
    • setInitialElevation

      public void setInitialElevation(double e)
    • getHindcastCondition

      public int getHindcastCondition()
    • setHindcastCondition

      public boolean setHindcastCondition(int cond)
    • getPreviousStorage

      public double getPreviousStorage(RunTimeStep rts)
    • getPreviousElevation

      public double getPreviousElevation(RunTimeStep rts)
    • getInflowVolume

      public double getInflowVolume(RunTimeStep rts)
      return the total reservoir inflow volume for the given time step assuming that the inflow has already been calculated
      Parameters:
      rts -
      Returns:
    • getNetInflowVolume

      public double getNetInflowVolume(RunTimeStep rts)
      return the total reservoir inflow volume for the given time step assuming that the inflow has already been calculated
      Parameters:
      rts -
      Returns:
    • getOutflowVolume

      public double getOutflowVolume(RunTimeStep rts)
      return the total reservoir inflow volume for the given time step assuming that the inflow has already been calculated
      Parameters:
      rts -
      Returns:
    • getInflow

      public double getInflow(RunTimeStep rts)
      return the total reservoir inflow for the given time step
      Parameters:
      rts -
      Returns:
    • getNetInflow

      public double getNetInflow(RunTimeStep rts)
    • getPreviousNetInflow

      public double getPreviousNetInflow(RunTimeStep rts)
    • getPreviousOutflow

      public double getPreviousOutflow(RunTimeStep rts)
    • getOutflow

      public double getOutflow(RunTimeStep rts)
    • getPumpbackFlow

      public double getPumpbackFlow(RunTimeStep rts)
    • getNetInflowArray

      public double[] getNetInflowArray()
      returns the net inflow time series array
    • getOutflowArray

      public double[] getOutflowArray()
    • getCapacityVector

      public Vector getCapacityVector()
    • addCapacityRecord

      public void addCapacityRecord(CapacityRecord cr)
    • emptyCapacityVector

      public void emptyCapacityVector()
    • setConicElevationAreaValues

      public void setConicElevationAreaValues(PairedValues pv)
    • clearConicElevationAreaValues

      public void clearConicElevationAreaValues()
    • getConicElevationAreaValues

      public PairedValues getConicElevationAreaValues()
      Elevation-area curve for conic interpolation storage
    • storageToElevation

      public double storageToElevation(double stor)
    • elevationToStorage

      public double elevationToStorage(double elev)
    • elevationToArea

      public double elevationToArea(double elev)
    • getFlowForRateOfRise

      public double getFlowForRateOfRise(double rateOfRise, double elev, double deltaTSeconds)
      Convert a rate of rise to a net reservoir inflow,outflow
      Parameters:
      rateOfRise - rate of reservoir rise per hour
      elev - elevation for computation
      deltaTSeconds - time interval for computing rise
      Returns:
      flow equivalent to the rateOfRise at elev
    • initialize

      public boolean initialize()
      initialize prior to a compute
      Overrides:
      initialize in class Function
    • initForecast

      public boolean initForecast(int step)
    • computeHindcastStep

      public int computeHindcastStep(RunTimeStep runtime)
      Overrides:
      computeHindcastStep in class Function
    • getHindcastStorage

      public double getHindcastStorage(RunTimeStep runtime)
    • computeInflow

      public boolean computeInflow(RunTimeStep runtime)
      compute the total and net inflow for the given time-step call prior to operation decision making
    • computeForecastStep

      public int computeForecastStep(RunTimeStep runtime)
      Overrides:
      computeForecastStep in class Function
    • computeSubStepFlow

      public double computeSubStepFlow(RunTimeStep rts, double xt, double et)
      Compute the evaporation and seepage from for a substep
      Overrides:
      computeSubStepFlow in class Function
      Parameters:
      rts - current RunTimeStep
      xt - time
      et - elevation
      Returns:
      evaporation plus seepage flow
    • getMaxElevation

      public double getMaxElevation()
    • getMinElevation

      public double getMinElevation()
    • getConicStorageForElevation

      public static double getConicStorageForElevation(double elevation, PairedValues elevArea, double[] storage, double firstStorageValue, double firstConicDepth)
      Static function for performing conic interpolation for plotting and editing tables.

      Parameters:
      elevation - elevation for conic interpolation
      elevArea - PairedValues set for elevation - area
      storage - previously computed storage values for elevations in elevArea
      firstStorageValue - storage value a first elevation
      firstConicDepth - initial conic depth, if undefined will compute
      Returns:
      storage value for elevation
    • getConicStorageForElevation

      public static double getConicStorageForElevation(double elevation, PairedValues elevArea, double firstStorageValue, double firstConicDepth)
    • getConicStorageArray

      public static double[] getConicStorageArray(PairedValues elevArea, double firstStorageValue, double firstConicDepth)
      Compute storage array once and for all given elevation and area values
    • calcInitialConicDepth

      public double calcInitialConicDepth()
    • calcConicBottomArea

      public double calcConicBottomArea()
    • getFieldObject

      public Object getFieldObject(Field fld)
      Description copied from interface: FieldAccessor
      This method allows access to java.lang.reflect.Field objects within the implementing class.
      Specified by:
      getFieldObject in interface FieldAccessor
      Overrides:
      getFieldObject in class Continuity
      Parameters:
      fld - The field to get.
      Returns:
      The data object that is stored in the given field
    • setFieldObject

      public boolean setFieldObject(Field fld, Object fobj)
      Description copied from interface: FieldAccessor
      This allows access to fields withing the implementing object to set there data.
      Specified by:
      setFieldObject in interface FieldAccessor
      Overrides:
      setFieldObject in class Continuity
      Parameters:
      fld - The java field object representing the member field to be set
      fobj - The data to set in that field
      Returns:
      returns true if successful
    • outputReport

      public void outputReport(AlternativeInputReport report, org.jdom.Element elem)
      Description copied from interface: AltInputReportInfc
      Alternative Input Report Interface for data.
      Specified by:
      outputReport in interface AltInputReportInfc
    • updateSystemState

      public void updateSystemState(RunTimeStep timestep, int numRteSteps)
      Update time series variables managed by the pool other than storage
      Parameters:
      timestep -
      numRteSteps -
    • getElevationBounded

      public double getElevationBounded(RunTimeStep rts)
      get the most recent elevation value relative to the given time step.
      Parameters:
      rts -
      Returns:
      most recent elevation value