From 79e6092cc452a9c640f2e7d2554cc63c1adc7926 Mon Sep 17 00:00:00 2001
From: dave <dave@dtu.dk>
Date: Fri, 8 Jan 2016 15:36:39 +0100
Subject: [PATCH] Simulations: power is positive for a wind turbine when
 generator torque is opposite of rotor speed

---
 wetb/prepost/Simulations.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/wetb/prepost/Simulations.py b/wetb/prepost/Simulations.py
index ebe39449..5847a5a5 100755
--- a/wetb/prepost/Simulations.py
+++ b/wetb/prepost/Simulations.py
@@ -4776,8 +4776,9 @@ class Cases:
             nn_shaft = 4
         itorque = self.res.ch_dict['shaft-shaft-node-%3.3i-momentvec-z'%nn_shaft]['chi']
         torque = self.res.sig[:,itorque]
-
-        return torque*rads
+        # negative means power is being extracted, which is exactly what a wind
+        # turbine is about, we call that positive
+        return -1.0*torque*rads
 
     def calc_torque_const(self, save=False, name='ojf'):
         """
-- 
GitLab