acep-uaf / MiGRIDS

Tools for technical and economic assessment and sizing of grid bridging energy storage systems.
MIT License
9 stars 4 forks source link

Fuel Stats for runs #95

Open mmuellerstoffels opened 6 years ago

mmuellerstoffels commented 6 years ago

https://github.com/mmuellerstoffels/GBSTools/blob/7fc259e719cf5f22cee688170d50c6b6cc0763b2/GBSTool/GBSAnalyzer/PerformanceAnalyzers/getRunMetaData.py#L80

@jbvandermeer can you please implement this, as a priority. It makes more sense to have this in here, instead of doing a separate performance calc to the same end in the optimizer routines.

mmuellerstoffels commented 6 years ago

GBSAnalyzer/PerformanceAnalyzers/getFuelUse.py has been tested with Chevak data and should work for this.

For potentially useful code snippets see below:

# Calculate base case fuel consumption
            # Need to load fuel curves for this
            genFleetList = list(self.allGen.columns.values)
            genFleetList.remove('time')
            genFleet = list()
            for gen in genFleetList:
                genFleet.append(gen[:-1])
            print(genFleet)
            fuelCurveDataPoints = pd.DataFrame(index = genFleet, columns = ['fuelCurve_pPu','fuelCurve_massFlow','POutMaxPa'])

            for genString in genFleet:
                genPath = os.path.join(self.rootProjectPath, 'InputData/Components/', genString + 'Descriptor.xml')
                genFile = open(genPath, 'r')
                genFileXML = genFile.read()
                genFile.close()
                genSoup = bs(genFileXML, "xml")

                fuelCurveDataPoints.loc[genString, 'fuelCurve_pPu'] = genSoup.fuelCurve.pPu.get('value')
                fuelCurveDataPoints.loc[genString, 'fuelCurve_massFlow'] = genSoup.fuelCurve.massFlow.get('value')
                fuelCurveDataPoints.loc[genString, 'POutMaxPa'] = genSoup.POutMaxPa.get('value')

            self.genAllFuelUsedBase, self.fuelStatsBase = getFuelUse(self.allGen, fuelCurveDataPoints)