!=======================================================================
SUBROUTINE DISCON ( avrSWAP, aviFAIL, accINFILE, avcOUTNAME, avcMSG )
!DEC$ ATTRIBUTES DLLEXPORT, ALIAS:'DISCON' :: DISCON
! This is a control routine for holding the place of a user-specified
! Bladed-style DLL controller. Modify this code to create your own
! DLL controller.
! This congtrol file was writen by Ruiliang.Wang On 2/4/2018,the script
! Can be used in commercial style
!The Moudle Library
USE MainSubroutine
USE SuperControl
USE LOG
USE BrakeProgram
IMPLICIT NONE
!The Passed Variables
REAL(4), INTENT(INOUT) :: avrSWAP (*) ! The swap array, used to pass data to, and receive data from, the DLL controller.
INTEGER(4), INTENT( OUT) :: aviFAIL ! A flag used to indicate the success of this DLL call set as follows: 0 if the DLL call was successful, >0 if the DLL call was successful but cMessage should be issued as a warning messsage, <0 if the DLL call was unsuccessful or for any other reason the simulation is to be stopped at this point with cMessage as the error message.
INTEGER(1), INTENT(IN ) :: accINFILE (*) ! The address of the first record of an array of 1-byte CHARACTERs giving the name of the parameter input file, 'DISCON.IN'.
INTEGER(1), INTENT( OUT) :: avcMSG (*) ! The address of the first record of an array of 1-byte CHARACTERS giving the message contained in cMessage, which will be displayed by the calling program if aviFAIL <> 0.
INTEGER(1), INTENT(INOUT) :: avcOUTNAME(*) ! The address of the first record of an array of 1-byte CHARACTERS giving the simulation run name without extension.
!Local
REAL(4), SAVE ::rPitchDemand
REAL(4), SAVE ::rTorqueDemand ! Desired collective pitch angles returned by this DLL (rad).
REAL(4), SAVE ::rNacDemandRate
!REAL(4), SAVE ::rTime ! Current simulation time (sec).
INTEGER(4) ::I ! Generic index.
INTEGER(4) ::iStatus ! A status flag set by the simulation as follows: 0 if this is the first call, 1 for all subsequent time steps, -1 if this is the final call at the end of the simulation.
INTEGER(1) :: iInFile ( 256) ! CHARACTER string cInFile stored as a 1-byte array.
INTEGER(1) :: iMessage ( 256) ! CHARACTER string cMessage stored as a 1-byte array.
INTEGER(1),SAVE :: iOutName (1024) ! CHARACTER string cOutName stored as a 1-byte array.
CHARACTER( 256) :: cInFile ! CHARACTER string giving the name of the parameter input file, 'DISCON.IN'
CHARACTER( 256) :: cMessage ! CHARACTER string giving a message that will be displayed by the calling program if aviFAIL <> 0.
CHARACTER(1024),SAVE :: cOutName ! CHARACTER string giving the simulation run name without extensio
INTEGER ::UnIn=40
! Set EQUIVALENCE relationships between INTEGER(1) byte arrays and CHARACTER strings:
EQUIVALENCE (iInFile , cInFile )
EQUIVALENCE (iMessage, cMessage)
EQUIVALENCE (iOutName, cOutName)
! Status
iStatus = NINT( avrSWAP( 1) )
aviFAIL = 0
! Initialization
IF ( iStatus == 0 ) THEN
! Convert byte arrays to CHARACTER strings, for convenience:
DO I = 1,MIN( 256, NINT( avrSWAP(50) ) )
iInFile (I) = accINFILE (I) ! Sets cInfile by EQUIVALENCE
ENDDO
DO I = 1,MIN( 1024, NINT( avrSWAP(51) ) )
iOutName(I) = avcOUTNAME(I) ! Sets cOutName by EQUIVALENCE
ENDDO
! READ IN DATA CONTAINED IN FILE cInFile HERE
aviFAIL = 0 ! SET aviFAIL AND cMessage IF ERROR RESULTS
cMessage = '' !
!Initialization
CALL INIT_CONTROLLER(avrSWAP,UnIn,cInFile,cOutName,rPitchDemand,rTorqueDemand)
ENDIF
!Preprocessor
CALL Preprocessor_Controller(avrSWAP)
!Monitor
CALL Monitor(rPitchDemand,rNacDemandRate)
IF( ( iStatus >= 0 ) .AND. ( aviFAIL >= 0 ) ) THEN
aviFAIL = 0 ! SET aviFAIL AND cMessage IF ERROR RESULTS
cMessage = '' !
!Main Controller
CALL MainController(iStatus,rPitchDemand,rTorqueDemand)
ENDIF
CALL BrakeProgram_Controller
!OutPut to the wind turbine actuator
CALL Output(avrSWAP,rNacDemandRate)
!Logging
CALL LogOutput(avrSWAP,cOutName)
!!Return Variable
DO I = 1,MIN( 256, NINT( avrSWAP(49) ) )
avcMSG(I) = iMessage(I) ! Same as cMessage by EQUIVALENCE
ENDDO
RETURN
END SUBROUTINE DISCON
四、我的公开课
以下是我的公开课安排
2022风电仿真设计学习月(六):风电机组动力学软件仿真控制器编写-仿真秀直播
自2022年以来,我们分别组织了《力学与有限元学习月》、《汽车仿真设计学习月》和《航空航天仿真设计学习月》,邀请各行业、高校和科研机构资深讲师,分享专业技术、行业经验和案例应用。旨在帮助仿真秀平台用户探索研发工程师的学习路线和知识体系(例如风电行业,结构强度,流场温度,疲劳,多体动力学simpack,螺栓强度和疲劳,混凝土塔筒计算,载荷计算bladed,matlab控制,风资源微观选址,塔筒设计和校核,叶片设计计算等等)。
1、直播安排
2022年8月27日-10月22日,我们迎来了《风力发电仿真设计学习月》,我们再次邀请6位平台优秀资深讲师,面向风力发电仿真设计场景分享行业解决方案。以下是具体安排
2、风力发电仿真技术进阶
3、永久免费的风电仿真学习包