Package hec.rss.model

Class InducedSurchargeOpRule

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

public class InducedSurchargeOpRule extends OpRule implements AsciiSerializable, Serializable, Cloneable
Description of the Class
See Also:
  • Field Details

    • UNDEF_OPTION

      public static final int UNDEF_OPTION
      Description of the Field
      See Also:
    • RATIO_OF_INFLOW

      public static final int RATIO_OF_INFLOW
      Description of the Field
      See Also:
    • AVG_RELEASE_AND_INFLOW

      public static final int AVG_RELEASE_AND_INFLOW
      Description of the Field
      See Also:
    • PEAK_GATE_OPENING

      public static final int PEAK_GATE_OPENING
      Description of the Field
      See Also:
    • PEAK_RELEASE

      public static final int PEAK_RELEASE
      Description of the Field
      See Also:
  • Constructor Details

    • InducedSurchargeOpRule

      public InducedSurchargeOpRule()
      Constructor for the InducedSurchargeOpRule object
    • InducedSurchargeOpRule

      public InducedSurchargeOpRule(String name)
      Constructor for the InducedSurchargeOpRule object
      Parameters:
      name - String
  • Method Details

    • evaluateLimits

      public void evaluateLimits(RunTimeStep rts, int iteration)
      calculates the limiting value for this rule for the given time step. as of 12/04
      Overrides:
      evaluateLimits in class OpRule
      Parameters:
      rts -
      iteration -
    • getOpValue

      public OpValue getOpValue(RunTimeStep rts)
      returns the operation value based on the previously computed rule limit. As of 12/04
      Overrides:
      getOpValue in class OpRule
      Parameters:
      rts -
      Returns:
    • initOtherIndependentVariable

      protected boolean initOtherIndependentVariable(IndependentVariable iv)
      Initialize the independent variable iv. Use to initialize iv for ESRD table lookup for parameters other than reservoir inflow.
      Parameters:
      iv -
      Returns:
    • setInflowValues

      public void setInflowValues(double[] inflowValues)
      Parameters:
      inflowValues -
    • setRecessionConstant

      public void setRecessionConstant(double d)
      Sets the recessionConstant attribute of the InducedSurchargeOpRule object
      Parameters:
      d - The new recessionConstant value
    • setTopOfFloodControlPool

      public void setTopOfFloodControlPool(double d)
      Sets the topOfFloodControlPool attribute of the InducedSurchargeOpRule object
      Parameters:
      d - The new topOfFloodControlPool value
    • setFallingPoolThresholdTime

      public void setFallingPoolThresholdTime(double tim)
      Sets the fallingPoolThresholdTime attribute of the InducedSurchargeOpRule object
      Parameters:
      tim - The new fallingPoolThresholdTime value
    • setFallingPoolOption

      public void setFallingPoolOption(int iopt)
      Sets the fallingPoolOption attribute of the InducedSurchargeOpRule object
      Parameters:
      iopt - The new fallingPoolOption value
    • setRatio

      public void setRatio(double ratio)
      Sets the ratio attribute of the InducedSurchargeOpRule object
      Parameters:
      ratio - The new ratio value
    • setRatioPeriod

      public void setRatioPeriod(double period)
      Sets the ratioPeriod attribute of the InducedSurchargeOpRule object
      Parameters:
      period - The new ratioPeriod value
    • setInflowAvgPeriod

      public void setInflowAvgPeriod(double period)
      Sets the inflowAvgPeriod attribute of the InducedSurchargeOpRule object
      Parameters:
      period - The new inflowAvgPeriod value
    • setSurchargeCurve

      public void setSurchargeCurve(PairedValues pv)
      Sets the surchargeCurve attribute of the InducedSurchargeOpRule object
      Parameters:
      pv - The new surchargeCurve value
    • setPlotInflowValues

      public void setPlotInflowValues(double[] inflows)
      Sets the plotInflowValues attribute of the InducedSurchargeOpRule object
      Parameters:
      inflows - The new plotInflowValues value
    • setPlotRateOfRiseValues

      public void setPlotRateOfRiseValues(double[] rateOfRise)
      Sets the plotRateOfRiseValues attribute of the InducedSurchargeOpRule object
      Parameters:
      rateOfRise - The new plotRateOfRiseValues value
    • setPlotRateOfRiseLookbackHours

      public void setPlotRateOfRiseLookbackHours(double lookbackHours)
      Sets the plotRateOfRiseLookbackHours attribute of the InducedSurchargeOpRule object
      Parameters:
      lookbackHours - The new plotRateOfRiseLookbackHours value
    • setUseRateOfRise

      public void setUseRateOfRise(boolean tf)
      return last state of surcharge plot
      Parameters:
      tf - The new useRateOfRise value
    • setOutletUsageModel

      public void setOutletUsageModel(OutletUsageModel model)
      Sets the outletUsageModel attribute of the InducedSurchargeOpRule object
      Parameters:
      model - The new outletUsageModel value
    • setTimeSeriesOptionModel

      public void setTimeSeriesOptionModel(InflowTimeSeriesOptionModel model)
      Sets the timeSeriesOptionModel attribute of the InducedSurchargeOpRule object
      Parameters:
      model - The new timeSeriesOptionModel value
    • setFieldObject

      public boolean setFieldObject(Field fld, Object fobj)
      Sets the fieldObject attribute of the InducedSurchargeOpRule object
      Specified by:
      setFieldObject in interface FieldAccessor
      Overrides:
      setFieldObject in class OpRule
      Parameters:
      fld - The new fieldObject value
      fobj - The new fieldObject value
      Returns:
      Description of the Returned Value
    • getInflowValues

      public double[] getInflowValues()
      Returns:
      double array of inflow values
    • getRecessionConstant

      public double getRecessionConstant()
      Gets the recessionConstant attribute of the InducedSurchargeOpRule object
      Returns:
      The recessionConstant value
    • getTopOfFloodControlPool

      public double getTopOfFloodControlPool()
      falling pool elevation below which induced surcharge rule not applied
      Returns:
      The topOfFloodControlPool value
    • getFallingPoolThresholdTime

      public double getFallingPoolThresholdTime()
      time threshold for determining falling pool
      Returns:
      The fallingPoolThresholdTime value
    • getFallingPoolOption

      public int getFallingPoolOption()
      Gets the fallingPoolOption attribute of the InducedSurchargeOpRule object
      Returns:
      The fallingPoolOption value
    • getRatio

      public double getRatio()
      release ratio of inflow
      Returns:
      The ratio value
    • getRatioPeriod

      public double getRatioPeriod()
      Gets the ratioPeriod attribute of the InducedSurchargeOpRule object
      Returns:
      The ratioPeriod value
    • getInflowAvgPeriod

      public double getInflowAvgPeriod()
      release is the previous period release plus inflow averaged over time
      Returns:
      The inflowAvgPeriod value
    • getSurchargeCurve

      public PairedValues getSurchargeCurve()
      Gets the surchargeCurve attribute of the InducedSurchargeOpRule object
      Returns:
      The surchargeCurve value
    • getDischargeValue

      public double getDischargeValue(double qin, double elev)
      Compute induced surcharge discharge qin is inflow to reservoir, elev is current reservoir elevation
      Parameters:
      qin - Description of Parameter
      elev - Description of Parameter
      Returns:
      The dischargeValue value
    • getElevationForInflowRelease

      public double getElevationForInflowRelease(double qin, double release)
      Compute elevation value for induced surcharge given reservoir inflow and release. This function is used in computing an induced surcharge curve for a given inflow. Release is then the independent variable and elevation the dependent variable for the curve.
      Parameters:
      qin - Description of Parameter
      release - Description of Parameter
      Returns:
      The elevationForInflowRelease value
    • getElevationForRateOfRise

      public double getElevationForRateOfRise(double rateOfRise, double release)
      Compute elevation value for induced surcharge given reservoir rate of rise and release. This function is used in computing an induced surcharge curve for a given rate of rise. Release is then the independent variable and elevation the dependent variable for the curve.
      Parameters:
      rateOfRise - Description of Parameter
      release - Description of Parameter
      Returns:
      The elevationForRateOfRise value
    • setUserDefinedIsCurves

      public void setUserDefinedIsCurves(PairedValuesExt userDefinedIsCurves, double[] inflows)
    • getUserDefinedIsCurves

      public PairedValuesExt getUserDefinedIsCurves()
    • getUserDefinedIsInflows

      public double[] getUserDefinedIsInflows()
    • setUseUserDefinedIsCurves

      public void setUseUserDefinedIsCurves(boolean tf)
    • getUseUserDefinedIsCurves

      public boolean getUseUserDefinedIsCurves()
    • setUserCurvesAreRateOfRise

      public void setUserCurvesAreRateOfRise(boolean tf)
    • getUserCurvesAreRateOfRise

      public boolean getUserCurvesAreRateOfRise()
    • setUserDefinedIsCurvesForRateOfRise

      public void setUserDefinedIsCurvesForRateOfRise(PairedValuesExt userDefinedIsCurves, double[] rateOfRise)
      Stores a copy of the Rate of Rise ESRD curves
      Parameters:
      userDefinedIsCurves -
      rateOfRise -
    • getUserDefinedIsCurvesForRateOfRise

      public PairedValuesExt getUserDefinedIsCurvesForRateOfRise()
    • getUserDefinedRateOfRise

      public double[] getUserDefinedRateOfRise()
    • setUserDefinedIsCurvesForFunctionOfInflow

      public void setUserDefinedIsCurvesForFunctionOfInflow(PairedValuesExt userDefinedIsCurves, double[] inflow)
      Stores a copy of the Function Of Reservoir Inflow ESRD curves
      Parameters:
      userDefinedIsCurves -
      inflow -
    • getUserDefinedIsCurvesForFunctionOfInflow

      public PairedValuesExt getUserDefinedIsCurvesForFunctionOfInflow()
    • getUserDefinedIsReservoirInflow

      public double[] getUserDefinedIsReservoirInflow()
    • getPlotInflowValues

      public double[] getPlotInflowValues()
      Inflow values for family of curves on induced surcharge reference plot
      Returns:
      The plotInflowValues value
    • getPlotRateOfRiseValues

      public double[] getPlotRateOfRiseValues()
      Rate of rise values for family of curves on induced surcharge reference plot
      Returns:
      The plotRateOfRiseValues value
    • getPlotRateOfRiseLookbackHours

      public double getPlotRateOfRiseLookbackHours()
      lookback time for computing rate of rise for surcharge plotting
      Returns:
      The plotRateOfRiseLookbackHours value
    • getInflowTimeSeriesOption

      public InflowTimeSeriesOptionModel getInflowTimeSeriesOption()
      Gets the inflowTimeSeriesOption attribute of the InducedSurchargeOpRule object
      Returns:
      The inflowTimeSeriesOption value
    • getOutletUsageModel

      public OutletUsageModel getOutletUsageModel()
      Gets the outletUsageModel attribute of the InducedSurchargeOpRule object
      Returns:
      The outletUsageModel value
    • setIndependentVariable

      public void setIndependentVariable(IndependentVariable independentVariable)
      Set IndependentVariable of inflow for setting time averaging and offset options
    • setTableLookupIndependentVariable

      public void setTableLookupIndependentVariable(IndependentVariable iv)
      For user defined ESRD curves, get additional user defined IndependentVariable of inflow for setting time averaging and offset options
    • getIndependentVariable

      public IndependentVariable getIndependentVariable()
      get IndependentVariable of inflow for setting time averaging and offset options
      Returns:
    • getTableLookupIndependentVariable

      public IndependentVariable getTableLookupIndependentVariable()
      For user defined ESRD curves, get IndependentVariable for table lookup. Can be different from reservoir inflow
      Returns:
    • 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 OpRule
      Parameters:
      fld - Description of Parameter
      Returns:
      The fieldObject value
    • initializeCompute

      public boolean initializeCompute()
      prep for compute
      Overrides:
      initializeCompute in class OpRule
      Returns:
      Description of the Returned Value
    • evaluateRule

      public OpValue evaluateRule(RunTimeStep rts, double initialValue)
      compares the intial value to rule constraints and returns the adjusted value
      Overrides:
      evaluateRule in class OpRule
      Parameters:
      rts - Description of Parameter
      initialValue - Description of Parameter
      Returns:
      Description of the Returned Value
    • saveFunctionState

      public void saveFunctionState(int stateid)
      save the current state of the element and its function with the given identifier - saves subreach flows
      Overrides:
      saveFunctionState in class OpRule
      Parameters:
      stateid - identifier for the state
    • restoreFunctionState

      public void restoreFunctionState(int stateid)
      restore the state of the element and its function matching the given identifier - restores subreach flows
      Overrides:
      restoreFunctionState in class OpRule
      Parameters:
      stateid - identifier for the state
    • saveHotstartState

      public void saveHotstartState(ElementHotstartState elementHotstartState, int stateId)
    • clone

      public Object clone()
      Description of the Method
      Overrides:
      clone in class OpRule
      Returns:
      Description of the Returned Value
    • fallingPoolOptionsValid

      public boolean fallingPoolOptionsValid()
      Description of the Method
      Returns:
      Description of the Returned Value
    • averageInflow

      public double averageInflow(RunTimeStep rts, double avgPeriod)
      Description of the Method
      Parameters:
      rts - Description of Parameter
      avgPeriod - Description of Parameter
      Returns:
      Description of the Returned Value
    • reservoirFalling

      public boolean reservoirFalling(RunTimeStep rts, double avgPeriod)
      Description of the Method
      Parameters:
      rts - Description of Parameter
      avgPeriod - Description of Parameter
      Returns:
      Description of the Returned Value
    • fq

      public double fq(double s1, double qin, Storage storage, double q)
      error function for solving for discharge flow q = current estimate for induced surcharge discharge flow qin = reservoir inflow s1 = current reservoir storage tr = time of recession constant ( seconds )
      Parameters:
      s1 - Description of Parameter
      qin - Description of Parameter
      storage - Description of Parameter
      q - Description of Parameter
      Returns:
      Description of the Returned Value
    • useRateOfRise

      public boolean useRateOfRise()
      Description of the Method
      Returns:
      Description of the Returned Value
    • getRuleLimitType

      public int getRuleLimitType()
      get the limit type of this rule should be implemented by all subclasses of OpRule
      Overrides:
      getRuleLimitType in class OpRule
    • getActiveTSRecordProxies

      public Vector getActiveTSRecordProxies(Vector vec, int iotype)
      add the time series record proxies associated current compute. subclassses that over-ride this method should also call this method
      Overrides:
      getActiveTSRecordProxies in class OpRule
    • useTableLookupIndependentVariable

      public boolean useTableLookupIndependentVariable()
      If the ESRD curve uses an additional user defined independent Variable return true
      Returns:
      true if uses additional IV
    • setUseTableLookupIndependentVariable

      public void setUseTableLookupIndependentVariable(boolean set)
      Set true if the ESRD curve uses an additional user defined independent Variable
      Parameters:
      _useTableLookupIndependentVariable -
    • 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 sub-classes of OpRule may over-ride this method if they use TSRecordProxies but should also call this method
      Overrides:
      updateTSProxyList in class OpRule
    • getRequiredTSRecordProxies

      public Vector getRequiredTSRecordProxies(Vector v)
      returns the TSRecordProxies required by independent variable proxies are only included if they are associated with elements that are not downstream of this reservoir - if they are downstream, then the dependency is accomodated by extending the iterationBlock in the ordering logic
      Overrides:
      getRequiredTSRecordProxies in class OpRule
    • getReferencedStateVariables

      public void getReferencedStateVariables(List svlist)
      adds StateVariables refereced by this rule to the given list
      Overrides:
      getReferencedStateVariables in class OpRule
      Parameters:
      svlist - unique list of state variables
    • 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
      Overrides:
      outputReport in class OpRule