Package hec.rss.model

Class MuskingumRouting

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

public class MuskingumRouting extends Routing
See Also:
  • Constructor Details

    • MuskingumRouting

      public MuskingumRouting()
    • MuskingumRouting

      public MuskingumRouting(Element elem)
  • Method Details

    • clone

      public Object clone()
      Description copied from class: Function
      clone method
      Overrides:
      clone in class Function
    • 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 Function
      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 Function
      Parameters:
      stateid - identifier for the state
    • saveHotstartState

      public void saveHotstartState(HotstartState parentHotstartState, int stateId)
      Overrides:
      saveHotstartState in class Function
    • restoreHotstartState

      public boolean restoreHotstartState(HotstartState parentState)
      Overrides:
      restoreHotstartState in class Function
    • computeForecastStep

      public int computeForecastStep(RunTimeStep rts)
      compute one routing step during forecast
      Overrides:
      computeForecastStep in class Function
    • computeRouting

      public int computeRouting(RunTimeStep rts, double[] inputTS, double[] outputTS, Object[] routingDataTS, double[] routed)
      Compute routing over the given time window using the provided input, output, and routing data object time series arrays
      Overrides:
      computeRouting in class Routing
      Parameters:
      rts - time step and number of steps
      inputTS - upstream flow time series
      outputTS - previously computed downstream flow time series
      routingDataTS - additional time depended routing data if needed for the routing method
      routed - newly computed downstream flow (array size must be >= rts.nstep)
      Returns:
      return flag, RssReturnStatusConstants.RTN_NOPROBLEM if routing computed successfully
    • computeRouting

      public int computeRouting(RunTimeStep rts)
      Overrides:
      computeRouting in class Routing
    • computeRoutingStep

      public double computeRoutingStep(double deltaT, double q0, double q1, MuskingumRouting.SubReachData initSubOutflow, MuskingumRouting.SubReachData finSubOutflow)
    • initialize

      public boolean initialize()
      Description copied from class: Routing
      initialize prior to a compute
      Overrides:
      initialize in class Routing
    • hasDefaultParameters

      public boolean hasDefaultParameters()
      test whether default K and X values have been changed
      Overrides:
      hasDefaultParameters in class Function
    • setmuskingumK

      public void setmuskingumK(double[] muskingumK)
    • setmuskingumX

      public void setmuskingumX(double[] muskingumX)
    • setnumberReaches

      public void setnumberReaches(int numberReaches)
    • getmuskingumK

      public double[] getmuskingumK()
    • getmuskingumX

      public double[] getmuskingumX()
    • getnumberReaches

      public int getnumberReaches()
    • 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 Routing
      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 Routing
      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
    • main

      public static void main(String[] args)
    • 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 Routing
    • newRouteData

      public Object newRouteData()
      create a new empty RouteData object for ResSim v4 compute
      Overrides:
      newRouteData in class Routing
    • initializeStandalone

      public boolean initializeStandalone()
      Description copied from class: Routing
      Initialize routing object for standalone compute in offline WQ simulation Default method - implemented in individual subclasses
      Overrides:
      initializeStandalone in class Routing
      Returns:
      true if initialization successful, false o.w.
    • getNumberSubreaches

      public int getNumberSubreaches()
      Description copied from class: Routing
      Get the number of subreaches in the routing reach Default method returns 1 - method implemented in individual subclasses
      Overrides:
      getNumberSubreaches in class Routing
      Returns:
      number of subreaches in reach with routing
    • getSubreachFlowArray

      public double[] getSubreachFlowArray(double flowIn, double flowOut, int iStep)
      Overrides:
      getSubreachFlowArray in class Routing
    • computeRoutingStepStandalone

      public double computeRoutingStepStandalone(int rtsMinutes, double q0, double q1, double reachOutflow, double[] initSubOutflow, double[] finSubOutflow)
      Description copied from class: Routing
      Method to compute a time step of routing through a reach for an offline WQ simulation Default implementation - returns array of constant flows Actual routing methods implemented in individual subclasses
      Overrides:
      computeRoutingStepStandalone in class Routing
      Parameters:
      q0 - initial flow into upstream subreach
      q1 - flow at end of time step into upstream subreach
      reachOutflow - flow at end of the reach - used for coef routing
      initSubOutflow - array of subreach flows at start of time step
      finSubOutflow - array of subreach flows at end of time step
      Returns:
      flow at the end of the reach at end of time step