Skip to content

Commit

Permalink
Updated some tests to correspond to the same as before
Browse files Browse the repository at this point in the history
- There was a MCF flag in test_data/VOlturnUS-S.yaml that wasn't used for anything, but now it affects the results. Turned it to false. We should add something in test_member.py to test MCF.
- Included the unit spectrum to avoid breaking other peoples cases. The constant spectrum with height 1 is the same as the unit spectrum.
  • Loading branch information
lucas-carmo committed Apr 11, 2024
1 parent 2b41d1b commit 9d4ef86
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
6 changes: 4 additions & 2 deletions raft/raft_fowt.py
Original file line number Diff line number Diff line change
Expand Up @@ -962,10 +962,12 @@ def calcHydroExcitation(self, case, memberList=[], dgamma=0):
# make wave spectrum for each heading
self.S = np.zeros([self.nWaves,self.nw])
for ih in range(self.nWaves):
if case['wave_spectrum'][ih] == 'constant':
if case['wave_spectrum'][ih] == 'unit':
self.S[ih,:] = np.tile(1, self.nw)
self.zeta[ih,:] = np.sqrt(2*self.S[ih,:]*self.dw) # wave elevation amplitudes (these are easiest to use)
elif case['wave_spectrum'][ih] == 'constant':
self.S[ih,:] = case['wave_height'][ih]
self.zeta[ih,:] = np.sqrt(2*self.S*self.dw)
# self.zeta[ih,:] = np.tile(case['wave_height'][ih], self.nw)
elif case['wave_spectrum'][ih] == 'JONSWAP':
self.S[ih,:] = JONSWAP(self.w, case['wave_height'][ih], case['wave_period'][ih], Gamma=case['wave_gamma'][ih])
self.zeta[ih,:] = np.sqrt(2*self.S[ih,:]*self.dw) # wave elevation amplitudes (these are easiest to use)
Expand Down
6 changes: 1 addition & 5 deletions tests/test_data/VolturnUS-S.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1084,8 +1084,7 @@ platform:
rB : [ 0, 0, 15] # [m] and B coordinates
shape : circ # [-] circular or rectangular
gamma : 0.0 # [deg] twist angle about the member's z-axis
potMod : False # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
MCF : True # [bool] Whether to correct the inertia coefficient using the MacCamy and Fuchs correction
potMod : False # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
# --- outer shell including hydro---
stations : [0, 1] # [-] location of stations along axis. Will be normalized such that start value maps to rA and end value to rB
d : 9.85 # [m] diameters if circular or side lengths if rectangular (can be pairs)
Expand All @@ -1109,7 +1108,6 @@ platform:
shape : circ # [-] circular or rectangular
gamma : 0.0 # [deg] twist angle about the member's z-axis
potMod : False # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
MCF : True # [bool] Whether to correct the inertia coefficient using the MacCamy and Fuchs correction
# --- outer shell including hydro---
stations : [0, 35] # [-] location of stations along axis. Will be normalized such that start value maps to rA and end value to rB
d : 12.23 # [m] diameters if circular or side lengths if rectangular (can be pairs)
Expand All @@ -1136,7 +1134,6 @@ platform:
shape : rect # [-] circular or rectangular
gamma : 0.0 # [deg] twist angle about the member's z-axis
potMod : False # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
MCF : False # [bool] Whether to correct the inertia coefficient using the MacCamy and Fuchs correction
# --- outer shell including hydro---
stations : [0, 40.5] # [-] location of stations along axis. Will be normalized such that start value maps to rA and end value to rB
d : [12.4, 7.0] # [m] diameters if circular or side lengths if rectangular (can be pairs)
Expand All @@ -1158,7 +1155,6 @@ platform:
shape : circ # [-] circular or rectangular
gamma : 0.0 # [deg] twist angle about the member's z-axis
potMod : False # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
MCF : False # [bool] Whether to correct the inertia coefficient using the MacCamy and Fuchs correction
# --- outer shell including hydro---
stations : [0, 1] # [-] location of stations along axis. Will be normalized such that start value maps to rA and end value to rB
d : 0.91 # [m] diameters if circular or side lengths if rectangular (can be pairs)
Expand Down
6 changes: 3 additions & 3 deletions tests/test_fowt.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def test_hydroLinearization(index_and_fowt):
fowt = create_fowt(list_files[index])

# test_statics((index,fowt))
# test_hydroConstants((index,fowt))
# test_hydroExcitation((index,fowt))
test_hydroLinearization((index,fowt))
# # test_hydroConstants((index,fowt))
test_hydroExcitation((index,fowt))
# test_hydroLinearization((index,fowt))

0 comments on commit 9d4ef86

Please sign in to comment.