From c620b0b38485023d700f20eca94e12406b023449 Mon Sep 17 00:00:00 2001 From: Hannah Ross Date: Tue, 6 Jun 2023 10:05:54 -0600 Subject: [PATCH] Remove TurbineType parameter --- .../openfast-library/src/FAST_Registry.txt | 1 - modules/openfast-library/src/FAST_Subs.f90 | 58 ------------------- modules/openfast-library/src/FAST_Types.f90 | 9 +-- modules/openfoam/src/OpenFOAM_Types.f90 | 10 ++-- 4 files changed, 6 insertions(+), 72 deletions(-) diff --git a/modules/openfast-library/src/FAST_Registry.txt b/modules/openfast-library/src/FAST_Registry.txt index c2205023e7..fb3d0671d1 100644 --- a/modules/openfast-library/src/FAST_Registry.txt +++ b/modules/openfast-library/src/FAST_Registry.txt @@ -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]" - diff --git a/modules/openfast-library/src/FAST_Subs.f90 b/modules/openfast-library/src/FAST_Subs.f90 index 0e0585a17f..0b604efd34 100644 --- a/modules/openfast-library/src/FAST_Subs.f90 +++ b/modules/openfast-library/src/FAST_Subs.f90 @@ -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 ) @@ -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 @@ -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 @@ -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 !............................................................................................................................... @@ -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) diff --git a/modules/openfast-library/src/FAST_Types.f90 b/modules/openfast-library/src/FAST_Types.f90 index 7a2b73f8f1..124e2bcf97 100644 --- a/modules/openfast-library/src/FAST_Types.f90 +++ b/modules/openfast-library/src/FAST_Types.f90 @@ -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] [-] @@ -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 ======= @@ -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 @@ -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 @@ -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)) @@ -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) diff --git a/modules/openfoam/src/OpenFOAM_Types.f90 b/modules/openfoam/src/OpenFOAM_Types.f90 index a3a92c86e5..3613f4b483 100644 --- a/modules/openfoam/src/OpenFOAM_Types.f90 +++ b/modules/openfoam/src/OpenFOAM_Types.f90 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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