Skip to content

Commit f6fe2c5

Browse files
committed
Linear Trim Solution: update range calculation when NLinTimes=1
When linearizing with a trim solution and NLinTimes=1, the range of the reference outputs was always 0.01. Now it uses the channel value. This could probably be modified further, but for now, it gives a slightly better "range"
1 parent f9f1986 commit f6fe2c5

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

modules/openfast-library/src/FAST_Lin.f90

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6928,10 +6928,16 @@ SUBROUTINE ComputeOutputRanges(p_FAST, y_FAST, m_FAST, y_SrvD)
69286928

69296929
! note that op_y may be larger than SizeLin if there are orientations; also, we are NOT including the WriteOutputs
69306930

6931-
do indx = 1,y_FAST%Lin%Glue%SizeLin(LIN_OUTPUT_COL)
6932-
m_FAST%Lin%y_ref(indx) = maxval( m_FAST%Lin%Y_prevRot( indx, : ) ) - minval( m_FAST%Lin%Y_prevRot( indx, : ) )
6933-
m_FAST%Lin%y_ref(indx) = max( m_FAST%Lin%y_ref(indx), 0.01_ReKi )
6934-
end do
6931+
if (p_FAST%NLinTimes == 1) then ! NOTE: maxval( m_FAST%Lin%Y_prevRot( indx, : ) ) - minval( m_FAST%Lin%Y_prevRot( indx, : ) ) = 0 in this case
6932+
do indx = 1,y_FAST%Lin%Glue%SizeLin(LIN_OUTPUT_COL)
6933+
m_FAST%Lin%y_ref(indx) = max( abs(m_FAST%Lin%Y_prevRot( indx, p_FAST%NLinTimes )), 0.01_ReKi )
6934+
end do
6935+
else
6936+
do indx = 1,y_FAST%Lin%Glue%SizeLin(LIN_OUTPUT_COL)
6937+
m_FAST%Lin%y_ref(indx) = maxval( m_FAST%Lin%Y_prevRot( indx, : ) ) - minval( m_FAST%Lin%Y_prevRot( indx, : ) )
6938+
m_FAST%Lin%y_ref(indx) = max( m_FAST%Lin%y_ref(indx), 0.01_ReKi )
6939+
end do
6940+
end if
69356941

69366942
! special case for angles:
69376943
indx = Indx_y_Yaw_Start(y_FAST, Module_ED) ! start of ED where Yaw, YawRate, HSS_Spd occur (right before WriteOutputs)

0 commit comments

Comments
 (0)