diff --git a/examples/crunch_example.ipynb b/examples/crunch_example.ipynb index 12f7372..d2567b9 100644 --- a/examples/crunch_example.ipynb +++ b/examples/crunch_example.ipynb @@ -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')" ] diff --git a/pCrunch/crunch.py b/pCrunch/crunch.py index 1f5771d..75a8b13 100644 --- a/pCrunch/crunch.py +++ b/pCrunch/crunch.py @@ -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 ---------- @@ -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) """ @@ -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, diff --git a/pCrunch/test/test_crunch.py b/pCrunch/test/test_crunch.py index b84cc82..fe668be 100644 --- a/pCrunch/test/test_crunch.py +++ b/pCrunch/test/test_crunch.py @@ -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') diff --git a/pyproject.toml b/pyproject.toml index 677b8a0..a3a6c48 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"