Skip to content

Commit

Permalink
derConsumer & derUtilityCost: Added PV inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
astronobri committed Nov 11, 2024
1 parent d36c4c6 commit f28820a
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 9 deletions.
53 changes: 53 additions & 0 deletions omf/models/derConsumer.html
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,59 @@
<label class="tooltip">Battery Replacement (years)<span class="classic">Specify a year in which the battery cells will be replaced at the cost specified in Battery Replacement Capacity Cost. Input is an integer less than or equal to the analysis period in years.</span></label>
<input type="text" id="battery_replacement_year" name="battery_replacement_year" value="{{allInputDataDict.battery_replacement_year}}" required="required"/>
</div>

<!-- Photovoltaic Inputs -->
<div class="wideInput">
<p class="inputSectionHeader">Photovoltaic Device Inputs</p>
</div>
<hr style="border-style: solid; border-color: #196b12; margin-top: 10px;">
<div class="shortInput solarDisplayInput">
<label class="tooltip">Existing photovoltaic size (kW)<span class="classic">Specify the total capacity of any pre-existing photovoltaic installation in kW.</span></label>
<input type="text" id="existing_kw_PV" name="existing_kw_PV" value="{{allInputDataDict.existing_kw_PV}}" required="required"/>
</div>
<div class="shortInput">
<label class="tooltip">Additional Utility-Installed PV Size (kW)<span class="classic">Specify the additional desired photovoltaic size amount in kW.</span></label>
<input type="text" id="additional_kw_PV" name="additional_kw_PV" value="{{allInputDataDict.additional_kw_PV}}" required="required"/>
</div>
<div class="shortInput">
<label class="tooltip">Photovoltaic Cost ($/kW)<span class="classic">Specify the cost in $/kW.</span></label>
<input type="text" id="costPV" name="costPV" value="{{allInputDataDict.costPV}}" pattern="^\d+\.?\d*?$" required="required"/>
</div>
<div class="shortInput">
<label class="tooltip">Photovoltaic Minimum Power (kW)<span class="classic">Specify the minimum desired photovoltaic generation in kW.</span></label>
<input type="text" id="min_kw_PV" name="min_kw_PV" value="{{allInputDataDict.min_kw_PV}}" required="required"/>
</div>
<div class="shortInput">
<label class="tooltip">Photovoltaic Maximum Power (kW)<span class="classic">Specify the maximum desired generation in kW.</span></label>
<input type="text" id="max_kw_PV" name="max_kw_PV" value="{{allInputDataDict.max_kw_PV}}" required="required"/>
</div>
<div class="shortInput">
<label class="tooltip">Can photovoltaic be curtailed?<span class="classic">Allows for excess photovoltaic power to be automatically curtailed.</span></label>
<select id="PVCanCurtail" name="PVCanCurtail">
<option value='True' {{ 'selected' if allInputDataDict.PVCanCurtail == True }}>Yes</option>
<option value='False' {{ 'selected' if allInputDataDict.PVCanCurtail == False }}>No</option>
</select>
</div>
<div class="shortInput">
<label class="tooltip">Can photovoltaic be exported?<span class="classic">Allows for excess photovoltaic power to be sold back to the grid.</span></label>
<select id="PVCanExport" name="PVCanExport">
<option value='True' {{ 'selected' if allInputDataDict.PVCanExport == True }}>Yes</option>
<option value='False' {{ 'selected' if allInputDataDict.PVCanExport == False }}>No</option>
</select>
</div>
<div class="shortInput">
<label class="tooltip">Photovoltaic MACRS Years<span class="classic">MACRS schedule for financial analysis. Possible inputs are 0, 5 and 7 years.</span></label>
<select id="PVMacrsOptionYears" name="PVMacrsOptionYears" value="{{allInputDataDict.PVMacrsOptionYears}}"/>
<option value="0" {{ 'selected' if allInputDataDict.PVMacrsOptionYears == '0' }}>0</option>
<option value="5" {{ 'selected' if allInputDataDict.PVMacrsOptionYears == '5' }}>5</option>
<option value="7" {{ 'selected' if allInputDataDict.PVMacrsOptionYears == '7' }}>7</option>
</select>
</div>
<div class="shortInput">
<label class="tooltip">Photovoltaic ITC (%)<span class="classic">Please enter a number 0-1 for the photovoltaic investment tax credit. Format 0.XX</span></label>
<input type="number" id="PVItcPercent" name="PVItcPercent" value="{{allInputDataDict.PVItcPercent}}" step="0.01" min="0.0" max="1.0" required="required"/>
</div>

<!-- vbatDispatch Specific Inputs -->
<div class="wideInput">
<p class="inputSectionHeader"> Thermal Device Inputs</p>
Expand Down
20 changes: 19 additions & 1 deletion omf/models/derConsumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,14 @@ def create_REopt_jl_jsonFile(modelDir, inputDict):
}

scenario['PV'] = {
##TODO: Add options here, if needed
'installed_cost_per_kw': float(inputDict['costPV']),
'existing_kw': float(inputDict['existing_kw_PV']),
'min_kw': float(inputDict['min_kw_PV']),
'max_kw': float(inputDict['max_kw_PV']),
'can_export_beyond_nem_limit': inputDict['PVCanExport'],
'can_curtail': inputDict['PVCanCurtail'],
'macrs_option_years': int(inputDict['PVMacrsOptionYears']),
'federal_itc_fraction': float(inputDict['PVItcPercent']),
}

## Add a Battery Energy Storage System (BESS) section if enabled
Expand Down Expand Up @@ -655,6 +662,17 @@ def new(modelDir):
'inverter_replacement_year': '10',
'battery_replacement_year': '10',

## Photovoltaic Inputs
'existing_kw_PV': '29500.0',
'additional_kw_PV': '0.0',
'costPV': '0.0',
'min_kw_PV': '0',
'max_kw_PV': '29500.0',
'PVCanCurtail': True,
'PVCanExport': True,
'PVMacrsOptionYears': '25',
'PVItcPercent': '0.0',

## vbatDispatch inputs:
'load_type': '2', ## Heat Pump
'number_devices': '1',
Expand Down
10 changes: 5 additions & 5 deletions omf/models/derUtilityCost.html
Original file line number Diff line number Diff line change
Expand Up @@ -218,21 +218,21 @@
<input type="text" id="min_kw_PV" name="min_kw_PV" value="{{allInputDataDict.min_kw_PV}}" required="required"/>
</div>
<div class="shortInput">
<label class="tooltip">Photovoltaic Maximum Power (kW)<span class="classic">Specify the maximum desired generation in kW. Leave at default for full optimization on solar power.</span></label>
<label class="tooltip">Photovoltaic Maximum Power (kW)<span class="classic">Specify the maximum desired generation in kW.</span></label>
<input type="text" id="max_kw_PV" name="max_kw_PV" value="{{allInputDataDict.max_kw_PV}}" required="required"/>
</div>
<div class="shortInput">
<label class="tooltip">Can photovoltaic be curtailed?<span class="classic">Allows for excess photovoltaic power to be automatically curtailed.</span></label>
<select id="PVCanCurtail" name="PVCanCurtail">
<option value='Yes' {{ 'selected' if allInputDataDict.PVCanCurtail == Yes }}>Yes</option>
<option value='No' {{ 'selected' if allInputDataDict.PVCanCurtail == No }}>No</option>
<option value='true' {{ 'selected' if allInputDataDict.PVCanCurtail == True }}>Yes</option>
<option value='false' {{ 'selected' if allInputDataDict.PVCanCurtail == False }}>No</option>
</select>
</div>
<div class="shortInput">
<label class="tooltip">Can photovoltaic be exported?<span class="classic">Allows for excess photovoltaic power to be sold back to the grid.</span></label>
<select id="PVCanExport" name="PVCanExport">
<option value='Yes' {{ 'selected' if allInputDataDict.PVCanExport == Yes }}>Yes</option>
<option value='No' {{ 'selected' if allInputDataDict.PVCanExport == No }}>No</option>
<option value='true' {{ 'selected' if allInputDataDict.PVCanExport == True }}>Yes</option>
<option value='false' {{ 'selected' if allInputDataDict.PVCanExport == False }}>No</option>
</select>
</div>
<div class="shortInput">
Expand Down
6 changes: 3 additions & 3 deletions omf/models/derUtilityCost.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,8 +691,8 @@ def new(modelDir):
'costPV': '0.0',
'min_kw_PV': '0',
'max_kw_PV': '29500.0',
'PVCanCurtail': 'Yes',
'PVCanExport': 'Yes',
'PVCanCurtail': True,
'PVCanExport': True,
'PVMacrsOptionYears': '25',
'PVItcPercent': '0.0',

Expand All @@ -704,7 +704,7 @@ def new(modelDir):
'subsidy': '100.0',

## vbatDispatch inputs:
'load_type': '2', ## Heat Pump
'load_type': '1', ## Air Conditioner
'number_devices': '2000',
'power': '5.6',
'capacitance': '2',
Expand Down

0 comments on commit f28820a

Please sign in to comment.