Skip to content

Commit

Permalink
Option to specify position of the RNA + slight change in test_rotor
Browse files Browse the repository at this point in the history
- Besides the already available option of specifying the hub height (using input key `hHub`), now the user can also specify the coordinates of the RNA reference position (with respect to the FOWT reference frame) via the input key `rRNA`. For multirotor designs, the user needs to provide `rRNA` for each RNA/rotor

- moved the flagSaveValues to be an input of test_calcAero
  • Loading branch information
lucas-carmo committed Aug 23, 2024
1 parent 71272b7 commit aa2b46f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
3 changes: 2 additions & 1 deletion examples/VolturnUS-S_example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ turbine:
IxRNA : 0 # [kg-m2] RNA moment of inertia about local x axis (assumed to be identical to rotor axis for now, as approx) [kg-m^2]
IrRNA : 0 # [kg-m2] RNA moment of inertia about local y or z axes [kg-m^2]
xCG_RNA : 0 # [m] x location of RNA center of mass [m] (Actual is ~= -0.27 m)
hHub : 150.0 # [m] hub height above water line [m]
hHub : 150.0 # [m] hub height above water line [m]
#rRNA : [0,0, 148.742] # [m] Can use the position of the RNA reference point (which the RNA yaws about) with respect to the FOWT reference point. If also providing hHub, the z coord be overwritten.
Fthrust : 1500.0E3 # [N] temporary thrust force to use

I_drivetrain: 318628138.0 # full rotor + drivetrain inertia as felt on the high-speed shaft
Expand Down
19 changes: 10 additions & 9 deletions raft/raft_rotor.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,13 @@ def __init__(self, turbine, w, ir):
self.turbine = turbine # store dictionary for later use

# self.r_rel is the position of the RNA reference point (which the RNA yaws about) on the FOWT
if 'rotorCoords' in turbine:
print("WARNING: turbine rotorCoords input is deprecated - use position.")
self.r_rel = getFromDict(turbine, 'rotorCoords', dtype=list, shape=turbine['nrotors'], default=[[0,0,100.]])[ir]

self.r_rel = getFromDict(turbine, 'position', dtype=list, shape=turbine['nrotors'], default=[[0,0,100.]])[ir]

if 'rRNA' in turbine: # Temporary if statement. Need to fix getFromDict to handle this
self.r_rel = getFromDict(turbine, 'rRNA', shape=[turbine['nrotors'], 3])[ir]
else:
if turbine['nrotors'] > 1:
raise Exception("For designs with more than one rotor, the RNA reference point must be specified for each of them.")
self.r_rel = [0, 0, 100.]

self.overhang = getFromDict(turbine, 'overhang', shape=turbine['nrotors'])[ir] # rotor offset in +x before yaw [m]
if self.overhang > 0:
print("WARNING: The turbine overhang input was positive for upwind turbines.")
Expand Down Expand Up @@ -105,12 +106,12 @@ def __init__(self, turbine, w, ir):

self.R_ptfm = np.ones(3) # rotation matrix for platform orientation

# If `hHub` is specified, we overwrite the z-coordinate of the RNA reference point
if 'hHub' in turbine:
print("WARNING: turbine hHub input is deprecated - use position [x y z].")
hHub = getFromDict(turbine, 'hHub' , shape=turbine['nrotors'])[ir] # overwrites r_rel[2] [m]
self.r_rel[2] = hHub - self.q[2]*self.overhang
self.hHub = hHub # we may not need this anymore
self.Zhub = self.hHub
self.hHub = self.r_rel[2] + self.q[2]*self.overhang # we may not need this anymore
self.Zhub = self.hHub

# below is initialization, needs to be updated by setPosition...
self.r_RRP = np.array(self.r_rel) # RNA reference point
Expand Down
8 changes: 3 additions & 5 deletions tests/test_rotor.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,16 @@ def index_and_rotor(request):
'''
Test functions
'''
def test_calcAero(index_and_rotor):
def test_calcAero(index_and_rotor, flagSaveValues=False):
'''
Verify rotor.calcAero for many combinations of wind speed, heading, TI, and yaw mode.
Some combinations seem to be outside the validity of CCBlade (e.g., yaw_mode=1, wind direction=90, and turbine_heading=0),
but they are tested nonetheless.
Set flagSaveValues to true to replace the true values file with the values calculated below
'''
index, rotor = index_and_rotor
rotor.setPosition()

# Set this flag to true to replace the true values file
flagSaveValues = False

if 'IEA15MW' in list_files[index]:
U_rated = 10.59
elif 'NREL5MW' in list_files[index]:
Expand Down Expand Up @@ -160,5 +158,5 @@ def test_calcAero(index_and_rotor):
index = 0

rotor = create_rotor(list_files[index])
test_calcAero((index, rotor))
test_calcAero((index, rotor), flagSaveValues=False)

0 comments on commit aa2b46f

Please sign in to comment.