Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove TurbineType parameter #1610

Merged
merged 1 commit into from
Jun 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion modules/openfast-library/src/FAST_Registry.txt
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ typedef ^ FAST_ParameterType INTEGER n_SttsTime - - - "Number of time steps betw
typedef ^ FAST_ParameterType INTEGER n_ChkptTime - - - "Number of time steps between writing checkpoint files" -
typedef ^ FAST_ParameterType INTEGER n_DT_Out - - - "Number of time steps between writing a line in the time-marching output files" -
typedef ^ FAST_ParameterType INTEGER n_VTKTime - - - "Number of time steps between writing VTK files" -
typedef ^ FAST_ParameterType IntKi TurbineType - - - "Type_LandBased, Type_Offshore_Fixed, Type_Offshore_Floating, Type_MHK_Fixed, or Type_MHK_Floating" -
typedef ^ FAST_ParameterType LOGICAL WrBinOutFile - - - "Write a binary output file? (.outb)" -
typedef ^ FAST_ParameterType LOGICAL WrTxtOutFile - - - "Write a text (formatted) output file? (.out)" -
typedef ^ FAST_ParameterType IntKi WrBinMod - - - "If writing binary, which file format is to be written [1, 2, or 3]" -
Expand Down
58 changes: 0 additions & 58 deletions modules/openfast-library/src/FAST_Subs.f90
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,6 @@ SUBROUTINE FAST_InitializeAll( t_initial, p_FAST, y_FAST, m_FAST, ED, BD, SrvD,
CALL SetModuleSubstepTime(Module_ED, p_FAST, y_FAST, ErrStat2, ErrMsg2)
CALL SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName)

! bjj: added this check per jmj; perhaps it would be better in ElastoDyn, but I'll leave it here for now:
IF ( p_FAST%TurbineType == Type_Offshore_Floating ) THEN
IF ( ED%p%TowerBsHt < 0.0_ReKi .AND. .NOT. EqualRealNos( ED%p%TowerBsHt, 0.0_ReKi ) ) THEN
CALL SetErrStat(ErrID_Fatal,"ElastoDyn TowerBsHt must not be negative for floating offshore systems.",ErrStat,ErrMsg,RoutineName)
END IF
END IF

allocate( y_FAST%Lin%Modules(MODULE_ED)%Instance(1), stat=ErrStat2)
if (ErrStat2 /= 0 ) then
call SetErrStat(ErrID_Fatal, "Error allocating Lin%Modules(ED).", ErrStat, ErrMsg, RoutineName )
Expand Down Expand Up @@ -446,12 +439,6 @@ SUBROUTINE FAST_InitializeAll( t_initial, p_FAST, y_FAST, m_FAST, ED, BD, SrvD,
CALL SetModuleSubstepTime(Module_AD14, p_FAST, y_FAST, ErrStat2, ErrMsg2)
CALL SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName)

! bjj: this really shouldn't be in the FAST glue code, but I'm going to put this check here so people don't use an invalid model
! and send me emails to debug numerical issues in their results.
IF ( AD14%p%TwrProps%PJM_Version .AND. p_FAST%TurbineType == Type_Offshore_Floating ) THEN
CALL SetErrStat(ErrID_Fatal,'AeroDyn v14 tower influence model "NEWTOWER" is invalid for models of floating offshore turbines.',ErrStat,ErrMsg,RoutineName)
END IF

AirDens = Init%OutData_AD14%AirDens

IF (ErrStat >= AbortErrLev) THEN
Expand Down Expand Up @@ -1866,30 +1853,6 @@ SUBROUTINE FAST_Init( p, m_FAST, y_FAST, t_initial, InputFile, ErrStat, ErrMsg,

p%nBeams = 0 ! initialize number of BeamDyn instances (will be set later)

! determine what kind of turbine we're modeling:
IF ( p%MHK == 1 ) THEN
p%TurbineType = Type_MHK_Fixed
ELSEIF ( p%MHK == 2 ) THEN
p%TurbineType = Type_MHK_Floating
ELSEIF ( p%CompHydro == Module_HD ) THEN
IF ( p%CompSub == Module_SD ) THEN
p%TurbineType = Type_Offshore_Fixed
ELSE
p%TurbineType = Type_Offshore_Floating
END IF
ELSEIF ( p%CompMooring == Module_Orca ) THEN
p%TurbineType = Type_Offshore_Floating
ELSEIF ( p%CompSub == Module_ExtPtfm ) THEN
p%TurbineType = Type_Offshore_Fixed
ELSEIF ( p%MHK == 1 ) THEN
p%TurbineType = Type_MHK_Fixed
ELSEIF ( p%MHK == 2 ) THEN
p%TurbineType = Type_MHK_Floating
ELSE
p%TurbineType = Type_LandBased
END IF


p%n_TMax_m1 = CEILING( ( (p%TMax - t_initial) / p%DT ) ) - 1 ! We're going to go from step 0 to n_TMax (thus the -1 here)

if (p%TMax < 1.0_DbKi) then ! log10(0) gives floating point divide-by-zero error
Expand Down Expand Up @@ -2092,11 +2055,6 @@ SUBROUTINE ValidateInputData(p, m_FAST, ErrStat, ErrMsg)
if (p%CompIce /= MODULE_None) call SetErrStat(ErrID_Fatal,'Linearization is not implemented for any of the ice loading modules.',ErrStat, ErrMsg, RoutineName)

end if


if ( (p%TurbineType == Type_Offshore_Fixed .or. p%TurbineType == Type_Offshore_Floating) .and. .not. EqualRealNos(p%TurbinePos(3), 0.0_SiKi) ) then
call SetErrStat(ErrID_Fatal, 'Height of turbine location, TurbinePos(3), must be 0 for offshore turbines.', ErrStat, ErrMsg, RoutineName)
end if

!...............................................................................................................................

Expand Down Expand Up @@ -4092,22 +4050,6 @@ SUBROUTINE FAST_WrSum( p_FAST, y_FAST, MeshMapData, ErrStat, ErrMsg )
! output file format (text/binary)
! coupling method

SELECT CASE ( p_FAST%TurbineType )
CASE ( Type_LandBased )
DescStr = 'Modeling a land-based turbine'
CASE ( Type_Offshore_Fixed )
DescStr = 'Modeling a fixed-bottom offshore turbine'
CASE ( Type_Offshore_Floating )
DescStr = 'Modeling a floating offshore turbine'
CASE ( Type_MHK_Fixed )
DescStr = 'Modeling a fixed-bottom MHK turbine'
CASE ( Type_MHK_Floating )
DescStr = 'Modeling a floating MHK turbine'
CASE DEFAULT ! This should never happen
DescStr=""
END SELECT
WRITE(y_FAST%UnSum,'(//A)') TRIM(DescStr)

WRITE (y_FAST%UnSum,'(A)' ) 'Description from the FAST input file: '
WRITE (y_FAST%UnSum,'(2X,A)') TRIM(p_FAST%FTitle)

Expand Down
9 changes: 1 addition & 8 deletions modules/openfast-library/src/FAST_Types.f90
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ MODULE FAST_Types
INTEGER(IntKi) :: n_ChkptTime !< Number of time steps between writing checkpoint files [-]
INTEGER(IntKi) :: n_DT_Out !< Number of time steps between writing a line in the time-marching output files [-]
INTEGER(IntKi) :: n_VTKTime !< Number of time steps between writing VTK files [-]
INTEGER(IntKi) :: TurbineType !< Type_LandBased, Type_Offshore_Fixed, Type_Offshore_Floating, Type_MHK_Fixed, or Type_MHK_Floating [-]
LOGICAL :: WrBinOutFile !< Write a binary output file? (.outb) [-]
LOGICAL :: WrTxtOutFile !< Write a text (formatted) output file? (.out) [-]
INTEGER(IntKi) :: WrBinMod !< If writing binary, which file format is to be written [1, 2, or 3] [-]
Expand Down Expand Up @@ -775,7 +774,7 @@ MODULE FAST_Types
CHARACTER(1024) :: RootName !< Root name of FAST output files (overrides normal operation) [-]
INTEGER(IntKi) :: NumActForcePtsBlade !< number of actuator line force points in blade [-]
INTEGER(IntKi) :: NumActForcePtsTower !< number of actuator line force points in tower [-]
INTEGER(IntKi) :: NodeClusterType !< Node clustering for actuator line (0 - Uniform, 1 - Non-uniform clustered towards tip) [-]
LOGICAL :: NodeClusterType !< Node clustering for actuator line (0 - Uniform, 1 - Non-uniform clustered towards tip) [-]
END TYPE FAST_ExternInitType
! =======================
! ========= FAST_TurbineType =======
Expand Down Expand Up @@ -2208,7 +2207,6 @@ SUBROUTINE FAST_CopyParam( SrcParamData, DstParamData, CtrlCode, ErrStat, ErrMsg
DstParamData%n_ChkptTime = SrcParamData%n_ChkptTime
DstParamData%n_DT_Out = SrcParamData%n_DT_Out
DstParamData%n_VTKTime = SrcParamData%n_VTKTime
DstParamData%TurbineType = SrcParamData%TurbineType
DstParamData%WrBinOutFile = SrcParamData%WrBinOutFile
DstParamData%WrTxtOutFile = SrcParamData%WrTxtOutFile
DstParamData%WrBinMod = SrcParamData%WrBinMod
Expand Down Expand Up @@ -2370,7 +2368,6 @@ SUBROUTINE FAST_PackParam( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg,
Int_BufSz = Int_BufSz + 1 ! n_ChkptTime
Int_BufSz = Int_BufSz + 1 ! n_DT_Out
Int_BufSz = Int_BufSz + 1 ! n_VTKTime
Int_BufSz = Int_BufSz + 1 ! TurbineType
Int_BufSz = Int_BufSz + 1 ! WrBinOutFile
Int_BufSz = Int_BufSz + 1 ! WrTxtOutFile
Int_BufSz = Int_BufSz + 1 ! WrBinMod
Expand Down Expand Up @@ -2613,8 +2610,6 @@ SUBROUTINE FAST_PackParam( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg,
Int_Xferred = Int_Xferred + 1
IntKiBuf(Int_Xferred) = InData%n_VTKTime
Int_Xferred = Int_Xferred + 1
IntKiBuf(Int_Xferred) = InData%TurbineType
Int_Xferred = Int_Xferred + 1
IntKiBuf(Int_Xferred) = TRANSFER(InData%WrBinOutFile, IntKiBuf(1))
Int_Xferred = Int_Xferred + 1
IntKiBuf(Int_Xferred) = TRANSFER(InData%WrTxtOutFile, IntKiBuf(1))
Expand Down Expand Up @@ -2942,8 +2937,6 @@ SUBROUTINE FAST_UnPackParam( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMs
Int_Xferred = Int_Xferred + 1
OutData%n_VTKTime = IntKiBuf(Int_Xferred)
Int_Xferred = Int_Xferred + 1
OutData%TurbineType = IntKiBuf(Int_Xferred)
Int_Xferred = Int_Xferred + 1
OutData%WrBinOutFile = TRANSFER(IntKiBuf(Int_Xferred), OutData%WrBinOutFile)
Int_Xferred = Int_Xferred + 1
OutData%WrTxtOutFile = TRANSFER(IntKiBuf(Int_Xferred), OutData%WrTxtOutFile)
Expand Down
10 changes: 5 additions & 5 deletions modules/openfoam/src/OpenFOAM_Types.f90
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ MODULE OpenFOAM_Types
REAL(KIND=C_FLOAT) :: BladeLength
REAL(KIND=C_FLOAT) :: TowerHeight
REAL(KIND=C_FLOAT) :: TowerBaseHeight
LOGICAL(KIND=C_BOOL) :: NodeClusterType
INTEGER(KIND=C_INT) :: NodeClusterType
END TYPE OpFM_ParameterType_C
TYPE, PUBLIC :: OpFM_ParameterType
TYPE( OpFM_ParameterType_C ) :: C_obj
Expand Down Expand Up @@ -419,7 +419,7 @@ SUBROUTINE OpFM_PackInitInput( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrM
Re_Xferred = Re_Xferred + 1
ReKiBuf(Re_Xferred) = InData%TowerBaseHeight
Re_Xferred = Re_Xferred + 1
IntKiBuf(Int_Xferred) = TRANSFER(InData%NodeClusterType, IntKiBuf(1))
IntKiBuf(Int_Xferred) = InData%NodeClusterType
Int_Xferred = Int_Xferred + 1
END SUBROUTINE OpFM_PackInitInput

Expand Down Expand Up @@ -507,7 +507,7 @@ SUBROUTINE OpFM_UnPackInitInput( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, E
OutData%TowerBaseHeight = ReKiBuf(Re_Xferred)
Re_Xferred = Re_Xferred + 1
OutData%C_obj%TowerBaseHeight = OutData%TowerBaseHeight
OutData%NodeClusterType = TRANSFER(IntKiBuf(Int_Xferred), OutData%NodeClusterType)
OutData%NodeClusterType = IntKiBuf(Int_Xferred)
Int_Xferred = Int_Xferred + 1
OutData%C_obj%NodeClusterType = OutData%NodeClusterType
END SUBROUTINE OpFM_UnPackInitInput
Expand Down Expand Up @@ -1957,7 +1957,7 @@ SUBROUTINE OpFM_PackParam( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg,
Re_Xferred = Re_Xferred + 1
ReKiBuf(Re_Xferred) = InData%TowerBaseHeight
Re_Xferred = Re_Xferred + 1
IntKiBuf(Int_Xferred) = TRANSFER(InData%NodeClusterType, IntKiBuf(1))
IntKiBuf(Int_Xferred) = InData%NodeClusterType
Int_Xferred = Int_Xferred + 1
END SUBROUTINE OpFM_PackParam

Expand Down Expand Up @@ -2060,7 +2060,7 @@ SUBROUTINE OpFM_UnPackParam( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMs
OutData%TowerBaseHeight = ReKiBuf(Re_Xferred)
Re_Xferred = Re_Xferred + 1
OutData%C_obj%TowerBaseHeight = OutData%TowerBaseHeight
OutData%NodeClusterType = TRANSFER(IntKiBuf(Int_Xferred), OutData%NodeClusterType)
OutData%NodeClusterType = IntKiBuf(Int_Xferred)
Int_Xferred = Int_Xferred + 1
OutData%C_obj%NodeClusterType = OutData%NodeClusterType
END SUBROUTINE OpFM_UnPackParam
Expand Down