Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=MaxNameLength), | public | :: | ControllerName | = | ' ' | ||
character(len=MaxNameLength), | public | :: | ControllerType | = | ' ' | ||
integer, | public | :: | ControllerType_Num | = | ControllerSimple_Type | ||
integer, | public | :: | ControlVar | = | iNoControlVariable | ||
integer, | public | :: | ActuatorVar | = | 0 | ||
integer, | public | :: | Action | = | iNoAction | ||
logical, | public | :: | InitFirstPass | = | .TRUE. | ||
integer, | public | :: | NumCalcCalls | = | 0 | ||
integer, | public | :: | Mode | = | iModeNone | ||
logical, | public | :: | DoWarmRestartFlag | = | .FALSE. | ||
logical, | public | :: | ReuseIntermediateSolutionFlag | = | .FALSE. | ||
logical, | public | :: | ReusePreviousSolutionFlag | = | .FALSE. | ||
type(SolutionTrackerType), | public, | DIMENSION(2) | :: | SolutionTrackers | |||
real(kind=r64), | public | :: | MaxAvailActuated | = | 0.0d0 | ||
real(kind=r64), | public | :: | MaxAvailSensed | = | 0.0d0 | ||
real(kind=r64), | public | :: | MinAvailActuated | = | 0.0d0 | ||
real(kind=r64), | public | :: | MinAvailSensed | = | 0.0d0 | ||
real(kind=r64), | public | :: | MaxVolFlowActuated | = | 0.0d0 | ||
real(kind=r64), | public | :: | MinVolFlowActuated | = | 0.0d0 | ||
real(kind=r64), | public | :: | MaxActuated | = | 0.0d0 | ||
real(kind=r64), | public | :: | MinActuated | = | 0.0d0 | ||
integer, | public | :: | ActuatedNode | = | 0 | ||
real(kind=r64), | public | :: | ActuatedValue | = | 0.0d0 | ||
real(kind=r64), | public | :: | NextActuatedValue | = | 0.0d0 | ||
integer, | public | :: | ActuatedNodePlantLoopNum | = | 0 | ||
integer, | public | :: | ActuatedNodePlantLoopSide | = | 0 | ||
integer, | public | :: | ActuatedNodePlantLoopBranchNum | = | 0 | ||
integer, | public | :: | SensedNode | = | 0 | ||
logical, | public | :: | IsSetPointDefinedFlag | = | .FALSE. | ||
real(kind=r64), | public | :: | SetPointValue | = | 0.0d0 | ||
real(kind=r64), | public | :: | SensedValue | = | 0.0d0 | ||
real(kind=r64), | public | :: | DeltaSensed | = | 0.0d0 | ||
real(kind=r64), | public | :: | Offset | = | 0.0d0 | ||
character(len=MaxNameLength), | public | :: | LimitType | = | ' ' | ||
real(kind=r64), | public | :: | Range | = | 0.0d0 | ||
real(kind=r64), | public | :: | Limit | = | 0.0d0 | ||
integer, | public | :: | TraceFileUnit | = | 0 | ||
logical, | public | :: | FirstTraceFlag | = | .TRUE. | ||
integer, | public | :: | BadActionErrCount | = | 0 | ||
integer, | public | :: | BadActionErrIndex | = | 0 |
TYPE ControllerPropsType
CHARACTER(LEN=MaxNameLength) :: ControllerName = ' ' ! Name of the Controller
CHARACTER(LEN=MaxNameLength) :: ControllerType = ' ' ! Type of Controller
INTEGER :: ControllerType_Num = ControllerSimple_Type
INTEGER :: ControlVar = iNoControlVariable ! The type of control variable being sensed
INTEGER :: ActuatorVar = 0 ! The variable that the controller will act on ie. flow
INTEGER :: Action = iNoAction ! Controller Action - Reverse or Normal
! Controller must be initialized to set MinActuated and MaxActuated
LOGICAL :: InitFirstPass = .TRUE.
! --------------------
! Internal data used for optimal restart across successive calls to SimAirLoop()
! --------------------
INTEGER :: NumCalcCalls = 0 ! Number of Calc() calls since last call to Reset()
INTEGER :: Mode = iModeNone ! Operational model of controller at current iteration
! Flag indicating whether the current controller simulation was performed from a cold start
! or following a speculative warm restart. Set in the ResetController() routine.
! Used in the CheckController() routine.
LOGICAL :: DoWarmRestartFlag = .FALSE.
! Flag used to decide whether or not it is allowed to reuse the intermediate solution from
! solving the previous controller on the air loop (COLD_START mode only) as the initial guess for
! the current controller.
LOGICAL :: ReuseIntermediateSolutionFlag = .FALSE.
! Flag used to decide whether or not it is possible to reuse the solution from
! the last call to SimAirLoop() as a possible candidate.
LOGICAL :: ReusePreviousSolutionFlag = .FALSE.
! Array of solution trackers. Saved at last call to SimAirLoop() in ManageControllers(iControllerOpEnd)
! The first tracker is used to track the solution when FirstHVACIteration is TRUE.
! The second tracker is used to track the solution at FirstHVACIteration is FALSE.
TYPE(SolutionTrackerType), DIMENSION(2) :: SolutionTrackers
! --------------------
! Operational limits at min/max avail values for actuated variable and the corresponding sensed values
! --------------------
REAL(r64) :: MaxAvailActuated = 0.0d0 ! kg/s, The maximum actuated variable currently available.
! Reset by simulation at each HVAC iteration
REAL(r64) :: MaxAvailSensed = 0.0d0 ! Sensed value at maximum available actuated variable
REAL(r64) :: MinAvailActuated = 0.0d0 ! kg/s, The minimum actuated variable currently available.
! Reset by simulation at each HVAC iteration
REAL(r64) :: MinAvailSensed = 0.0d0 ! Sensed value at maximum available actuated variable
! --------------------
! User input min/max values for actuated variable
! --------------------
REAL(r64) :: MaxVolFlowActuated = 0.0d0 ! m3/s, From User input the Max amount for the actuated variable
REAL(r64) :: MinVolFlowActuated = 0.0d0 ! m3/s, From User input the Min amount for the actuated variable
REAL(r64) :: MaxActuated = 0.0d0 ! kg/s, From User input the Max amount for the actuated variable
REAL(r64) :: MinActuated = 0.0d0 ! kg/s, From User input the Min amount for the actuated variable
! --------------------
! Actuated variable
! --------------------
INTEGER :: ActuatedNode = 0 ! The node that is acted upon by the controller
REAL(r64) :: ActuatedValue = 0.0d0 ! Value of actuated variable before change by the controller
REAL(r64) :: NextActuatedValue = 0.0d0 ! The new control actuated value
INTEGER :: ActuatedNodePlantLoopNum = 0 ! the plant loop index for the actuated node DSU3
INTEGER :: ActuatedNodePlantLoopSide = 0 ! the plant loop side for the actuated node DSU3
INTEGER :: ActuatedNodePlantLoopBranchNum = 0 ! the plant loop branch num for actuated node DSU3
! --------------------
! Sensed variable
! --------------------
INTEGER :: SensedNode = 0 ! The sensed node number from the grid
LOGICAL :: IsSetPointDefinedFlag = .FALSE. ! If TRUE indicates that the setpoint has been defined and can
! be used to compute DeltaSensed
REAL(r64) :: SetPointValue = 0.0d0 ! Desired setpoint; set in the SetPoint Manager or computed in Init() routine
REAL(r64) :: SensedValue = 0.0d0 ! The sensed control variable of any type
REAL(r64) :: DeltaSensed = 0.0d0 ! Difference of sensed to setpoint value for calculating proportional gain
REAL(r64) :: Offset = 0.0d0 ! This is the tolerance or droop from the error
! --------------------
! Other controller inputs, not yet used
! --------------------
CHARACTER(LEN=MaxNameLength) :: LimitType = ' ' ! Limit type as in HIGH or LOW
REAL(r64) :: Range = 0.0d0 ! The range or hysteresis of the control limit
REAL(r64) :: Limit = 0.0d0 ! The Limit value for a Limit Controller
! --------------------
! Trace mechanism
! --------------------
INTEGER :: TraceFileUnit = 0 ! File unit for individual controller trace file to use if > 0
LOGICAL :: FirstTraceFlag = .TRUE. ! To detect first individual write operation to individual controller trace file
INTEGER :: BadActionErrCount = 0 ! Counts number of incorrect action errors
INTEGER :: BadActionErrIndex = 0 ! index to recurring error structure for bad action error
END TYPE ControllerPropsType