Skip to content

Commit

Permalink
derConsumer.py: Added vbatDispatch functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
astronobri committed Apr 23, 2024
1 parent 2aaea67 commit d5c0704
Showing 1 changed file with 23 additions and 17 deletions.
40 changes: 23 additions & 17 deletions omf/models/derConsumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,16 @@ def work(modelDir, inputDict):
## Read in a static REopt test file
with open(pJoin(__neoMetaModel__._omfDir,"static","testFiles","residential_REopt_results.json")) as f:
results = json.load(f)
print('Successfully read in REopt test file. \n')
print('Successfully loaded REopt test file. \n')

# Model operations goes here.

## Run vbatDispatch
vbatResults = vb.work(modelDir,inputDict)

with open(pJoin(modelDir, 'vbatResults.json'), 'w') as jsonFile:
json.dump(vbatResults, jsonFile)
outData.update(vbatResults) ## Update output file with vbat results

# Model operations typically ends here.
# Stdout/stderr.
Expand All @@ -80,8 +86,8 @@ def new(modelDir):
## REopt inputs:
"latitude": '39.532165', ## Rivesville, WV
"longitude": '-80.120618', ## TODO: Should these be strings or floats?
"year": 2018,
"analysisYears": 25,
"year": '2018',
"analysisYears": '25',
"urdbLabel": '643476222faee2f0f800d8b1', ## Rivesville, WV - Monongahela Power
"fileName": "residential_PV_load.csv",
"tempFileName": "residential_extended_temperature_data.csv",
Expand All @@ -93,20 +99,20 @@ def new(modelDir):
"generator": "No",

## vbatDispatch inputs:
"load_type": 2, ## Heat Pump
"number_devices": 1,
"power": 5.6,
"capacitance": 2,
"resistance": 2,
"cop": 2.5,
"setpoint": 19.5,
"deadband": 0.625,
"demandChargeCost": 25,
"electricityCost": 0.16,
"projectionLength": 25,
"discountRate": 2,
"unitDeviceCost": 150,
"unitUpkeepCost": 5,
"load_type": '2', ## Heat Pump
"number_devices": '1',
"power": '5.6',
"capacitance": '2',
"resistance": '2',
"cop": '2.5',
"setpoint": '19.5',
"deadband": '0.625',
"demandChargeCost": '25',
"electricityCost": '0.16',
"projectionLength": '25',
"discountRate": '2',
"unitDeviceCost": '150',
"unitUpkeepCost": '5',
}
return __neoMetaModel__.new(modelDir, defaultInputs)

Expand Down

0 comments on commit d5c0704

Please sign in to comment.