EcosizerEngine Documentation¶
- class engine.EcosizerEngine.EcosizerEngine(supplyT_F, storageT_F, percentUseable, aquaFract, schematic, incomingT_F=None, magnitudeStat=None, buildingType=None, loadshape=None, avgLoadshape=None, loadShiftSchedule=None, loadUpHours=None, aquaFractLoadUp=None, aquaFractShed=None, loadUpT_F=None, loadShiftPercent=1, returnT_F=0, flowRate=0, gpdpp=0, nBR=None, safetyTM=1.75, defrostFactor=1, compRuntime_hr=16, nApt=None, Wapt=None, doLoadShift=False, setpointTM_F=135, TMonTemp_F=120, offTime_hr=0.333, standardGPD=None, PVol_G_atStorageT=None, PCap_kW=None, TMVol_G=None, TMCap_kW=None, annual=False, zipCode=None, climateZone=None, systemModel=None, numHeatPumps=None, tmModel=None, tmNumHeatPumps=None, inletWaterAdjustment=None, ignoreShortCycleEr=False, useHPWHsimPrefMap=False, designOAT_F=None, sizeAdditionalER=False, additionalERSaftey=1.0)¶
Initializes and sizes the HPWH system for a building based on the given parameters.
- Attributes:
- magnitude_statint or list
a number that will be used to assess the magnitude of the building based on the building type
- supplyT_Ffloat
The hot water supply temperature.[°F]
- storageT_Ffloat
The hot water storage temperature. [°F]
- percentUseablefloat
The fraction of the storage volume that can be filled with hot water.
- aquaFract: float
The fraction of the total height of the primary hot water tanks at which the Aquastat is located.
- schematicString
Indicates schematic type. Valid values are ‘swingtank’, ‘paralleltank’, and ‘primary’
- incomingT_Ffloat
The incoming city water temperature on the design day. [°F]
- building_typestring or list
a string indicating the type of building we are sizing for (e.g. “multi_family”, “office_building”, etc.)
- loadShapendarray
defaults to design load shape for building type.
- avgLoadShapendarray
defaults to average load shape for building type.
- loadShiftSchedulearray_like
List or array of 0’s, 1’s used for load shifting, 0 indicates system is off.
- loadUpHoursfloat
Number of hours spent loading up for first shed.
- aquaFractLoadUpfloat
The fraction of the total height of the primary hot water tanks at which the load up aquastat is located.
- aquaFractShedfloat
The fraction of the total height of the primary hot water tanks at which the shed aquastat is located.
- loadUpT_Ffloat
The hot water storage temperature between the normal and load up aquastat. [°F]
- loadShiftPercentfloat
Percentage of days the load shift will be met
- returnT_Ffloat
The water temperature returning from the recirculation loop. [°F]
- flow_ratefloat
The pump flow rate of the recirculation loop. (GPM)
- gpdppfloat
The volume of water in gallons at 120F each person uses per dat.[°F]
- nBRlist
A list of the number of units by size in the order 0 bedroom units, 1 bedroom units, 2 bedroom units, 3 bedroom units, 4 bedroom units, 5 bedroom units.
- safetyTMfloat
The saftey factor for the temperature maintenance system.
- defrostFactorfloat
A multipier used to account for defrost in the final heating capacity. Default equals 1.
- compRuntime_hrfloat
The number of hours the compressor will run on the design day. [Hr]
- nAptinteger
The number of apartments. Use with Qdot_apt to determine total recirculation losses. (For multi-falmily buildings)
- Waptfloat
Watts of heat lost in through recirculation piping system. Used with N_apt to determine total recirculation losses. (For multi-falmily buildings)
- doLoadShiftboolean
Set to true if doing loadshift
- setpointTM_Ffloat
The setpoint of the temprature maintence tank. Defaults to 135 °F.
- TMonTemp_Ffloat
The temperature where parallel loop tank will turn on. Defaults to 120 °F.
- offTime_hrinteger
Maximum hours per day the temperature maintenance equipment can run.
- standardGPDstring
indicates whether to use a standard gpdpp specification for multi-family buildings. Set to None if not using a standard gpdpp.
- PVol_G_atStorageTfloat
For pre-sized systems, the total/maximum storage volume for water at storage temperature for the system in gallons
- PCap_kWfloat
For pre-sized systems, the output capacity for the system in kW
- TMVol_Gfloat
For applicable pre-sized systems, the temperature maintenance volume for the system in gallons
- TMCap_kWfloat
For applicable pre-sized systems, the output capacity for temperature maintenance for the system in kW
- annualboolean
indicates whether to use annual loadshape for multi-family buildings
- zipCodeint
the CA zipcode the building resides in to determine the climate zone
- climateZoneint
the CA climate zone the building resides in
- systemModelString
The make/model of the HPWH being used for the primary system.
- numHeatPumpsint
The number of heat pumps on the primary system
- tmModelString
The make/model of the HPWH being used for the temperature maintenance system.
- tmNumHeatPumpsint
The number of heat pumps on the temperature maintenance system
- inletWaterAdjustmentfloat
adjustment for inlet water temperature fraction for primary recirculation systems
- ignoreShortCycleErboolean
ignores errors for short cycling (when the AQ fract is too low in the system). The engineer should be informed to use multiple heat pumps to avoid shortcycling if they are overriding short cycling errors
- useHPWHsimPrefMapboolean
if available for the HPWH model in systemModel and/or tmModel, the system will use the preformance map from HPWHsim if useHPWHsimPrefMap is set to True. Otherwise, it will use the most recent data model.
- designOAT_Ffloat
The outdoor air temperature for sizing the number of heat pumps and/or ER capacity in an ER-Trade off system.
- sizeAdditionalERboolean
if set to True, swingtank_er will be assummed as schematic and will size for additional ER element. False if there is no need to size additional ER for swingtank_er schematic
- additionalERSafteyfloat
applicable for ER trade off swing tank only. Saftey factor to apply to additional electric resistance sizing
Methods
- Returns:
- Returns:
erSizedPointsPlot
([returnAsDiv, ...])Returns a plot of sizing Electric Resistance Capacity by the percent of people covered in the appartment building.
Returns climate zone of the simulation building as an int or None if it has not been set.
Returns the total daily DHW usage for the building the HPWH is being sized or simulated for.
getSimResult
([initPV, initST, ...])*LEGACY FUNCTION* to be depricated.
getSimRun
([initPV, initST, minuteIntervals, ...])Returns a simulationRun object for a simulation of the Ecosizer's building and system object
getSimRunWithkWCalc
([initPV, initST, ...])Returns a list that includes a simulationRun object for a simulation of the Ecosizer's building and system object with load shifting and without load shifting, also includes the loadshift_capacity and the kGperkWh_saved
Returns the minimum primary volume and heating capacity sizing results
Returns combinations of storage and percent of load shift days covered
plotSizingCurve
([returnAsDiv, ...])Returns a plot of the valid storage and capacity combinations.
plotStorageLoadSim
([return_as_div, initPV, ...])Returns a plot of the of the simulation for the minimum sized primary system as a div or plotly figure.
Sizes the primary system curve.
- Returns:
- Returns:
- Returns:
- Returns:
utilityCalculation
(monthly_base_charge, ...)- Parameters:
- assumedCOP()¶
- Returns:
- assumedCOPboolean
Returns True if, at any time, the system has assumed a COP of 1.5 during a simulation due to performance map constraints. False otherwise.
- assumedHighDefaultCap()¶
- Returns:
- assumedHighIOboolean
Returns True if the model had to assume default high OAT input and output capacity because the climate’s OAT was greater than the values in available performance map. False otherwise.
- erSizedPointsPlot(returnAsDiv=True, returnWithXYPoints=False)¶
Returns a plot of sizing Electric Resistance Capacity by the percent of people covered in the appartment building.
- Parameters:
- return_as_divboolean
A logical on the output, as a div string (true) or as a figure (false)
- returnWithXYPointsboolean
set to true to return the plot in addition to arrays of x and y coordinates for the sizing curve
- Returns:
- plotplotly.Figure -OR- <div> string
The sizing curve graph with slider. Return type depends on value of return_as_div parameter. It will plot Percent of Coverage vs. Swing Tank Capacity.
- x_valuesList
List of x axis values of points on the sizing curve. Returned only if returnWithXYPoints set to True.
- y_valuesList
List of y axis values of points on the sizing curve. Returned only if returnWithXYPoints set to True.
- startIndexint
the index in x_values and y_values to start the slider on the sizing curve. Returned only if returnWithXYPoints set to True.
- getClimateZone()¶
Returns climate zone of the simulation building as an int or None if it has not been set.
- Returns:
- climateZoneint
A number between 1 and 16 that represents the coorespondiong California climate zone. Returns None if this value has not been set.
- getHWMagnitude()¶
Returns the total daily DHW usage for the building the HPWH is being sized or simulated for.
- Returns:
- magnitudeFloat
The total daily DHW usage for the building in gallons.
- getSimResult(initPV=None, initST=None, minuteIntervals=1, nDays=3, kWhCalc=False, kGDiff=False, optimizeNLS=False)¶
*LEGACY FUNCTION* to be depricated. Returns the result of a simulation of a HPWH system in a building
- Parameters:
- initPVfloat
Primary volume at start of the simulation
- initSTfloat
Swing tank temperature at start of the simulation.
- minuteIntervalsint
the number of minutes the duration each interval timestep for the simulation will be
- nDaysint
the number of days the for duration of the entire simulation will be
- kWhCalcboolean
set to true to add the kgCO2/kWh calculation to the result.
- kGDiffboolean
set to True if you want to include the kGCO2/kWh saved in the result. Will also include loadshift capacity. Only available for loadshifting systems with annual loadshapes
- optimizeNLSboolean
set to True to optimize non-loadshift sizing. Only applies if kGDiff = True
- Returns:
- simResultList
- contains the following items in this order:
- pVList
Volume of HW in the tank at the storage temperature at every simulation interval. (Gallons)
- hwGenList
The theoretical amount of HW at storage tempurature that can be generated at every simulation interval. (Gallons)
- hwDemandList
The amount of HW used by the building (loadshape) at every simulation interval. (Gallons)
- pGenList
The actual amount of HW at storage tempurature generated by the primary system at every simulation interval. (Gallons)
- If the system is a swing tank, the following fields will appear in the result in this order:
- swingT_FList
Tempurature of water in the swing tank at every simulation interval. (F)
- tmRunList
Amount of time the temperature maintenance is on during every simulation interval. (Minutes)
- hw_outSwingList
Hot water exiting swing tank at swing tank temperature at every simulation interval. (Gallons)
- If kWhCalc == True, the following fields will appear in the result in this order:
- pRunList
Amount of time the primary tank is on during every simulation interval. (Minutes)
- oatList
Tempurature of outdoor air at every simulation interval. (F)
- capList
The capacity of the primary system at every simulation interval. (kW)
- kGperkWhList
The kGCO2 used in every simulation interval. (kGCO2)
- sum_of_kGperkWhFloat
Sum of kGCO2 used in the simulation. (kGCO2)
- avgIncomingWaterT_FFloat
Average incoming water temperature for the entire simulation. (F)
- If kGDiff == True, the following fields will appear in the result in this order:
- loadshift_capacityFloat
The loadshift capacity for the entire simulation (kWh)
- kGperKwH_savedFloat
The kGCO2 saved by using load shifting in the simulation. (kGCO2/kWh)
*NOTE* If kGDiff == True, the return value will be an array of size [2][x], where x is the length return values for one simulation result and array[0] will be the simulation result with load shifting and array[1] will be the result without load shifting.
- getSimRun(initPV=None, initST=None, minuteIntervals=1, nDays=3, exceptOnWaterShortage=True) SimulationRun ¶
Returns a simulationRun object for a simulation of the Ecosizer’s building and system object
- Parameters:
- initPVfloat
Primary volume at start of the simulation
- initSTfloat
Swing tank temperature at start of the simulation. Not used in this instance of the function
- minuteIntervalsint
the number of minutes the duration each interval timestep for the simulation will be
- nDaysint
the number of days the for duration of the entire simulation will be
- exceptOnWaterShortageboolean
Throws an exception if Primary Storage runs out of water. Otherwise returns failed simulation run
- Returns:
- simRunSimulationRun
The object carrying details from the simulation of the system
- getSimRunWithkWCalc(initPV=None, initST=None, minuteIntervals=15, nDays=365, optimizeNLS=False)¶
Returns a list that includes a simulationRun object for a simulation of the Ecosizer’s building and system object with load shifting and without load shifting, also includes the loadshift_capacity and the kGperkWh_saved
- Parameters:
- initPVfloat
Primary volume at start of the simulation
- initSTfloat
Swing tank temperature at start of the simulation. Not used in this instance of the function
- minuteIntervalsint
the number of minutes the duration each interval timestep for the simulation will be
- nDaysint
the number of days the for duration of the entire simulation will be
- optimizeNLSboolean
set to True to optimize non-loadshift sizing. Only applies if kGDiff = True
- Returns:
- simRun_lsSimulationRun
The object carrying details from the simulation of the system with load shifting activated
- simRun_nlsSimulationRun
The object carrying details from the simulation of the system with load shifting deactivated
- loadshift_capacityfloat
Thermal storage capacity of the tank volume between the load up and shed aquastat in kWh
- kGperkWh_savedfloat
Annual reduction in CO2 emissions per kWh of load shift capacity
- annual_kGCO2_savedfloat
Annual CO2 emissions saved by scheduling heat pump to load shift in kg CO2-e
- Raises:
- Exception: Error if system has not been set up for load shifting.
- getSizingResults()¶
Returns the minimum primary volume and heating capacity sizing results
- Returns:
- PVol_G_atStorageTfloat
The volume of the primary storage tank storing DHW at storage tempurature in gallons.
- PCap_kBTUhrfloat
The heating capacity of the primary HPWH in kBTUhr
- TMVol_Gfloat
Available only in systems with a tempurature maintenence system. The volume of the tempurature maintenence system in gallons.
- TMCap_kBTUhrfloat
Available only in systems with a tempurature maintenence system. The heating capacity of the tempurature maintenence system in kBTUhr
- CA_TMVol_Gfloat
Available only in systems with a swing tank. The volume of the swing in gallons as specified by California sizing methods.
- lsSizedPoints()¶
Returns combinations of storage and percent of load shift days covered
- Returns:
- volNarray
Array of storage volume for each number of load up hours.
- CapNarray
Array of heating capacity for each number of load up hours.
- Narray
Array of load up hours tested. Goes from 1 to hour before first shed.
- startIndexint
The position the slider on the graph should start, reflecting the user defined load shift percent
- Raises:
- Exception: Error if system has not been set up for load shifting.
- plotSizingCurve(returnAsDiv=False, returnWithXYPoints=False)¶
Returns a plot of the valid storage and capacity combinations.
- Parameters:
- return_as_divboolean
A logical on the output, as a div string (true) or as a figure (false)
- returnWithXYPointsboolean
set to true to return the plot in addition to arrays of x and y coordinates for the sizing curve
- Returns:
- plotplotly.Figure -OR- <div> string
The sizing curve graph with slider. Return type depends on value of return_as_div parameter. If the system has a load shifting element, the graph will plot Percent of Load Shift Days Covered vs. Storage Volume. Otherwise, it will plot Storage Volume vs. Capacity.
- x_valuesList
List of x axis values of points on the sizing curve. Returned only if returnWithXYPoints set to True.
- y_valuesList
List of y axis values of points on the sizing curve. Returned only if returnWithXYPoints set to True.
- startIndexint
the index in x_values and y_values to start the slider on the sizing curve. Returned only if returnWithXYPoints set to True.
- plotStorageLoadSim(return_as_div=True, initPV=None, initST=None, minuteIntervals=1, nDays=3)¶
Returns a plot of the of the simulation for the minimum sized primary system as a div or plotly figure. Can plot the minute level simulation
- Parameters:
- return_as_div
A logical on the output, as a div string (true) or as a figure (false)
- initPVfloat
Primary volume at start of the simulation
- initSTfloat
Swing tank temperature at start of the simulation. Not used in this instance of the function
- minuteIntervalsint
the number of minutes the duration each interval timestep for the simulation will be
- nDaysint
the number of days the for duration of the entire simulation will be
- Returns:
- plotplotly.Figure -OR- <div> string
The storage load simulation graph. Return type depends on value of return_as_div parameter.
- primaryCurve()¶
Sizes the primary system curve. Will catch the point at which the aquatstat fraction is too small for system and cuts the return arrays to match cutoff point.
- Returns:
- volNarray
Array of volume in the tank at each hour.
- sHrs2kBTUHRarray
Array of heating capacity in kBTU/hr
- heatHoursarray
Array of running hours per day corresponding to primaryHeatHrs2kBTUHR
- recIndexint
The index of the recommended heating rate.
- raisedInletTemp()¶
- Returns:
- raisedInletboolean
Returns True if the system at any point needed to raise inlet water temperature if it was less than minimum in performance map. False otherwise.
- systemCapedInlet()¶
- Returns:
- capedInletboolean
Returns True if the model had to reduce the inlet water temperature to stay within the bounds of the available performance map for the model. False otherwise.
- systemReliedOnEr()¶
- Returns:
- reliedOnERboolean
True if the system relied on electric resistance during it’s last simulation. False otherwise.
- tmReliedOnERboolean
True if the temperature maintenance system relied on electric resistance during it’s last simulation. False otherwise.
- usedHPWHsim()¶
- Returns:
- usedHPWHsimboolean
Returns True if the performance map used was from HPWHsim. False otherwise.
- utilityCalculation(monthly_base_charge, pk_start_hour, pk_end_hour, pk_demand_charge, pk_energy_charge, off_pk_demand_charge, off_pk_energy_charge, start_month=0, end_month=12, csv_path=None, include_dscnt_period=False, dscnt_start_hour=None, dscnt_end_hour=None, discnt_demand_charge=None, discnt_energy_charge=None)¶
- Parameters:
- monthly_base_chargefloat
monthly base charge for having electricity connected ($/month)
- pk_start_hourint (in range 0-23) or list of int (in range 0-23)
start hour of the day which peak demand pricing applies
- pk_end_hourint (in range pk_start_hour-24) or list of int (in range pk_start_hour-24)
end hour of the day which peak demand pricing applies
- pk_demand_chargefloat or list of float
peak demand pricing ($/kW)
- pk_energy_chargefloat or list of float
peak energy pricing ($/kWh)
- off_pk_demand_chargefloat or list of float
off-peak demand pricing ($/kW)
- off_pk_energy_chargefloat or list of float
off-peak energy pricing ($/kWh)
- start_monthint (in range 0-11) or list of int (in range 0-11)
start month for period (defaults to 0)
- end_monthint (in range start_month+1 - 12) or list of int (in range start_month[i]+1 - 12)
end month for period (defaults to 12)
- csv_pathstr
file path to custom pricing csv. Must have three columns titled “Energy Rate ($/kWh)”, “Demand Rate ($/kW)”, “Demand Period”, and “Monthly Base Charge” with appropriate information in each column. Defaults to None
- include_dscnt_periodbool
indicates whether or not the utility billing schedule includes a discounted rate period (such as overnight electrical use in British Columbia)
- dscnt_start_hourint (in range 0-23) or list of int (in range 0-23)
start hour of the day which discount pricing applies
- dscnt_end_hourint (in range pk_start_hour-24) or list of int (in range pk_start_hour-24)
end hour of the day which discount pricing applies
- discnt_demand_chargefloat or list of float
discount pricing ($/kW)
- discnt_energy_chargefloat or list of float
discount pricing ($/kWh)
- Returns:
- simRunSimulationRun
The object carrying details from the simulation of the system
- utility_costfloat
The total annual utility cost for the simulation
- simRun_instantSimulationRun
The object carrying details from a simulation of the system if it was compossed of instantaneous water heaters for comparison
- utility_cost_instantfloat
The total annual utility cost for the simulation of the system if it was compossed of instantaneous water heaters for comparison
- ucUtilityCostTracker
the UtilityCostTracker from the simulation made from user params
- engine.EcosizerEngine.getAnnualSimLSComparison(simRun_ls: SimulationRun, simRun_nls: SimulationRun, return_as_div=True)¶
Returns comparison graph of the input power by hour for an annual load shifting and non loadshifting HPWH simulation
- Parameters:
- simRun_lsSimulationRun
The object carrying details from the simulation of the system with load shifting activated
- simRun_nlsSimulationRun
The object carrying details from the simulation of the system with load shifting deactivated
- return_as_divboolean
A logical on the output, as a div string (true) or as a figure (false)
- Returns:
- plotplotly.Figure OR div string
The annual simulation graph comparing average daily input capacity of the system with load shifting activated and the system with load shifting deactivated.
- engine.EcosizerEngine.getAnnualUtilityComparisonGraph(simRun_hp: SimulationRun, simRun_iwh: SimulationRun, uc: UtilityCostTracker, return_as_div: bool = True, return_as_array: bool = False)¶
Returns comparison graph of the input power by hour for an annual load shifting and non loadshifting HPWH simulation
- Parameters:
- simRun_hpSimulationRun
The object carrying details from the simulation of the system with a heat pump
- simRun_iwhSimulationRun
The object carrying details from the simulation of the system with instantaneous water heaters
- ucUtilityCostTracker
The UtilityCostTracker object carrying details for the annual utility cost plan
- return_as_divboolean
A logical on the output, as a div string (true) or as a figure (false)
- return_as_arrayboolean
A logical on the output, as a set of comparison arrays (true) or as a figure (false)
- Returns:
- plotplotly.Figure OR div string
The annual simulation graph comparing monthly utility costs divided into base costs, demand charges, energy charges.
- engine.EcosizerEngine.getAnnualUtilityComparisonGraph_Canada(simRun_hp: SimulationRun, simRun_iwh: SimulationRun, uc: UtilityCostTracker, return_as_div: bool = True, return_as_array: bool = False, monthly_tier_threshold: float = 675.0, tier_cost_increase: float = 0.0311)¶
Custom comparison graph for canadian utility billing structure.
- Parameters:
- simRun_hpSimulationRun
The object carrying details from the simulation of the system with a heat pump
- simRun_iwhSimulationRun
The object carrying details from the simulation of the system with instantaneous water heaters
- ucUtilityCostTracker
The UtilityCostTracker object carrying details for the annual utility cost plan
- return_as_divboolean
A logical on the output, as a div string (true) or as a figure (false)
- return_as_arrayboolean
A logical on the output, as a set of comparison arrays (true) or as a figure (false)
- monthly_tier_thresholdfloat
The number of kWh a building must surpass in a month to go to tier 2 billing.
- tier_cost_increasefloat
The increase in Energy Rate from tier 1 to tier 2 in dollars
- Returns:
- plotplotly.Figure OR div string
The annual simulation graph comparing monthly utility costs divided into base costs, demand charges, energy charges.
- engine.EcosizerEngine.getHPWHOutputCapacity(model, outdoorAirTemp_F, inletWaterTemp_F, outletWaterTemp_F, num_heatPumps=1, return_as_kW=True, defrost_derate=0.0)¶
Returns the output capacity of the model at the climate temperatures provided
- Parameters:
- modelString
string representing the model_code for the model (see getListOfModels() for information on how to aquire this)
- outdoorAirTemp_Ffloat
The outdoor air temperature in degrees F
- inletWaterTemp_Ffloat
the incoming city water (cold water) temperature in degrees F
- outletWaterTemp_Ffloat
The outlet water (hot storage) temperature in degrees F
- num_heatPumpsint
the number of HPWHs in the system
- return_as_kWboolean
Set to True (default) to return output capacity in kW. Set to False to instead return as kBTU/hr
- defrost_deratefloat
defrost derate at design outdoor air temperature for model. Should be a percent in decimal form between 0.0 and 1.0 (e.g. 40% defrost derate would be 0.40)
- Returns:
- output_capacityfloat
the output capacity of the HPWH system at the climate temperatures provided in either kW or kBTU/hr depending on the value of the return_as_kW parameter
- engine.EcosizerEngine.getListOfModels(multiPass=False, includeResidential=True, excludeModels=[], sgipModelsOnly=True)¶
Static Method to Return all Model Names as a list of strings
- Parameters:
- multiPassboolean
return multi-pass models only (True) or single=pass models only (False)
- includeResidentialboolean
Set to True to include residential HPWH models. Set to False to only include commercial HPWH models.
- excludeModelsList[str]
A list of models you wish to not include in the model list. Defaults to empty list.
- sgipModelsOnlyboolean
Defaults to True. If True, excludes all non-SGIP listed models from the model list
- Returns:
- model_listList[str]
a list of tuples containing strings in the form [model_code, display_name] where model_code is the string to set as the systemModel parameter for EcosizerEngine and display_name is the corresponding friendly display name for that model.
- engine.EcosizerEngine.getSizingCurvePlot(x, y, startind, loadshifting: bool = False, er_sized: bool = False)¶
creates a plotly figure from a list of x and y points and starts the slider at the start index.
- Parameters:
- xList
List of x axis values of points on the sizing curve.
- yList
List of y axis values of points on the sizing curve.
- startindint
the index in x_values and y_values to start the slider on the sizing curve.
- loadshiftingboolean
Indicates whether the resulting plot should be for a load shifting system (plotting Percent of Load Shift Days Covered vs. Storage Volume) or non-load shifting system (plotting Storage Volume vs. Capacity)
- er_sizedboolean
Indicates whether the resulting plot should be for Electric Resistance trade off sizing
- Returns:
- plotplotly.Figure
The sizing curve graph. If loadshifting parameter is set to True, the graph will label the plot as Percent of Load Shift Days Covered vs. Storage Volume. Otherwise, it will label the plot as Storage Volume vs. Capacity.
- engine.EcosizerEngine.getWeatherStations(exclude_stations=[96])¶
Static Method to Return all weather stations as strings with corresponding climate zones as integers
- Parameters:
- exclude_stationsList[int]
A list of models you wish to not include in the model list. Defaults to empty list.
- Returns:
- weather_stationsList[str]
a list of tuples containing a string and integer in the form [weather_station_name, climate_zone] where weather_station_name is the string representing the weather station name and climate_zone is the corresponding ecosizer climate zone.
- engine.BuildingCreator.createBuilding(incomingT_F, magnitudeStat, supplyT_F, buildingType, loadshape=None, avgLoadshape=None, returnT_F=0, flowRate=0, gpdpp=0, nBR=None, nApt=0, Wapt=0, standardGPD=None, annual=False, zipCode=None, climateZone=None, ignoreRecirc=False, designOAT_F=None) Building ¶
Initializes the building in which the HPWH system will be sized for
- Raises:
- Exception: Error if buildingType is not in list of valid buildingType names.
- Attributes:
- incomingT_Ffloat
The incoming city water temperature on the design day. [°F]
- magnitudeStatint or list
a number that will be used to assess the magnitude of the building based on the building type
- supplyT_Ffloat
The hot water supply temperature.[°F]
- buildingTypestring or list
a string indicating the type of building we are sizing for (e.g. “multi_family”, “office_building”, etc.)
- loadShapendarray
defaults to design load shape for building type.
- avgLoadShapendarray
defaults to average load shape for building type.
- returnT_Ffloat
The water temperature returning from the recirculation loop. [°F]
- flowRatefloat
The pump flow rate of the recirculation loop. (GPM)
- gpdppfloat
The volume of water in gallons at 120F each person uses per dat.[°F]
- nBRarray_like
A list of the number of units by size in the order 0 bedroom units, 1 bedroom units, 2 bedroom units, 3 bedroom units, 4 bedroom units, 5 bedroom units.
- nApt: integer
The number of apartments. Use with Qdot_apt to determine total recirculation losses. (For multi-falmily buildings)
- Wapt: float
Watts of heat lost in through recirculation piping system. Used with N_apt to determine total recirculation losses. (For multi-falmily buildings)
- standardGPDstring
indicates whether to use a standard gpdpp specification for multi-family buildings. Set to None if not using a standard gpdpp.
- annualboolean
indicates whether to use annual loadshape for multi-family buildings
- zipCodeint
the CA zipcode the building resides in to determine the climate zone
- climateZoneint
the CA climate zone the building resides in
- ignoreRecircboolean
Set to true if recirc_losses is irrelevent due to no temperature maintenance system
- designOAT_Ffloat
The design outdoor air temperature for the building.
- engine.SystemCreator.createSystem(schematic, storageT_F, defrostFactor, percentUseable, compRuntime_hr, aquaFract, building=None, doLoadShift=False, aquaFractLoadUp=None, aquaFractShed=None, loadUpT_F=None, loadShiftPercent=1, loadShiftSchedule=None, loadUpHours=None, safetyTM=1.75, setpointTM_F=135, TMonTemp_F=120, offTime_hr=0.333, PVol_G_atStorageT=None, PCap_kBTUhr=None, TMVol_G=None, TMCap_kBTUhr=None, systemModel=None, numHeatPumps=None, tmModel=None, tmNumHeatPumps=None, inletWaterAdjustment=None, ignoreShortCycleEr=False, useHPWHsimPrefMap=False, sizeAdditionalER=True, additionalERSaftey=1.0) SystemConfig ¶
Initializes and sizes the HPWH system. Both primary and tempurature maintenance (for parrallel loop and swing tank) are set up in this function.
- Raises:
- Exception: Error if schematic is not in list of valid schematic names.
- Attributes:
- schematicString
Indicates schematic type. Valid values are ‘swingtank’, ‘paralleltank’, ‘multipass’, and ‘primary’
- storageT_Ffloat
The hot water storage temperature. [°F]
- defrostFactorfloat
A multipier used to account for defrost in the final heating capacity. Default equals 1.
- percentUseablefloat
The fraction of the storage volume that can be filled with hot water.
- compRuntime_hrfloat
The number of hours the compressor will run on the design day. [Hr]
- aquaFract: float
The fraction of the total height of the primary hot water tanks at which the Aquastat is located.
- buildingBuilding
Building object the HPWH system will be sized for.
- doLoadShiftboolean
Set to true if doing loadshift
- aquaFractLoadUpfloat
The fraction of the total height of the primary hot water tanks at which the load up aquastat is located.
- aquaFractShedfloat
The fraction of the total height of the primary hot water tanks at which the shed aquastat is located.
- loadUpT_Ffloat
The hot water storage temperature between the normal and load up aquastat. [°F]
- loadShiftPercent: float
Percentage of days the load shift will be met
- loadShiftSchedulearray_like
List or array of 0’s and 1’s for don’t run and run respectively. Used for load shifting
- loadUpHoursfloat
Number of hours spent loading up for first shed.
- safetyTMfloat
The saftey factor for the temperature maintenance system.
- setpointTM_Ffloat
The setpoint of the temprature maintence tank. Defaults to 130 °F.
- TMonTemp_Ffloat
The temperature where parallel loop tank will turn on. Defaults to 120 °F.
- offTime_hr: integer
Maximum hours per day the temperature maintenance equipment can run.
- PVol_G_atStorageTfloat
For pre-sized systems, the total/maximum storage volume for water at storage temperature for the system in gallons
- PCap_kBTUhrfloat
For pre-sized systems, the output capacity for the system in kBTUhr
- TMVol_Gfloat
For applicable pre-sized systems, the temperature maintenance volume for the system in gallons
- TMCap_kBTUhrfloat
For applicable pre-sized systems, the output capacity for temperature maintenance for the system in kBTUhr
- systemModelString
The make/model of the HPWH being used.
- numHeatPumpsint
The number of heatpumps the HPWH model is using
- tmModelString
The make/model of the HPWH being used for the temperature maintenance system.
- tmNumHeatPumpsint
The number of heat pumps on the temperature maintenance system
- inletWaterAdjustmentfloat
adjustment for inlet water temperature fraction for primary recirculation systems
- ignoreShortCycleErboolean
ignores errors for short cycling (when the AQ fract is too low in the system). The engineer should be informed to use multiple heat pumps to avoid shortcycling if they are overriding short cycling errors
- useHPWHsimPrefMapboolean
if available for the HPWH model in systemModel and/or tmModel, the system will use the preformance map from HPWHsim if useHPWHsimPrefMap is set to True. Otherwise, it will use the most recent data model.
- sizeAdditionalERboolean
if set to True for a swingtank_er schematic, will size for additional ER element. False if there is no need to size additional ER for swingtank_er schematic
- additionalERSafteyfloat
applicable for ER trade off swing tank only. Saftey factor to apply to additional electric resistance sizing
- class objects.SimulationRun.SimulationRun(hwGenRate, hwDemand, V0, pV, building: Building, loadShiftSchedule, minuteIntervals=1, doLoadshift=False, LS_sched=[])¶
- Attributes:
- hwGenRatelist
The generation of HW with time at the supply temperature
- hwDemandlist
The hot water demand with time at the supply temperature
- V0float
The storage volume of the primary system at the storage temperature
- pVlist
Volume of HW in the tank with time at the storage temperature. Initialized to array of 0s with pV[0] set to V0
- buildingBuilding
the Building object the simulation will be run for
- minuteIntervalsint
the minutes per time interval for the simulation. Only 1, 15, and 60 are accepted
- doLoadshiftboolean
set to True if doing loadshift
- LS_schedlist
list length 24 corresponding to hours of the day filled with ‘N’ for normal, ‘L’ for load up, and ‘S’ for shed
Methods
addCap
(out_cap_value, in_cap_value)adds calculated capacity values to the simulation at timestep
addHWGen
(hwGen)add a calculated hot water generation value to the simulation
addKGCO2
(kGCO2_value)add a calculated kGCO2 emission value to the simulation
addOat
(oat_value)adds outdoor air temperature (F) to the simulation at timestep
addTMCap
(out_tm_cap_value, in_tm_cap_value)adds calculated capacity values for temperature maintenance sysyem to the simulation at timestep
createUtilityCostColumns
(uc[, ...])- Parameters:
Returns recirculation loss from primary system at supply temp at interval i in gallons
getAnnualCOP
([boundryMethod])Returns annual COP for the simulation
getCapIn
([i])Returns a list of the input capacity in kW for the primary system at every timestep or, if i is defined, returns index i of that list
getCapOut
([i])Returns a list of the output capacity in kW for the primary system at every timestep or, if i is defined, returns index i of that list
- Parameters:
getHWDemand
([i])Returns a list from the simulation of the hot water demand by timestep or, if i is defined, returns index i of that list
getHWGeneration
([i])Returns a list from the simulation of the theoretical hot water generation of the primary tank at supply temperature by timestep or, if i is defined, returns index i of that list
returns incoming water temperature (F) at interval i of the simulation
returns the load shifting setting at interval i of the simulation
getOAT
()Returns a list from the simulation of the Outdoor Air Temperature in (F) by timestep
getPrimaryCOP
([i])Returns a list of COP values for the primary system at every timestep or, if i is defined, returns index i of that list
getPrimaryGeneration
([i])Returns a list from the simulation of the actual hot water generation of the primary tank by timestep
getPrimaryRun
([i])Returns a list from the simulation of the amount of time the primary tank is running in minutes per timestep or, if i is defined, returns index i of that list
getPrimaryVolume
([i])Returns a list from the simulation of the volume of the primary tank by timestep or, if i is defined, returns index i of that list
getRecircLoss
([i])Returns list of recirculation loss from primary system at supply temp in gallons at every interval in simulation
getTMCOP
([i])Returns a list of COP values for the temperature maintenance system at every timestep or, if i is defined, returns index i of that list
getTMCapIn
([i])Returns a list of the input capacity in kW for the temperature maintenance system at every timestep or, if i is defined, returns index i of that list
getTMCapOut
([i])Returns a list of the output capacity in kW for the temperature maintenance system at every timestep or, if i is defined, returns index i of that list
getTMRun
([i])Returns a list from the simulation of the amount of time the temperature maintenance tank is running in minutes per timestep or, if i is defined, returns index i of that list
Returns a list from the simulation of the temperature maintenance tank temperature in (F) by timestep
gethwOutSwing
([i])Returns a list from the simulation of the amount of water coming out of the swing tank at tempurature in gallons by timestep or, if i is defined, returns index i of that list
getkGCO2
([i])Returns a list from the simulation of the get output of CO2 by timestep in kilograms or, if i is defined, returns index i of that list
Returns the sum from the simulation of the output of CO2 in kilograms
initializeTMValue
(initST, supplyT_F, ...[, ...])Initializes temperature maintenance values
passedCOPAssumptionThreshold
(times_COP_assumed)returns True if COP has been assumed more times than the threshold.
plotStorageLoadSim
([return_as_div, numDays])Returns a plot of the of the simulation for the minimum sized primary system as a div or plotly figure.
returnSimResult
([kWhCalc])*LEGACY FUNCTION* to be depricated.
writeCSV
(file_path)writes all simulation data to a formated csv
getAnnualUtilityCost
- addCap(out_cap_value, in_cap_value)¶
adds calculated capacity values to the simulation at timestep
- Parameters:
- out_cap_valuefloat
float representing the primary system’s output capacity in kW during current timestep.
- in_cap_valuefloat
float representing the primary system’s input capacity in kW during current timestep.
- Raises:
- Exception: Error if out_cap_value or in_cap_value contains the wrong data type
- addHWGen(hwGen)¶
add a calculated hot water generation value to the simulation
- Parameters:
- hwGenfloat
float representing the amount of hot water generated at supply temperature in gallons during current timestep.
- Raises:
- Exception: Error if hwGen contains wrong data type
- addKGCO2(kGCO2_value)¶
add a calculated kGCO2 emission value to the simulation
- Parameters:
- kGCO2_valuefloat
float representing the amount of CO2 emitted in kg during the current time step for later use in kgCO2 calculation.
- Raises:
- Exception: Error if kGCO2_value contains wrong data type
- addOat(oat_value)¶
adds outdoor air temperature (F) to the simulation at timestep
- Parameters:
- oat_valuefloat
float representing the outdoor air temperature (F) current timestep.
- Raises:
- Exception: Error if oat_value contains the wrong data type
- addTMCap(out_tm_cap_value, in_tm_cap_value)¶
adds calculated capacity values for temperature maintenance sysyem to the simulation at timestep
- Parameters:
- out_tm_cap_valuefloat
float representing the temperature maintenance system’s output capacity in kW during current timestep.
- in_tm_cap_valuefloat
float representing the temperature maintenance system’s input capacity in kW during current timestep.
- Raises:
- Exception: Error if out_tm_cap_value or in_tm_cap_value contains the wrong data type
- createUtilityCostColumns(uc: UtilityCostTracker, monthly_tier_threshold=0.0, tier_cost_increase=0.0)¶
- Parameters:
- ucUtilityCostTracker
The UtilityCostTracker object carrying details for the annual utility cost plan
- monthly_tier_thresholdfloat
The number of kWh a building must surpass in a month to go to tier 2 billing.
- tier_cost_increasefloat
The increase in Energy Rate from tier 1 to tier 2 in dollars
- generateRecircLoss(i: int)¶
Returns recirculation loss from primary system at supply temp at interval i in gallons
- Parameters:
- iint
interval of the simulation
- Returns:
- recirculationLossfloat
the recirculation loss from primary system at supply temp at interval i in gallons
- Raises:
- Exception: Error if attempt is made to find recirculation loss outside of scope of simulation
- getAnnualCOP(boundryMethod=False)¶
Returns annual COP for the simulation
- Parameters:
- boundryMethodboolean
set to True to use boundry method to compute COP
- Returns:
- COPfloat
the COP value for the system over the annual simulation
- getCapIn(i: int = None)¶
Returns a list of the input capacity in kW for the primary system at every timestep or, if i is defined, returns index i of that list
- Parameters:
- iint
interval of the simulation
- Returns:
- capacityIn_kWfloat
the input capacity in kW for the primary system at interval i in gallons or the entire list of input capacity in kW at every interval if i is undefined
- getCapOut(i: int = None)¶
Returns a list of the output capacity in kW for the primary system at every timestep or, if i is defined, returns index i of that list
- Parameters:
- iint
interval of the simulation
- Returns:
- capacityOut_kWfloat
the output capacity in kW for the primary system at interval i in gallons or the entire list of output capacity in kW at every interval if i is undefined
- getDemandChargeMaps(uc: UtilityCostTracker)¶
- Parameters:
- ucUtilityCostTracker
The UtilityCostTracker object carrying details for the annual utility cost plan
- Returns
- ——-
- period_max_kwmap
a mapping from each demand period to the max average kW draw in that demand period
- period_last_hourmap
a mapping from each demand period to the last hour in that demand period
- getHWDemand(i=None)¶
Returns a list from the simulation of the hot water demand by timestep or, if i is defined, returns index i of that list
- Parameters:
- iint
interval of the simulation
- Returns:
- volumefloat
the hot water demand in gallons at interval i or the entire list of hot water demand at every interval if i is undefined
- getHWGeneration(i=None)¶
Returns a list from the simulation of the theoretical hot water generation of the primary tank at supply temperature by timestep or, if i is defined, returns index i of that list
- Parameters:
- iint
interval of the simulation
- Returns:
- volumefloat
the theoretical hot water generation of the primary tank at supply temperature in gallons at interval i or the entire list of theoretical hot water generation at every interval if i is undefined
- getIncomingWaterT(i)¶
returns incoming water temperature (F) at interval i of the simulation
- Parameters:
- iint
interval of the simulation
- Returns:
- waterT_Ffloat
The incoming water temperature (F) at interval i of the simulation
- getLoadShiftMode(i)¶
returns the load shifting setting at interval i of the simulation
- Parameters:
- iint
interval of the simulation
- Returns:
- loadshiftModestring
The load shift mode of the system at interval i. Returns ‘N’, ‘L’, or ‘S’ for normal, load, or shed mode respectively
- getOAT()¶
Returns a list from the simulation of the Outdoor Air Temperature in (F) by timestep
- Parameters:
- iint
interval of the simulation
- Returns:
- oatfloat
the Outdoor Air Temperature in (F) at interval i or the entire list of Outdoor Air Temperature in (F) at every interval if i is undefined
- getPrimaryCOP(i: int = None)¶
Returns a list of COP values for the primary system at every timestep or, if i is defined, returns index i of that list
- Parameters:
- iint
interval of the simulation
- Returns:
- COPfloat
the input capacity in kW for the primary system at interval i in gallons or the entire list of input capacity in kW at every interval if i is undefined
- getPrimaryGeneration(i=None)¶
Returns a list from the simulation of the actual hot water generation of the primary tank by timestep
- Parameters:
- iint
interval of the simulation
- Returns:
- volumefloat
the actual hot water generation at supply temperature in gallons at interval i or the entire list of actual hot water generation at every interval if i is undefined
- getPrimaryRun(i=None)¶
Returns a list from the simulation of the amount of time the primary tank is running in minutes per timestep or, if i is defined, returns index i of that list
- Parameters:
- iint
interval of the simulation
- Returns:
- minutesfloat
the amount of time the primary tank is running in minutes at interval i or the entire list of amount of time the primary tank is running in minutes at every interval if i is undefined
- getPrimaryVolume(i=None)¶
Returns a list from the simulation of the volume of the primary tank by timestep or, if i is defined, returns index i of that list
- Parameters:
- iint
interval of the simulation
- Returns:
- volumefloat
the primary tank volume in gallons at interval i or the entire list of primary tank volume at every interval if i is undefined
- getRecircLoss(i: int = None)¶
Returns list of recirculation loss from primary system at supply temp in gallons at every interval in simulation
- Parameters:
- iint
interval of the simulation
- Returns:
- recirculationLossfloat
the recirculation loss from primary system at supply temp at interval i in gallons or the entire list of recirculation losses at every interval if i is undefined
- getTMCOP(i: int = None)¶
Returns a list of COP values for the temperature maintenance system at every timestep or, if i is defined, returns index i of that list
- Parameters:
- iint
interval of the simulation
- Returns:
- tm_COPfloat
the input capacity in kW for the primary system at interval i in gallons or the entire list of input capacity in kW at every interval if i is undefined
- getTMCapIn(i: int = None)¶
Returns a list of the input capacity in kW for the temperature maintenance system at every timestep or, if i is defined, returns index i of that list
- Parameters:
- iint
interval of the simulation
- Returns:
- capacityIn_kWfloat
the input capacity in kW for the temperature maintenance system at interval i in gallons or the entire list of input capacity in kW at every interval if i is undefined
- getTMCapOut(i: int = None)¶
Returns a list of the output capacity in kW for the temperature maintenance system at every timestep or, if i is defined, returns index i of that list
- Parameters:
- iint
interval of the simulation
- Returns:
- capacityOut_kWfloat
the output capacity in kW for the temperature maintenance system at interval i in gallons or the entire list of output capacity in kW at every interval if i is undefined
- getTMRun(i: int = None)¶
Returns a list from the simulation of the amount of time the temperature maintenance tank is running in minutes per timestep or, if i is defined, returns index i of that list
- Parameters:
- iint
interval of the simulation
- Returns:
- minutesfloat
the amount of time the temperature maintenance tank is running in minutes at interval i or the entire list of amount of time the temperature maintenance tank is running in minutes at every interval if i is undefined
- getTMTemp()¶
Returns a list from the simulation of the temperature maintenance tank temperature in (F) by timestep
- Returns:
- temperaturefloat
the temperature maintenance tank temperature in (F) at interval i or the entire list of temperature maintenance tank temperature in (F) at every interval if i is undefined
- gethwOutSwing(i: int = None)¶
Returns a list from the simulation of the amount of water coming out of the swing tank at tempurature in gallons by timestep or, if i is defined, returns index i of that list
- Parameters:
- iint
interval of the simulation
- Returns:
- volumefloat
the amount of water coming out of the swing tank at tempurature in gallons at interval i or the entire list of amount of water coming out of the swing tank at tempurature in gallons at every interval if i is undefined
- getkGCO2(i: int = None)¶
Returns a list from the simulation of the get output of CO2 by timestep in kilograms or, if i is defined, returns index i of that list
- Parameters:
- iint
interval of the simulation
- Returns:
- CO2float
the output of CO2 in kilograms at interval i or the entire list of output of CO2 in kilograms at every interval if i is undefined
- getkGCO2Sum()¶
Returns the sum from the simulation of the output of CO2 in kilograms
- Returns:
- CO2float
the sum from the simulation of the output of CO2 in kilograms
- initializeTMValue(initST, supplyT_F, TMCap_kBTUhr, swingOut=True)¶
Initializes temperature maintenance values
- Parameters:
- initSTfloat
temperature maintenance tank temperature at start of the simulation.
- supplyT_Ffloat
storage temperature setpoint for temperature maintenance system
- TMCap_kBTUhrfloat
temperature maintenance heating capacity in kBTUhr
- swingOutboolean
set to True for swing tank systems so that DHW leaving temperature maintenance system is recorded
- passedCOPAssumptionThreshold(times_COP_assumed: int)¶
returns True if COP has been assumed more times than the threshold. False Otherwise.
- plotStorageLoadSim(return_as_div=True, numDays=1)¶
Returns a plot of the of the simulation for the minimum sized primary system as a div or plotly figure. Can plot the minute level simulation
- Parameters:
- return_as_divboolean
A logical on the output, as a div (true) or as a figure (false)
- Returns:
- plotplotly.Figure -OR- <div> string
The storage load simulation graph. Return type depends on value of return_as_div parameter.
- returnSimResult(kWhCalc=False)¶
*LEGACY FUNCTION* to be depricated.
- writeCSV(file_path)¶
writes all simulation data to a formated csv
- Parameters:
- file_pathstring
the file path for the output csv file
- class objects.PrefMapTracker.PrefMapTracker(defaultCapacity_kBTUhr=None, modelName=None, kBTUhr=False, numHeatPumps=None, isMultiPass=False, designOAT_F: float = None, designIncomingT_F: float = None, designOutT_F: float = None, usePkl=True, prefMapOnly=False, erBaseline=False, hxTempIncrease=None)¶
An object that uses the preformance map data of varrious models to accuratly predict the kW input and output of HPWH systems under different climates and temperatures.
- Attributes:
- defaultCapacity_kBTUhrfloat
the default output capacity for the system in kBTUhr
- modelNameString
The string name for the HPWH model. Must match one of the model names in maps.json. If set to None, this will be a default generic HPWH with a COP of 2.5
- kBTUhrboolean
Set to True to return input and output capacity in kBTUhr, set to False to return in kW
- numHeatPumpsint
the Number of heat pumps in the system. If set to None, will be autosized to produce defaultCapacity_kBTUhr output capacity. If auto-sizing the number of heat pumps for extreme weather environments outside of available preformance map scope, you will also need to enter parameters for designOAT_F, designIncomingT_F, and designOutT_F to ensure no exceptions occur.
- isMultiPassboolean
Set to True for multipass systems, set to False for singlepass
- designOAT_Ffloat
The worst-case outdoor air temperature for the climate the preformance map is being tested in. This ensures number of heat pumps is auto-sized appropriatly
- designIncomingT_Ffloat
The worst-case inlet water temperature for the climate the preformance map is being tested in. This ensures number of heat pumps is auto-sized appropriatly
- designOutT_Ffloat
The worst-case outlet water temperature for the system the preformance map is being tested in. This ensures number of heat pumps is auto-sized appropriatly
- usePklboolean
Default to True. Set to True to use most recent preformance map model. Set to false to use HPWHsim model
- prefMapOnlyboolean
Set to True when not using preformance map in te larger EcoEngine system. This provides some shortcuts to avoid certain error handling
- erBaselineboolean
Set to true to indicate this preformance map is meant to model a ER system with a COP of 1
- hxTempIncreaseint
The amount of to increase the inlet and outlet water temperatures for models with heat exchangers. If set to None, the temperature will increase by the amount in the performance map configuration (../data/preformanceMaps/maps.json) file for the model
Methods
Returns True if the model had to reduce the inlet water temperature to stay within the bounds of the available performance map for the model
Returns True if the model had to rely on Electric Resistance at any point during the simulation (e.g.
getCapacity
(externalT_F, condenserT_F, outT_F)Returns the current output capacity of of the HPWH model for the simulation given external and condesor temperatures.
getDefaultCapacity
([AsKBTUhr])Returns default capacity for the system in kBTUhr Inputs ------ AsKBTUhr : Boolean Set to False to return as kW. True (default) returns as kBTUhr :returns: The default output capacity of the model in kW or kBTUhr :rtype: defaultCapacity.
The function will return an array of flag values for various circumstances in which the performance map may have extrapolated to return input and output capacities for climate parameters.
Returns maximum storage temperature acheivable at OAT, regardless of inlet water temp.
returns the minimum OAT in the available performance map.
Sets the reliedOnER and capedInlet fields to False to so that a new simulation can be run on the model
getMaxStorageTempAtNearestOATandInlet
getMinStorageTempAtNearestOATandInlet
setPrefMap
- didCapInlet()¶
Returns True if the model had to reduce the inlet water temperature to stay within the bounds of the available performance map for the model
- didRelyOnEr()¶
Returns True if the model had to rely on Electric Resistance at any point during the simulation (e.g. when the outdoor tempuratures were too cold for the HPWH to work)
- getCapacity(externalT_F, condenserT_F, outT_F, sizingNumHP=False, fallbackCapacity_kW=None)¶
Returns the current output capacity of of the HPWH model for the simulation given external and condesor temperatures. If no HPWH model has been set, returns the default output capacity of the system.
- getDefaultCapacity(AsKBTUhr=True)¶
Returns default capacity for the system in kBTUhr Inputs —— AsKBTUhr : Boolean
Set to False to return as kW. True (default) returns as kBTUhr
- Returns:
The default output capacity of the model in kW or kBTUhr
- Return type:
defaultCapacity
- getExtrapolationFlags()¶
The function will return an array of flag values for various circumstances in which the performance map may have extrapolated to return input and output capacities for climate parameters. All values in the array will be integers, 0 if the performance map has not extrapolated in this way since it was last reset, or a non-zero integer representing if the performance map has extrapolated or the number of times it has extrapolated in this way since it was last reset.
- Returns:
- reliedOnER
Indicates if the system at any point needed to rely on Electric Resistance during the simulation (0 or 1)
- capedInlet
Indicates if the system at any point needed to shrink inlet water temperature if it was higher than maximum in performance map (0 or 1)
- raisedInletTemp
Indicates if the system at any point needed to raise inlet water temperature if it was less than minimum in performance map (0 or 1)
- assumedHighDefaultCap
Indicates if the system at any point needed to OAT if it was higher than maximum in performance map and needed to assume default high temp in and out capacity values (0 or 1)
- timesAssumedCOP
The number of times a system has assumed a COP of 1.5 during a simulation due to performance map constraints
- timesForcedCOP
The number of times a system had to alter the climate parameters to fit into the boundaries of the performance map to produce a input and output capacity
- timeStorageTempNeedToBeLowered
The number of times a system had to lower the storage temperature to fit into the boundaries of the performance map to produce a input and output capacity
- getMaxStorageTempAtNearestOAT(oat_F)¶
Returns maximum storage temperature acheivable at OAT, regardless of inlet water temp. If there is no available linear interpolation perfomance map, infinity is returned.
- getOatMin()¶
returns the minimum OAT in the available performance map.
- resetFlags()¶
Sets the reliedOnER and capedInlet fields to False to so that a new simulation can be run on the model
- class objects.UtilityCostTracker.UtilityCostTracker(monthly_base_charge=None, pk_start_hour=None, pk_end_hour=None, pk_demand_charge=None, pk_energy_charge=None, off_pk_demand_charge=None, off_pk_energy_charge=None, start_month=0, end_month=12, csv_path=None, include_dscnt_period=False, dscnt_start_hour=None, dscnt_end_hour=None, discnt_demand_charge=None, discnt_energy_charge=None)¶
- Attributes:
- monthly_base_chargefloat
monthly base charge for having electricity connected ($/month)
- pk_start_hourint (in range 0-23) or list of int (in range 0-23)
start hour of the day which peak demand pricing applies
- pk_end_hourint (in range pk_start_hour-24) or list of int (in range pk_start_hour-24)
end hour of the day which peak demand pricing applies
- pk_demand_chargefloat or list of float
peak demand pricing ($/kW)
- pk_energy_chargefloat or list of float
peak energy pricing ($/kWh)
- off_pk_demand_chargefloat or list of float
off-peak demand pricing ($/kW)
- off_pk_energy_chargefloat or list of float
off-peak energy pricing ($/kWh)
- start_monthint (in range 0-11) or list of int (in range 0-11)
start month for period (defaults to 0)
- end_monthint (in range start_month+1 - 12) or list of int (in range start_month[i]+1 - 12)
end month for period (defaults to 12)
- csv_pathstr
file path to custom pricing csv. Must have three columns titled “Energy Rate ($/kWh)”, “Demand Rate ($/kW)”, “Demand Period”, and “Monthly Base Charge” with appropriate information in each column. Defaults to None. Note that Demand Periods with odd numbered labels will be assumed to be peak periods while even-numbered periods will be assumed as off-peak
- include_dscnt_periodbool
indicates whether or not the utility billing schedule includes a discounted rate period (such as overnight electrical use in British Columbia)
- dscnt_start_hourint (in range 0-23) or list of int (in range 0-23)
start hour of the day which discount pricing applies
- dscnt_end_hourint (in range pk_start_hour-24) or list of int (in range pk_start_hour-24)
end hour of the day which discount pricing applies
- discnt_demand_chargefloat or list of float
discount pricing ($/kW)
- discnt_energy_chargefloat or list of float
discount pricing ($/kWh)
Methods
exportAnnualCSV
(csv_path[, return_as_array])- Parameters:
getDemandChargeForPeriod
(period_key, max_avg_kW)- Parameters:
getDemandPricingPeriod
(i, minuteIntervals)- Parameters:
getEnergyChargeAtInterval
(i, minuteIntervals)- Parameters:
- Returns:
getAllDemandPeriodKeys
isIntervalInPeriod
- exportAnnualCSV(csv_path: str, return_as_array: bool = False)¶
- Parameters:
- csv_pathstr
the file path for the output csv file
- return_as_arraybool
returns as an array representation of the Utility Cost Tracker instead of outputting a csv
- Returns:
- output_arraylist
a csv list form of the annual CSV if return_as_array is set to True. This is a list of lists length 8760x5 where for every hour i in range(0,8760)… output_array[i+1][0] is a string representation of the date, output_array[i+1][1] is the demand period, output_array[i+1][2] is the Energy Rate ($/kWh) of the demand period if i is the first hour in the demand period, output_array[i+1][3] is the Demand Rate ($/kW) of the demand period if i is the first hour in the demand period, output_array[1][4] is the monthly base charge applicable to the entire year
- getDemandChargeForPeriod(period_key, max_avg_kW)¶
- Parameters:
- period_keyint
The key for the demand period in the UtilityCostTracker
- max_avg_kWfloat
the maximum average kW draw durring the demand period
- Returns:
- costfloat
The total dollar amount that will be charged for the demand period
- getDemandPricingPeriod(i, minuteIntervals)¶
- Parameters:
- iint
The interval number from a simulation
- minuteIntervalsint
the minutes per time interval for the simulation.
- Returns:
- demand_period_keyint
The demand period key for the interval. Use this key in the getDemandChargeForPeriod() function to get demand period cost.
- getEnergyChargeAtInterval(i, minuteIntervals)¶
- Parameters:
- iint
The interval number from a simulation
- minuteIntervalsint
the minutes per time interval for the simulation.
- Returns:
- energy_chargefloat
The energy charge rate for the interval in dollars per kWh
- getYearlyBaseCharge()¶
- Returns:
- chargefloat
The anual base energy charge in dollars