Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/crunch_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -54015,7 +54015,7 @@
}
],
"source": [
"# Probability weighted and unweighted AEP values are returned\n",
"# Probability weighted and unweighted AEP values are returned in kWh\n",
"mycruncher_mc.set_probability_turbine_class('Wind1VelX', 2)\n",
"mycruncher_mc.compute_aep('GenPwr')"
]
Expand Down
14 changes: 7 additions & 7 deletions pCrunch/crunch.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ def set_probability_turbine_class(self, windspeed, turbine_class, idx=None):

def compute_aep(self, pwrchan, loss_factor=0.0, idx=None):
"""
Computes annual energy production based on all outputs in the list.
Computes annual energy production [kWh] based on all outputs in the list.

Parameters
----------
Expand All @@ -463,10 +463,10 @@ def compute_aep(self, pwrchan, loss_factor=0.0, idx=None):

Returns
----------
aep_weighted : float
aep_weighted_kWh : float
Weighted AEP where each output is weighted by the probability of
occurence determined from its average wind speed
aep_unweighted : float
aep_unweighted_kWh : float
Unweighted AEP that assumes all outputs in the list are equally
likely (just a mean)
"""
Expand All @@ -485,16 +485,16 @@ def compute_aep(self, pwrchan, loss_factor=0.0, idx=None):
prob = prob / prob.sum()

# Calculate scaling factor for year with losses included
fact = (1.0 - loss_factor) * 365.0 * 24.0 * 60.0 * 60.0
fact = (1.0 - loss_factor) * 365.0 * 24.0 #* 60.0 * 60.0 # Add these in for kW-s

# Sum with probability. Finding probability weighted average per second, scaled by total seconds
aep_weighted = fact * np.dot(E, prob) / np.dot(T, prob)
aep_weighted_kWh = fact * np.dot(E, prob) / np.dot(T, prob)

# Assume equal probability
prob = np.ones(E.shape)/E.size
aep_unweighted = fact * np.dot(E, prob) / np.dot(T, prob)
aep_unweighted_kWh = fact * np.dot(E, prob) / np.dot(T, prob)

return aep_weighted, aep_unweighted
return aep_weighted_kWh, aep_unweighted_kWh


def compute_total_fatigue(self, lifetime=0.0, availability=1.0,
Expand Down
2 changes: 1 addition & 1 deletion pCrunch/test/test_crunch.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def test_aep(self):
myout = AeroelasticOutput(data)
myouts = [myout]*10

aep_true = myout.compute_energy('WindVxi') * 8760*60*60/myout.elapsed_time
aep_true = myout.compute_energy('WindVxi') * 8760/myout.elapsed_time

myobj = Crunch(myouts, magnitude_channels=mc)
aep_w1, aep_uw1 = myobj.compute_aep('Wind')
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "pCrunch"
version = "2.1.0"
version = "2.1.1"
description = "IO and Post Processing for generic time series data of multibody aeroelastic wind turbine simulations."
readme = "README.rst"
requires-python = ">=3.9"
Expand Down
Loading