This jupyter journal will walk us through the creation of the most basic fixed-tilt simulation possible with bifacialvf. We will simulate a 1-up landscape system over a white rooftop.
Steps include:
from pathlib import Path
import os
import bifacialvf
# IO Files
testfolder = Path().resolve().parent.parent / 'bifacialvf' / 'TEMP' / 'Tutorial_03'
if not os.path.exists(testfolder):
os.makedirs(testfolder)
# Download and Read input
TMYtoread=bifacialvf.getEPW(lat=37.5407,lon=-77.4360, path = testfolder)
myTMY3, meta = bifacialvf.readInputTMY(TMYtoread)
deltastyle = 'TMY3' #
path = C:\Users\sayala\Documents\GitHub\bifacialvf\bifacialvf\TEMP\Tutorial_03 Getting weather file: USA_VA_Richmond.724010_TMY2.epw ... OK!
# Variables
tilt = 10 # PV tilt (deg)
sazm = 180 # PV Azimuth(deg) or tracker axis direction
albedo = 0.62 # ground albedo
clearance_height=0.4
pitch = 1.5 # row to row spacing in normalized panel lengths.
rowType = "interior" # RowType(first interior last single)
transFactor = 0.013 # TransmissionFactor(open area fraction)
sensorsy = 6 # sensorsy(# hor rows in panel) <--> THIS ASSUMES LANDSCAPE ORIENTATION
PVfrontSurface = "glass" # PVfrontSurface(glass or ARglass)
PVbackSurface = "glass" # PVbackSurface(glass or ARglass)
# Calculate PV Output Through Various Methods
# This variables are advanced and explored in other tutorials.
calculateBilInterpol = True # Only works with landscape at the moment.
calculatePVMismatch = True
portraitorlandscape='landscape' # portrait or landscape
cellsnum = 72
bififactor = 1.0
agriPV = False # Returns ground irradiance values
# Tracking instructions
tracking=False
backtrack=False
limit_angle = 60
writefiletitle = os.path.join(testfolder, 'Tutorial3_Results.csv')
myTMY3 = myTMY3.iloc[0:24].copy() # Simulate just the first 24 hours of the data file for speed on this example
bifacialvf.simulate(myTMY3, meta, writefiletitle=writefiletitle,
tilt=tilt, sazm=sazm, pitch=pitch, clearance_height=clearance_height,
rowType=rowType, transFactor=transFactor, sensorsy=sensorsy,
PVfrontSurface=PVfrontSurface, PVbackSurface=PVbackSurface,
albedo=albedo, tracking=tracking, backtrack=backtrack,
limit_angle=limit_angle, deltastyle=deltastyle,
calculateBilInterpol=calculateBilInterpol, calculatePVMismatch=calculatePVMismatch,
cellsnum = cellsnum, bififactor=bififactor, agriPV=agriPV)
Calculating Sun position with a delta of -30 mins. i.e. 12 is 11:30 sunpos Albedo value passed, but also present in TMY3 file. Using albedo value passed. To use the ones in TMY3 file re-run simulation with albedo=None ********* Running Simulation for TMY3: Location: RICHMOND Lat: 37.5 Long: -77.33 Tz -5.0 Parameters: tilt: 10 Sazm: 180 Clearance_Height : 0.4 Pitch: 1.5 Row type: interior Albedo: 0.62 Saving into C:\Users\sayala\Documents\GitHub\bifacialvf\bifacialvf\TEMP\Tutorial_03\Tutorial3_Results.csv Distance between rows for no shading on Dec 21 at 9 am solar time = 0.4510244972733475 Actual distance between rows = 0.515192246987792
100%|█████████████████████████████████████████████████████████████████████████████████| 24/24 [00:00<00:00, 407.26it/s]
Warning: Bilinear Interpolation supports only Landscape mode for this release. Warning: BilInterpolParams dictionary is None OR is wrongly defined. Using default values for Bilintear Interpolation routine Starting Bilinear Interpolation Analysis
Finished. Time elapsed for calculating Bilinear Interpolation Output (s): 0% The DC Power Mismatch loss for the year is of: 1.316% The detailed irradiance power is: 348.2 W The average irradinace power is: 352.9 W starting Time elapsed for calculating PVMismatch Output 0.3130042552947998 ending The DC Power Mismatch loss for the year is of: 1.202% The detailed irradiance power is: 284.4 W The average irradinace power is: 287.8 W Finished
from bifacialvf import loadVFresults
mismatchResultstitle = os.path.join(testfolder, 'Tutorial3_Results_PVMismatch.csv')
(data, metadata) = loadVFresults(mismatchResultstitle)
data.keys()
Index(['date', 'DNI', 'DHI', 'albedo', 'decHRs', 'ghi', 'inc', 'zen', 'azm', 'pvFrontSH', 'aveFrontGroundGHI', 'GTIfrontBroadBand', 'pvBackSH', 'aveBackGroundGHI', 'GTIbackBroadBand', 'maxShadow', 'Tamb', 'VWind', 'No_1_RowFrontGTI', 'No_2_RowFrontGTI', 'No_3_RowFrontGTI', 'No_4_RowFrontGTI', 'No_5_RowFrontGTI', 'No_6_RowFrontGTI', 'No_1_RowBackGTI', 'No_2_RowBackGTI', 'No_3_RowBackGTI', 'No_4_RowBackGTI', 'No_5_RowBackGTI', 'No_6_RowBackGTI', 'PVMismatch FRONT + BACK (Averaged) PmaxIdeal [W]', 'PVMismatch FRONT + BACK (Detailed) PmaxUnmatched [W]', 'PVMismatch FRONT ONLY (Averaged) PmaxIdeal [W]', 'PVMismatch FRONT ONLY (Detailed) PmaxUnmatched [W]'], dtype='object')