Hi Colleen,
Your Python code imports the PySAM package so you don't need to also import PySSC. You can use the method described in the PySAM documentation to import input data from SAM into your PySAM model:
nrel-pysam.readthedocs.io/en/main/inputs-from-sam.html
The benefit of using PySAM is that it has better documentation and provides methods for interacting with variables.
To model different sizes of wind farms, you have to set the value of the following three variables together:
system_capacity
wind_farm_xCoordinates
wind_farm_yCoordinates
You can use the diagram on SAM's Wind Farm input page to figure out how those X and Y coordinates work.
Here is a basic code example that shows how to model a wind farm with one turbine and two turbines, assuming you are using the power curve option for specifying the wind turbine. See the attached zip file for the input JSON file, which I generated from the .sam file and then modified to read the wind resource file from the folder containing the Python script.
import json
import PySAM.Windpower as wp
wind = wp.new()
with open('untitled_windpower.json', 'r') as file:
data = json.load(file)
# loop through each key-value pair
for k, v in data.items():
if k != 'number_inputs':
wind.value(k, v)
# Wind farm with one turbine
wind.value('wind_farm_xCoordinates', [ 0 ])
wind.value('wind_farm_yCoordinates', [ 0 ])
wind.value('system_capacity', 48000)
wind.execute()
print('annual energy (kWh) = ', wind.Outputs.annual_energy)
print('capacity factor = ', wind.Outputs.capacity_factor)
print()
#Wind farm with two turbines
wind.value('wind_farm_xCoordinates', [ 0, 616 ])
wind.value('wind_farm_yCoordinates', [ 0, 0 ])
wind.value('system_capacity', 96000)
wind.execute()
print('annual energy (kWh) = ', wind.Outputs.annual_energy)
print('capacity factor = ', wind.Outputs.capacity_factor)
Best regards,
Paul.