Skip to content

Commit

Permalink
derUtilityCost: Added separate Refrigerator and Water Heater function…
Browse files Browse the repository at this point in the history
…ality.
  • Loading branch information
astronobri committed Jan 28, 2025
1 parent 8bb714b commit 7aba76a
Show file tree
Hide file tree
Showing 2 changed files with 152 additions and 33 deletions.
154 changes: 124 additions & 30 deletions omf/models/derUtilityCost.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<input type="text" id="longitude" name="longitude" value="{{allInputDataDict.longitude}}" pattern="^\-?\d+\.?\d*?$" required="required"/>
</div>
<div class="shortInput">
<label class="tooltip">Year<span class="classic">Specify the year to which the load shape values corresond.</span></label>
<label class="tooltip">Year<span class="classic">Specify the year that the Demand Curve and Temperature Curve values correspond to.</span></label>
<input type="text" id="year" name="year" value="{{allInputDataDict.year}}" pattern="^\d{4}$" required="required"/>
</div>

Expand Down Expand Up @@ -117,31 +117,6 @@
<input type="text" id="discountRate" name="discountRate" value="{{allInputDataDict.discountRate}}" pattern="[1-9][0-9]{0,2}" required="required">
</div>

<!-- Fossil Fuel Generator Inputs -->
<div class="wideInput">
<p class="inputSectionHeader">Utility-Owned Fossil Fuel Generator Device Inputs</p>
</div>
<hr style="border-style: solid; border-color: #196b12; margin-top: 10px;">
<div class="shortInput">
<label class="tooltip">Enable Use of Fossil Fuel Generator?<span class="classic">If yes, model will run with a fossil fuel generator.</span></label>
<select id="fossilGenerator" name="fossilGenerator" value="{{allInputDataDict.fossilGenerator}}">
<option value='Yes' {{ 'selected' if allInputDataDict.fossilGenerator == 'Yes' }}>Yes</option>
<option value='No' {{ 'selected' if allInputDataDict.fossilGenerator == 'No' }}>No</option>
</select>
</div>
<div class="shortInput">
<label class="tooltip"> Existing Size (kW)<span class="classic">Specify the size (kW) of the existing fossil fuel generator owned by the utility.</span></label>
<input type="text" id="existing_gen_kw" name="existing_gen_kw" value="{{allInputDataDict.existing_gen_kw}}" required="required"/>
</div>
<div class="shortInput">
<label class="tooltip"> Available Fuel (gal)<span class="classic">Specify the amount of generator fuel available (gal).</span></label>
<input type="text" id="fuel_available_gal" name="fuel_available_gal" value="{{allInputDataDict.fuel_available_gal}}" required="required"/>
</div>
<div class="shortInput">
<label class="tooltip"> Fuel Cost ($/gal)<span class="classic">Specify the cost of fuel used for the generator ($/gal).</span></label>
<input type="text" id="fuel_cost_per_gal" name="fuel_cost_per_gal" value="{{allInputDataDict.fuel_cost_per_gal}}" required="required"/>
</div>

<!-- Chemical BESS Inputs -->
<div class="wideInput">
<p class="inputSectionHeader">Home Chemical Energy Storage Device Inputs</p>
Expand All @@ -168,7 +143,32 @@
<input type="text" id="BESS_kwh" name="BESS_kwh" value="{{allInputDataDict.BESS_kwh}}" required="required"/>
</div>

<!-- Thermal Storage (vbatDispatch) Inputs -->
<!-- Fossil Fuel Generator Inputs -->
<div class="wideInput">
<p class="inputSectionHeader">Utility-Owned Fossil Fuel Generator Device Inputs</p>
</div>
<hr style="border-style: solid; border-color: #196b12; margin-top: 10px;">
<div class="shortInput">
<label class="tooltip">Enable Use of Fossil Fuel Generator?<span class="classic">If yes, model will run with a fossil fuel generator.</span></label>
<select id="fossilGenerator" name="fossilGenerator" value="{{allInputDataDict.fossilGenerator}}">
<option value='Yes' {{ 'selected' if allInputDataDict.fossilGenerator == 'Yes' }}>Yes</option>
<option value='No' {{ 'selected' if allInputDataDict.fossilGenerator == 'No' }}>No</option>
</select>
</div>
<div class="shortInput">
<label class="tooltip"> Existing Size (kW)<span class="classic">Specify the size (kW) of the existing fossil fuel generator owned by the utility.</span></label>
<input type="text" id="existing_gen_kw" name="existing_gen_kw" value="{{allInputDataDict.existing_gen_kw}}" required="required"/>
</div>
<div class="shortInput">
<label class="tooltip"> Available Fuel (gal)<span class="classic">Specify the amount of generator fuel available (gal).</span></label>
<input type="text" id="fuel_available_gal" name="fuel_available_gal" value="{{allInputDataDict.fuel_available_gal}}" required="required"/>
</div>
<div class="shortInput">
<label class="tooltip"> Fuel Cost ($/gal)<span class="classic">Specify the cost of fuel used for the generator ($/gal).</span></label>
<input type="text" id="fuel_cost_per_gal" name="fuel_cost_per_gal" value="{{allInputDataDict.fuel_cost_per_gal}}" required="required"/>
</div>

<!-- Air Conditioner (vbatDispatch) Inputs -->
<div class="wideInput">
<p class="inputSectionHeader">Home Air Conditioner Device Inputs</p>
</div>
Expand Down Expand Up @@ -219,7 +219,7 @@
</div>


<!-- Heat Pump Thermal Storage (vbatDispatch) Inputs -->
<!-- Heat Pump (vbatDispatch) Inputs -->
<div class="wideInput">
<p class="inputSectionHeader">Home Heat Pump Device Inputs</p>
</div>
Expand Down Expand Up @@ -268,9 +268,103 @@
<input type="text" id="TESS_operationalCosts_onetime_hp" name="TESS_operationalCosts_onetime_hp" value="{{allInputDataDict.TESS_operationalCosts_onetime_hp}}" pattern="^\d+\.?\d*?$" required="required"/>
</div>

<!-- Refrigerator (vbatDispatch) Inputs -->
<div class="wideInput">
<p class="inputSectionHeader">Home Refrigerator Device Inputs</p>
</div>
<hr style="border-style: solid; border-color: #196b12; margin-top: 10px;">
<div class="shortInput">
<label class="tooltip">Enable Refrigerator?<span class="classic">If yes, model will run with a home refrigerator.</span></label>
<select id="load_type_rf" name="load_type_rf" value="{{allInputDataDict.load_type_rf}}">
<option value="3" {{ 'selected' if allInputDataDict.load_type_rf == '3' }}>Yes</option>
<option value="0" {{ 'selected' if allInputDataDict.load_type_rf == '0' }}>No</option>
</select>
</div>
<div class="shortInput">
<label class="tooltip">Number of Devices<span class="classic">Total number of home thermal devices to simulate.</span></label>
<input type="text" id="number_devices_rf" name="number_devices_rf" value="{{allInputDataDict.number_devices_rf}}" required="required">
</div>
<div class="shortInput">
<label class="tooltip">Rated Power (kW)<span class="classic">Max power per home thermal device. Must be a positive rational number between 0.1 and 7.2.</span></label>
<input type="text" id="power_rf" name="power_rf" value="{{allInputDataDict.power_rf}}" pattern="^\d+\.?\d*?$" required="required">
</div>
<div class="shortInput">
<label class="tooltip">Thermal Capacitance (kWh/&degC)<span class="classic">Capacitance of each home thermal device. Must be between 0.2 and 2.5 with exactly one decimal digit.</span></label>
<input type="text" id="capacitance_rf" name="capacitance_rf" value="{{allInputDataDict.capacitance_rf}}" pattern="^\d+\.?\d*?$" required="required">
</div>
<div class="shortInput">
<label class="tooltip">Thermal Resistance (&degC/kW)<span class="classic">Resistance of each home thermal device. Must be between 1.5 and 140.</span></label>
<input type="text" id="resistance_rf" name="resistance_rf" value="{{allInputDataDict.resistance_rf}}" pattern="^\d+\.?\d*?$" required="required">
</div>
<div class="shortInput">
<label class="tooltip">Coefficient of Performance<span class="classic">Coefficient of performance of each home thermal device. Must be between 1 and 3.5</span></label>
<input type="text" id="cop_rf" name="cop_rf" value="{{allInputDataDict.cop_rf}}" pattern="^\d+\.?\d*?$" required="required">
</div>
<div class="shortInput">
<label class="tooltip">Temperature Setpoint (&degC)<span class="classic">Setpoint for each home thermal device. Must be between 1.7 and 54.</span></label>
<input type="text" id="setpoint_rf" name="setpoint_rf" value="{{allInputDataDict.setpoint_rf}}" pattern="^\d+\.?\d*?$" required="required">
</div>
<div class="shortInput">
<label class="tooltip">Temperature Deadband (&degC)<span class="classic">Deadband for each home thermal device. Must be between 0.125 and 2.</span></label>
<input type="text" id="deadband_rf" name="deadband_rf" value="{{allInputDataDict.deadband_rf}}" pattern="^\d+\.?\d*?$" required="required">
</div>
<div class="shortInput">
<label class="tooltip">Ongoing Operational Costs ($/month)<span class="classic">Specify the monthly ongoing operational costs of controlling all member-consumer home thermal energy storage systems (e.g. the API usage cost per month).</span></label>
<input type="text" id="TESS_operationalCosts_ongoing_rf" name="TESS_operationalCosts_ongoing_rf" value="{{allInputDataDict.TESS_operationalCosts_ongoing_rf}}" pattern="^\d+\.?\d*?$" required="required"/>
</div>
<div class="shortInput">
<label class="tooltip">One-time Operational Costs ($)<span class="classic">Specify the total one-time operational costs of controlling all member-consumer home thermal energy storage systems (e.g. the contracting agreement with the device manufacturer).</span></label>
<input type="text" id="TESS_operationalCosts_onetime_rf" name="TESS_operationalCosts_onetime_rf" value="{{allInputDataDict.TESS_operationalCosts_onetime_rf}}" pattern="^\d+\.?\d*?$" required="required"/>
</div>



<!-- Water Heater (vbatDispatch) Inputs -->
<div class="wideInput">
<p class="inputSectionHeader">Home Water Heater Device Inputs</p>
</div>
<hr style="border-style: solid; border-color: #196b12; margin-top: 10px;">
<div class="shortInput">
<label class="tooltip">Enable Water Heater?<span class="classic">If yes, model will run with a home water heater.</span></label>
<select id="load_type_wh" name="load_type_wh" value="{{allInputDataDict.load_type_wh}}">
<option value="4" {{ 'selected' if allInputDataDict.load_type_wh == '4' }}>Yes</option>
<option value="0" {{ 'selected' if allInputDataDict.load_type_wh == '0' }}>No</option>
</select>
</div>
<div class="shortInput">
<label class="tooltip">Number of Devices<span class="classic">Total number of home thermal devices to simulate.</span></label>
<input type="text" id="number_devices_wh" name="number_devices_wh" value="{{allInputDataDict.number_devices_wh}}" required="required">
</div>
<div class="shortInput">
<label class="tooltip">Rated Power (kW)<span class="classic">Max power per home thermal device. Must be a positive rational number between 0.1 and 7.2.</span></label>
<input type="text" id="power_wh" name="power_wh" value="{{allInputDataDict.power_wh}}" pattern="^\d+\.?\d*?$" required="required">
</div>
<div class="shortInput">
<label class="tooltip">Thermal Capacitance (kWh/&degC)<span class="classic">Capacitance of each home thermal device. Must be between 0.2 and 2.5 with exactly one decimal digit.</span></label>
<input type="text" id="capacitance_wh" name="capacitance_wh" value="{{allInputDataDict.capacitance_wh}}" pattern="^\d+\.?\d*?$" required="required">
</div>
<div class="shortInput">
<label class="tooltip">Thermal Resistance (&degC/kW)<span class="classic">Resistance of each home thermal device. Must be between 1.5 and 140.</span></label>
<input type="text" id="resistance_wh" name="resistance_wh" value="{{allInputDataDict.resistance_wh}}" pattern="^\d+\.?\d*?$" required="required">
</div>
<div class="shortInput">
<label class="tooltip">Coefficient of Performance<span class="classic">Coefficient of performance of each home thermal device. Must be between 1 and 3.5</span></label>
<input type="text" id="cop_wh" name="cop_wh" value="{{allInputDataDict.cop_wh}}" pattern="^\d+\.?\d*?$" required="required">
</div>
<div class="shortInput">
<label class="tooltip">Temperature Setpoint (&degC)<span class="classic">Setpoint for each home thermal device. Must be between 1.7 and 54.</span></label>
<input type="text" id="setpoint_wh" name="setpoint_wh" value="{{allInputDataDict.setpoint_wh}}" pattern="^\d+\.?\d*?$" required="required">
</div>
<div class="shortInput">
<label class="tooltip">Temperature Deadband (&degC)<span class="classic">Deadband for each home thermal device. Must be between 0.125 and 2.</span></label>
<input type="text" id="deadband_wh" name="deadband_wh" value="{{allInputDataDict.deadband_wh}}" pattern="^\d+\.?\d*?$" required="required">
</div>
<div class="shortInput">
<label class="tooltip">Ongoing Operational Costs ($/month)<span class="classic">Specify the monthly ongoing operational costs of controlling all member-consumer home thermal energy storage systems (e.g. the API usage cost per month).</span></label>
<input type="text" id="TESS_operationalCosts_ongoing_wh" name="TESS_operationalCosts_ongoing_wh" value="{{allInputDataDict.TESS_operationalCosts_ongoing_wh}}" pattern="^\d+\.?\d*?$" required="required"/>
</div>
<div class="shortInput">
<label class="tooltip">One-time Operational Costs ($)<span class="classic">Specify the total one-time operational costs of controlling all member-consumer home thermal energy storage systems (e.g. the contracting agreement with the device manufacturer).</span></label>
<input type="text" id="TESS_operationalCosts_onetime_wh" name="TESS_operationalCosts_onetime_wh" value="{{allInputDataDict.TESS_operationalCosts_onetime_wh}}" pattern="^\d+\.?\d*?$" required="required"/>
</div>



Expand Down
31 changes: 28 additions & 3 deletions omf/models/derUtilityCost.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,15 @@ def work(modelDir, inputDict):
}

## Define thermal variables that change depending on the thermal technology
thermal_suffixes = ['_hp', '_ac'] ## heat pump, air conditioner, (Add more suffixes here after establishing inputs in the defaultInputs and derUtilityCost.html)
thermal_suffixes = ['_hp', '_ac', '_rf', '_wh'] ## heat pump, air conditioner, refrigerator, water heater - (Add more suffixes here after establishing inputs in the defaultInputs and derUtilityCost.html)
thermal_variables=['load_type','number_devices','power','capacitance','resistance','cop','setpoint','deadband','TESS_operationalCosts_ongoing','TESS_operationalCosts_onetime']

all_device_suffixes = []
single_device_results = {}
for suffix in thermal_suffixes:
print('$$$$$$$$$$$$ suffix = ', suffix)
print(float(inputDict['load_type'+suffix]))

## Include only the thermal devices specified by the user
if float(inputDict['load_type'+suffix]) > 0 and float(inputDict['number_devices'+suffix]) > 0:
print('$$$$$$$$$$$$ suffix passed test = ', suffix)
Expand Down Expand Up @@ -938,7 +939,7 @@ def new(modelDir):
'cop_ac': '2.5',
'setpoint_ac': '22.5',
'deadband_ac': '0.625',
'TESS_operationalCosts_ongoing_ac': '20.0',
'TESS_operationalCosts_ongoing_ac': '10.0',
'TESS_operationalCosts_onetime_ac': '1000',

## Home Heat Pump inputs (vbatDispatch):
Expand All @@ -950,9 +951,33 @@ def new(modelDir):
'cop_hp': '3.5',
'setpoint_hp': '19.5',
'deadband_hp': '0.625',
'TESS_operationalCosts_ongoing_hp': '20.0',
'TESS_operationalCosts_ongoing_hp': '10.0',
'TESS_operationalCosts_onetime_hp': '1000',

## Home Refrigerator inputs (vbatDispatch):
'load_type_rf': '3',
'number_devices_rf': '2000',
'power_rf': '0.3',
'capacitance_rf': '0.6',
'resistance_rf': '90.0',
'cop_rf': '2',
'setpoint_rf': '2.5',
'deadband_rf': '1.5',
'TESS_operationalCosts_ongoing_rf': '10.0',
'TESS_operationalCosts_onetime_rf': '1000',

## Home Water Heater inputs (vbatDispatch):
'load_type_wh': '4',
'number_devices_wh': '2000',
'power_wh': '4.5',
'capacitance_wh': '0.4',
'resistance_wh': '120',
'cop_wh': '1',
'setpoint_wh': '48.5',
'deadband_wh': '3',
'TESS_operationalCosts_ongoing_wh': '10.0',
'TESS_operationalCosts_onetime_wh': '1000',

}

return __neoMetaModel__.new(modelDir, defaultInputs)
Expand Down

0 comments on commit 7aba76a

Please sign in to comment.