Package hec.rss.model

Class AdjustableFlow

All Implemented Interfaces:
AsciiSerializable, FieldAccessor, TSLocation, PowerPlantContainer, AltInputReportInfc, RssModelVariableConstants, RssReturnStatusConstants, RssTSLocation, TailElevContainer, Serializable, Cloneable, Comparable, Observer, rma.lang.Modifiable
Direct Known Subclasses:
PowerPlantFlow, PumpFlow, ReversiblePumpFlow

public class AdjustableFlow extends ControlStructure implements PowerPlantContainer, TailElevContainer, AltInputReportInfc
See Also:
  • Field Details

  • Constructor Details

    • AdjustableFlow

      public AdjustableFlow()
    • AdjustableFlow

      public AdjustableFlow(Element elem)
  • Method Details

    • createDefaultAdjustableParameter

      protected AdjustableParameter createDefaultAdjustableParameter()
    • getStateRate

      public double getStateRate(RunTimeStep rts)
      This method was introduced for the rs4engine.
      Parameters:
      rts -
      Returns:
      Jacobian coefficient
    • computeStepFlow

      public double computeStepFlow(RunTimeStep rts)
      Compute the flow at time step, rts. Computes end of period instantaneous flow or period average flow depending on the compute calculation option. Assumes that both rts.step and rts.step-1 are valid time series array indexes. This method was introduced for the rs4engine.
      Parameters:
      rts -
      Returns:
      end of period instantaneous flow or period average flow depending on the compute calculation option
    • getMaxCapacity

      public double getMaxCapacity()
    • calcFlow

      public double calcFlow(RunTimeStep rts)
    • initForecastOperations

      public int initForecastOperations(RunTimeWindow rtw)
      Initialzes adjustable parameter values over forecast time window Copies the last hindcast value to the entire forecast window.
      Overrides:
      initForecastOperations in class ControlStructure
    • applyHindcastData

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

      public void getHindcastDataList(Vector hvec)
      adds the hindcast record for total release from this object
      Overrides:
      getHindcastDataList in class Function
    • getPowerPlant

      public PowerPlant getPowerPlant()
    • getPump

      public Pump getPump()
    • getTailwaterElevation

      public TailwaterElevation getTailwaterElevation()
      Specified by:
      getTailwaterElevation in interface TailElevContainer
    • setElement

      public void setElement(Element e)
      Overrides:
      setElement in class Function
    • isNodeComputed

      public boolean isNodeComputed(int iorder, RssNode node, Integer idir)
      returns true if node is computed by the function, the function computes the flow at all nodes so it is always true
      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
    • getCapacityValuesBySetting

      public PairedValuesExt getCapacityValuesBySetting()
    • 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
    • setCapacityValuesBySetting

      public void setCapacityValuesBySetting(PairedValuesExt pv)
    • hasMultipleGateSettings

      public boolean hasMultipleGateSettings()
    • setMultipleGateSettings

      public void setMultipleGateSettings(boolean b)
    • getGateSettings

      public double[] getGateSettings()
    • setGateSettings

      public void setGateSettings(double[] settings)
    • getGateSettingsParamId

      public int getGateSettingsParamId()
    • setGateSettingsParamId

      public void setGateSettingsParamId(int id)
    • getGateCount

      public int getGateCount()
    • setGateCount

      public void setGateCount(int n)
    • setHasTailElev

      public void setHasTailElev(boolean b)
      Description copied from interface: TailElevContainer
      activates/deactivates tailwater elevation
      Specified by:
      setHasTailElev in interface TailElevContainer
    • hasTailElev

      public boolean hasTailElev()
      Description copied from interface: TailElevContainer
      returns boolean indicating whether this element has a tailwater elevation
      Specified by:
      hasTailElev in interface TailElevContainer
    • setHasPowerPlant

      public void setHasPowerPlant(boolean b)
      Description copied from interface: PowerPlantContainer
      activates/deactivates power plant
      Specified by:
      setHasPowerPlant in interface PowerPlantContainer
    • hasPowerPlant

      public boolean hasPowerPlant()
      Description copied from interface: PowerPlantContainer
      returns boolean indicating whether this element has a power plant
      Specified by:
      hasPowerPlant in interface PowerPlantContainer
    • hasPump

      public boolean hasPump()
    • setHasPump

      public void setHasPump(boolean b)
    • hasReversiblePump

      public boolean hasReversiblePump()
    • setHasReversiblePump

      public void setHasReversiblePump(boolean b)
    • getGateHeightForElevFlow

      public double getGateHeightForElevFlow(double elev, double flow)
      Given reservoir elevation and desired discharge flow, determine gate height
    • getPrevGateHeight

      public double getPrevGateHeight(RunTimeStep rts)
      returns the gate opening from the previous time step. the gate opening my be interms of length or percent depending of the outlet configuration. if the outlet does not explicity define gate openings, then percentage of capacity is used.
      Parameters:
      rts - the current RunTimeStep (gate opening is returned for the time step previous to this rts)
      Returns:
      opening as percent or length corresponding to outlet configuration
    • getFlowForGateHeight

      public double getFlowForGateHeight(double elev, double gateHeight)
      Given reservoir elevation and gate height, determine discharge flow
    • getMaxCapacityForElevation

      @Deprecated public double getMaxCapacityForElevation(double elev)
      Deprecated.
      get maximum release capacity for gated outlet
    • copyInto

      public void copyInto(AdjustableFlow af)
      Performs a deep copy of the input parameter af into this object.
      Parameters:
      af -
    • clone

      public Object clone()
      clone method
      Overrides:
      clone in class ControlStructure
    • getInitialRelease

      public double getInitialRelease()
    • setInitialRelease

      public void setInitialRelease(double r)
    • getHindcastCondition

      public int getHindcastCondition()
    • setHindcastCondition

      public boolean setHindcastCondition(int cond)
    • getAdjustableParameter

      public AdjustableParameter getAdjustableParameter()
      Overrides:
      getAdjustableParameter in class ControlStructure
    • findAdjParam

      public AdjustableParameter findAdjParam(String param)
      Overrides:
      findAdjParam in class Function
    • hasDefaultParameters

      public boolean hasDefaultParameters()
      check if initial capacity values have been changed
      Overrides:
      hasDefaultParameters in class Function
    • getCapacityValues

      public PairedValues getCapacityValues()
    • setCapacityValues

      public void setCapacityValues(PairedValues pv)
    • initialize

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

      public double getCurrentCapacity(RunTimeStep rts)
      gets the current maximum release from this outlet this should only be called during a compute
    • getCurrentCapacity

      public double getCurrentCapacity(RunTimeStep rts, double[] xt, double[] et, int tcnt)
    • getCurrentCapacity

      public double getCurrentCapacity(RunTimeStep rts, double elev0, double elev)
    • getCapacity

      public double getCapacity(double elev)
      get maximum release capacity for gated outlet
      Parameters:
      elev - Elevation at which capacity is computed
    • getHindcastValue

      public double getHindcastValue(RunTimeStep runtime)
    • computeHindcastStep

      public int computeHindcastStep(RunTimeStep runtime)
      compute one release for hind cast
      Overrides:
      computeHindcastStep in class Function
    • computeForecastStep

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

      public int computeForecastStep(RunTimeStep runtime, double[] xt, double[] et, int tcnt)
      Overrides:
      computeForecastStep in class Function
    • computeSubStepFlow

      public double computeSubStepFlow(RunTimeStep rts, double xt, double et)
      Overrides:
      computeSubStepFlow 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
    • 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 ControlStructure
      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 ControlStructure
      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 supporting time series called from rs4engine
      Parameters:
      timestep -
      numRteSteps -