Skip to content

Commit

Permalink
Merge branch 'rc1.3.2' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-carmo committed Nov 8, 2024
2 parents 872ab5d + 9b9aabb commit e5a7cbb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
1 change: 1 addition & 0 deletions .github/workflows/CI_RAFT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
os: ["ubuntu-latest", "macOS-latest", "windows-latest"]
python-version: ["3.10", "3.11"]


steps:
- name: checkout repository
uses: actions/checkout@v4
Expand Down
15 changes: 10 additions & 5 deletions raft/raft_fowt.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os
import matplotlib.pyplot as plt
import numpy as np
from scipy.interpolate import interp1d, interp2d, griddata
from scipy.interpolate import interp1d, RegularGridInterpolator, griddata

import raft.member2pnl as pnl
from raft.helpers import *
Expand Down Expand Up @@ -1796,10 +1796,15 @@ def calcHydroForce_2ndOrd(self, beta, S0, iCase=None, iWT=None, interpMode='qtf'
else:
f = np.zeros([self.nDOF, self.nw]) # Force amplitude
for idof in range(0,self.nDOF):
# Interpolate the QTF matrix to the same frequencies as the wave spectrum. Need to interpolate real and imaginary part separately.
qtf_interp_Re = interp2d(self.w1_2nd, self.w1_2nd, qtf_interpBeta[:,:, idof].real, bounds_error=False, fill_value=(0))(self.w, self.w)
qtf_interp_Im = interp2d(self.w1_2nd, self.w1_2nd, qtf_interpBeta[:,:, idof].imag, bounds_error=False, fill_value=(0))(self.w, self.w)
qtf_interp = qtf_interp_Re + 1j*qtf_interp_Im
qtf_interp_Re_interpolator = RegularGridInterpolator((self.w1_2nd, self.w1_2nd), qtf_interpBeta[:, :, idof].real, bounds_error=False, fill_value=0)
qtf_interp_Im_interpolator = RegularGridInterpolator((self.w1_2nd, self.w1_2nd), qtf_interpBeta[:, :, idof].imag, bounds_error=False, fill_value=0)

w_mesh = np.meshgrid(self.w, self.w, indexing='ij')
points = np.array([w_mesh[0].ravel(), w_mesh[1].ravel()]).T

qtf_interp_Re = qtf_interp_Re_interpolator(points).reshape(len(self.w), len(self.w))
qtf_interp_Im = qtf_interp_Im_interpolator(points).reshape(len(self.w), len(self.w))
qtf_interp = qtf_interp_Re + 1j * qtf_interp_Im

for imu in range(1, self.nw): # Loop the difference frequencies
Saux = np.zeros(self.nw)
Expand Down
10 changes: 5 additions & 5 deletions raft/raft_rotor.py
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ def calcAero(self, case, current=False, display=0):
b_inflow[0,0,:] = dT_dU

# Excitation vector
f_inflow = np.zeros([6,len(self.w)], dtype=np.complex_)
f_inflow = np.zeros([6,len(self.w)], dtype=np.complex128)
f_inflow[0,:] = dT_dU*self.V_w

# Rotate to global orientations
Expand All @@ -895,10 +895,10 @@ def calcAero(self, case, current=False, display=0):

a_aer = np.zeros_like(self.w)
b_aer = np.zeros_like(self.w)
C = np.zeros_like(self.w,dtype=np.complex_)
C2 = np.zeros_like(self.w,dtype=np.complex_)
D = np.zeros_like(self.w,dtype=np.complex_)
E = np.zeros_like(self.w,dtype=np.complex_)
C = np.zeros_like(self.w,dtype=np.complex128)
C2 = np.zeros_like(self.w,dtype=np.complex128)
D = np.zeros_like(self.w,dtype=np.complex128)
E = np.zeros_like(self.w,dtype=np.complex128)

# Roots of characteristic equation, helps w/ debugging
# p = np.array([-self.I_drivetrain, (dQ_dOm + self.kp_beta * dQ_dPi - self.Ng * kp_tau), self.ki_beta* dQ_dPi - self.Ng * ki_tau])
Expand Down

0 comments on commit e5a7cbb

Please sign in to comment.