!soil(CS spring) with seismic by Jason. Lai !======================================================================= SUBROUTINE UserPtfmLd ( X, XD, ZTime, DirRoot, PtfmAM, PtfmFt ) USE Precision USE General,ONLY:AnalMode,PriFile USE Constants USE MassInert USE SimCont,ONLY:DT USE Seismic ! Use Seismic to access information specific to seismic loading IMPLICIT NONE ! Passed Variables: REAL(ReKi), INTENT(OUT) :: PtfmAM (6,6) ! Platform added mass matrix, kg, kg-m, kg-m^2. REAL(ReKi), INTENT(OUT) :: PtfmFt (6) ! The 3 components of the portion of the platform force (in N ) acting at the platform reference and the 3 components of the portion of the platform moment (in N-m ) acting at the platform reference associated with everything but the added-mass effects; positive forces are in the direction of motion. REAL(ReKi), INTENT(IN ) :: X (6) ! The 3 components of the translational displacement (in m ) of the platform reference and the 3 components of the rotational displacement (in rad ) of the platform relative to the inertial frame. REAL(ReKi), INTENT(IN ) :: XD (6) ! The 3 components of the translational velocity (in m/s) of the platform reference and the 3 components of the rotational (angular) velocity (in rad/s) of the platform relative to the inertial frame. REAL(ReKi), INTENT(IN ) :: ZTime ! Current simulation time, sec. CHARACTER(1024), INTENT(IN ) :: DirRoot ! The name of the root file including the full path to the current working directory. This may be useful if you want this routine to write a permanent record of what it does to be stored with the simulation results: the results should be stored in a file whose name (including path) is generated by appending any suitable extension to DirRoot. ! Local Variables: REAL(ReKi) :: kTrans = 0.0 ! The translational stiffness of the "actuator" REAL(ReKi) :: cTrans = 0.0 ! The translational damping of the "actuator" REAL(ReKi) :: Damp (6,6) ! Damping matrix. REAL(ReKi) :: Stff (6,6) ! Stiffness/restoring matrix. INTEGER(4) :: I ! Generic index. INTEGER(4) :: J ! Generic index. CHARACTER(64) :: StatusString ! A string to store a status message in CHARACTER(64) :: PriFileBase ! A string with the base of the primary filename INTEGER(4) :: BaseIndex ! The index where the basename ends INTEGER(4) :: iTimeStep ! The current time step INTEGER(4) :: prevCallTimeStep ! The time step that I was previously called at INTEGER(4) :: iCallCurStep ! The time step that I was previously called at Damp (1,:) = (/ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 /) Damp (2,:) = (/ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 /) Damp (3,:) = (/ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 /) Damp (4,:) = (/ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 /) Damp (5,:) = (/ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 /) Damp (6,:) = (/ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 /) Stff (1,:) = (/ 2574800000.0, 0.0, 0.0, 0.0, -22532500000.0, 0.0 /) !JASON: IMPLEMENT CHANGE DATED August 16, 2007:Stff (1,:) = (/ 2574800000.0, 0.0, 0.0, 0.0, -22532500000.0, 0.0 /) Stff (2,:) = (/ 0.0, 2574800000.0, 0.0, -22532500000.0, 0.0, 0.0 /) !JASON: IMPLEMENT CHANGE DATED August 16, 2007:Stff (2,:) = (/ 0.0, 2574800000.0, 0.0, -22532500000.0, 0.0, 0.0 /) Stff (3,:) = (/ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 /) !JASON: IMPLEMENT CHANGE DATED August 16, 2007:Stff (3,:) = (/ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 /) Stff (4,:) = (/ 0.0, -22532500000.0, 0.0, 262912300000.0, 0.0, 0.0 /) !JASON: IMPLEMENT CHANGE DATED August 16, 2007:Stff (4,:) = (/ 0.0, -22532500000.0, 0.0, 262912300000.0, 0.0, 0.0 /) Stff (5,:) = (/ -22532500000.0, 0.0, 0.0, 0.0, 262912300000.0, 0.0 /) !JASON: IMPLEMENT CHANGE DATED August 16, 2007:Stff (5,:) = (/ -22532500000.0, 0.0, 0.0, 0.0, 262912300000.0, 0.0 /) Stff (6,:) = (/ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 /) !JASON: IMPLEMENT CHANGE DATED August 16, 2007:Stff (6,:) = (/ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 /) PtfmAM(1,:) = (/ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 /) PtfmAM(2,:) = (/ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 /) PtfmAM(3,:) = (/ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 /) PtfmAM(4,:) = (/ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 /) PtfmAM(5,:) = (/ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 /) PtfmAM(6,:) = (/ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 /) PtfmFt(1) = 0.0 PtfmFt(2) = 0.0 PtfmFt(3) = 0.0 PtfmFt(4) = 0.0 PtfmFt(5) = 0.0 PtfmFt(6) = 0.0 DO J = 1,6 DO I = 1,6 PtfmFt(I) = PtfmFt(I) - Damp(I,J)*XD(J) - Stff(I,J)*X(J) ENDDO ENDDO IF ( AnalMode == 1 ) THEN ! Only calculate seismic loading if this is a time simulation IF ( InitSeismic ) THEN prevCallTimeStep = 0 iCallCurStep = 0 CALL WrScr1 ( ' Initializing seismic parameters') BaseIndex = INDEX(PriFile, '.fst') SeismicFilename = PriFile(1:BaseIndex-1)//'_Seismic.dat' CALL WrScr1 ( ' Using Seismic file '//SeismicFilename) CALL ReadSeismicFile ! Read the parameters from the seismic input file. InitSeismic = .FALSE. WRITE(StatusString,'(A,F15.2,A)') 'The turbine mass is ', TurbMass, ' kg.' CALL WrScr1 ( StatusString) WRITE(StatusString,'(A,F15.2,A)') 'The total mass is ', TotalMass, ' kg.' CALL WrScr1 ( StatusString) kTrans = TotalMass*ActFreq**2 ! The translational stiffness of the actuator cTrans = 2*ActDamp*TotalMass*ActFreq ! The translational damping of the actuator ENDIF iTimeStep = ZTime/DT+1 IF ( iTimeStep >= 1 ) THEN DO I = 1,6 IF (I >= 1 .AND. I<=3 ) THEN IF (ActFreq /= 0 ) THEN PtfmFt(I) = kTrans*(PtfmDisp(I,iTimeStep)-X(I))+cTrans*(PtfmVel(I,iTimeStep)-XD(I)) ELSE PtfmFt(I) = TotalMass*PtfmAccel(I,iTimeStep) ENDIF ! Only deal with the translational components for now ENDIF ENDDO ENDIF ENDIF RETURN END SUBROUTINE UserPtfmLd !======================================================================= ! This is the end of the seismic UserPtfmLd !=======================================================================