Skip to content

Commit

Permalink
Merge branch 'master' of github.com:dpinney/omf
Browse files Browse the repository at this point in the history
  • Loading branch information
dpinney committed Jun 14, 2024
2 parents 2d04912 + 2ad4ea2 commit 6aaddbb
Show file tree
Hide file tree
Showing 9 changed files with 869 additions and 290 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,5 @@ omf/solvers/reopt_jl/testFiles/resultsResilience.json
omf/solvers/reopt_jl/testFiles/results.json
omf/solvers/reopt_jl/testFiles/REoptInputs.json
omf/solvers/reopt_jl/reopt_jl.so
omf/solvers/reopt_jl/julia-1.9.4/*
instantiated.txt
13 changes: 6 additions & 7 deletions omf/models/derConsumer.html
Original file line number Diff line number Diff line change
Expand Up @@ -235,16 +235,15 @@
<input type="text" id="rateCompensation" name="rateCompensation" value="{{allInputDataDict.rateCompensation}}" pattern="^\d+\.?\d*?$" min="0" required="required"/>
</div>
<div class="shortInput">
<label class="tooltip">Fixed Compensation Amount ($)<span class="classic">A fixed dollar amount (e.g. A one-time enrollment reward, or yearly bonus compensation to the member-consumer.) </span></label>
<input type="text" id="fixedCompensation" name="fixedCompensation" value="{{allInputDataDict.fixedCompensation}}" pattern="^\d+\.?\d*?$" min="0" required="required">
<label class="tooltip">Subsidy Amount ($)<span class="classic">The total subsidy amount ($)</span></label>
<input type="text" id="subsidy" name="subsidy" value="{{allInputDataDict.subsidy}}" pattern="^\d+\.?\d*?$" required="required"/>
</div>
<div class="shortInput">
<label class="tooltip">Fixed Compensation Frequency<span class="classic">If there is a fixed compensation amount, how often is it awarded?</span></label>
<select id="fixedCompensationFrequency" name="fixedCompensationFrequency">
<option value="0" {{ 'selected' if allInputDataDict.fixedCompensationFrequency == '0' }}>One-time only</option>
<option value="1" {{ 'selected' if allInputDataDict.fixedCompensationFrequency == '1' }}>Yearly</option>
</select>
<label class="tooltip">Maximum BESS discharge (%)<span class="classic">The maximum percentage of BESS total charge used for discharging. Most programs designate up to 80% of total charge, leaving the member with at least 20% charge.</span></label>
<input type="text" id="maxBESSDischarge" name="maxBESSDischarge" value="{{allInputDataDict.maxBESSDischarge}}" pattern="^\d+\.?\d*?$" min="0" max="1" required="required"/>
</div>


{{ omfModelButtons }}
</form>

Expand Down
379 changes: 298 additions & 81 deletions omf/models/derConsumer.py

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions omf/models/derUtilityCost.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'distributed energy resources (DERs) using the NREL Renewable Energy Optimization Tool (REopt) and '
'the OMF virtual battery dispatch module (vbatDispatch).')
modelName, template = __neoMetaModel__.metadata(__file__)
hidden = True ## Keep the model hidden=True during active development
hidden = False ## Keep the model hidden=True during active development


def work(modelDir, inputDict):
Expand Down Expand Up @@ -277,7 +277,7 @@ def new(modelDir):
'created': str(datetime.datetime.now()),

## REopt inputs:
'latitude' : '39.986771 ',
'latitude' : '39.986771',
'longitude' : '-104.812599', ## Brighton, CO
'year' : '2018',
'analysis_years' : '25',
Expand Down
5 changes: 4 additions & 1 deletion omf/models/hostingCapacity.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,17 @@ def run_downline_load_algorithm( modelDir, inputDict, outData ):
buses = opendss.get_all_buses( os.path.join( modelDir, 'downlineLoad.dss') )
buses_output = {}
kwFromGraph = nx.get_node_attributes(graph, 'kw')
objectTypesFromGraph = nx.get_node_attributes(graph, 'object')
# Check if they are buses
for bus in buses:
if bus in graph.nodes:
kwSum = 0
get_dependents = sorted(nx.descendants(graph, bus))
for dependent in get_dependents:
if dependent in kwFromGraph.keys():
if dependent in kwFromGraph.keys() and objectTypesFromGraph[dependent] == 'load':
kwSum += float(kwFromGraph[dependent])
elif dependent in kwFromGraph.keys() and objectTypesFromGraph[dependent] == 'generator':
kwSum -= float(kwFromGraph[dependent])
buses_output[bus] = kwSum
downline_output = pd.DataFrame(list(buses_output.items()), columns=['busname', 'kw'] )
downline_end_time = time.time()
Expand Down
20 changes: 19 additions & 1 deletion omf/models/restoration.html
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
Plotly.newPlot("fig2Chart", JSON.parse(allOutputData["fig2Data"]), JSON.parse(allOutputData["fig2Layout"]) || {})
</script>
</div>
<p class="reportTitle">Loads Served</p>
<p class="reportTitle">Demand Served</p>
<div id="fig3" class="tightContent">
<div id="fig3Chart" style="width:1000px"></div>
<script type="text/javascript">
Expand All @@ -197,6 +197,20 @@
Plotly.newPlot("fig5Chart", JSON.parse(allOutputData["fig5Data"]), JSON.parse(allOutputData["fig5Layout"]) || {})
</script>
</div>
<p class="reportTitle">TAIFI Histogram</p>
<div id="taifiHist" class="tightContent">
<div id="taifiHistChart" style="width:1000px"></div>
<script type="text/javascript">
Plotly.newPlot("taifiHistChart", JSON.parse(allOutputData["taifiHistData"]), JSON.parse(allOutputData["taifiHistLayout"]) || {})
</script>
</div>
<p class="reportTitle">TAIDI Histogram</p>
<div id="taidiHist" class="tightContent">
<div id="taidiHistChart" style="width:1000px"></div>
<script type="text/javascript">
Plotly.newPlot("taidiHistChart", JSON.parse(allOutputData["taidiHistData"]), JSON.parse(allOutputData["taidiHistLayout"]) || {})
</script>
</div>
<p class="reportTitle" style="page-break-before:always">Utility Outage Cost</p>
<div id="utilityOutageCostCalc" class="tightContent">
{{ allOutputDataDict['utilityOutageHtml'] }}
Expand All @@ -223,6 +237,10 @@
<div id="outageCostCalc" class="tightContent sorttable" style="max-height:500px; overflow-y:scroll">
{{ allOutputDataDict['timelineStatsHtml'] }}
</div>
<p class="reportTitle" style="page-break-before:always">Simulation time-span SAIDI, SAIFI, CAIDI, and CAIFI</p>
<div id="tradMetricsCalc" class="tightContent sorttable" style="max-height:500px; overflow-y:scroll">
{{ allOutputDataDict['tradMetricsHtml'] }}
</div>
<!-- Leaflet map directly inline with model-->
<p class="reportTitle">Outage Map and Time Slider</p>
<div class="tightContent" style="margin-bottom:-1px">
Expand Down
Loading

0 comments on commit 6aaddbb

Please sign in to comment.