## 7.2. Subroutine EXVEL

The listing shown below is for a user supplied EXVEL subroutine which is used for two user defined velocity constraints: V-POSITIVE and V-NEGATIVE which are used to constrain the y-component of velocity.

    SUBROUTINE EXVEL (NAMVEL,RBC,K,XB,YB,UXT,UYT)

          USE kindef
          USE bnddef
          USE ijknow
          USE wrapup

          IMPLICIT NONE

          INTEGER (INT4) ::      K
          REAL (REAL8)   ::    UXT,    UYT,     XB,     YB
          REAL (REAL8), DIMENSION(5) :: RBC
          CHARACTER (LEN=10) :: NAMVEL
    !
    ! ******************************************************************
    !
    !  THIS IS A USER SUPPLIED SUBROUTINE WHICH APPLIES VELOCITY
    !  CONSTRAINTS TO NODES. THE ROUTINE IS CALLED ONCE PER CYCLE FOR
    !  EACH NODE ASSIGNED WITH THE USER VELOCITY CONSTRAINT
    !  THROUGH INPUT. THE USER VELOCITY CONSTRAINT IS USED WHEN THE
    !  X AND Y VELOCITY CONSTRAINTS CANNOT BE DESCRIBED BY A
    !  COMBINATION OF THE STANDARD VELOCITY CONSTRAINTS
    !  AVAILABLE IN AUTODYN INPUT PARAMETERS

    !  INPUT PARAMETERS

    !    NAMVEL    BOUNDARY CONDITION NAME
    !              (SUPPLIED BY USER DURING INPUT)
    !    RBC(1-5)  INPUT PARAMETERS FOR BOUNDARY CONDITION
    !    K    = 0, REGULAR NODE, (I,J) FOR NODE IS DEFINED BY 'INOW'
    !              AND 'JNOW' IN MODULE 'IJKNOW'
    !         < 0, INTERACTIVE NODE, K IS THE INTERACTIVE NODE #
    !    XB        X-COORDINATE OF NODE AT BEGINNING OF CYCLE
    !    YB        Y-COORDINATE OF NODE AT BEGINNING OF CYCLE
    !    UXT       TENTATIVE X-VELOCITY BEFORE CONSTRAINTS
    !    UYT       TENTATIVE Y-VELOCITY BEFORE CONSTRAINTS

    !  OUTPUT PARAMETERS
    !
    !    UXT   X-VELOCITY AFTER CONSTRAINT HAS BEEN APPLIED
    !    UYT   Y-VELOCITY AFTER CONSTRAINT HAS BEEN APPLIED
    !   NOTE: AFTER RETURNING FROM THIS ROUTINE,
    !     END OF CYCLE COORDINATES WILL BE COMPUTED USING:-
    !     XE = XB + UXT*DLTH    YE = YB + UYT*DLTH
    !
    !   SO YOU CAN CONSTRAIN THE DOMAIN OF X AND Y BY DIRECTLY
    !   MODIFYING UXT AND UYT TO ENSURE THAT XE AND/OR YE REMAIN
    !   WITHIN CERTAIN BOUNDS

    !  THE FOLLOWING MODULES CONTAIN INFORMATION WHICH MAY
    !  BE USEFUL FOR COMPUTING THE VELOCITY CONSTRAINTS :-

    ! 	MODULE'IJKNOW'

    !		INOW - I INDEX FOR CURRENT CELL
    !		JNOW - J INDEX FOR CURRENT CELL
    !		MNOW - CURRENT PART NUMBER

    ! 	MODULE'BNDDEF'

    !		LIMBDY - Initial limit on number of boundary conditions
    !		LIMBDC - Initial limit on number of parameters stored for each boundary condition
    !		DYN_LIMBDY -  Maximum number of dynamically allocated boundary conditions
    !		   when the number of boundary conditions exceeds the initial maximum LIMBDY
    !		DYN_LIMBDC - Maximum number of dynamically allocated parameters for each boundary
    !		   condition when the number of parameters exceeds the initial maximum LIMBDC
    !		NUMBDY - Number of boundary conditions

    ! 	MODULE'KINDEF'

    !		 PI     = 3.1415927
    ! 		THIRD  = 1.0/3.0
    ! 		SMALL  = 1.0E-20
    ! 		ZERO   = 0.0
    ! 		ONE    = 1.0

    ! ******************************************************************
    !
           CHARACTER*40 TEXT40
    !
           IF (NAMVEL.EQ.'V-POSITIVE') THEN
              UYT = MAX (UYT,0.0)
           ELSE IF (NAMVEL.EQ.'V-NEGATIVE') THEN
                   UYT = MIN (UYT,0.0)
                ELSE
                   WRITE (TEXT40,'(3A)') '$Error EXVEL is called as :',NAMVEL,'$'
                   CALL USR_MESSAG (TEXT40)
                   NSWRAP = 99
           ENDIF

    !  TERMINATION OF SUBROUTINE EXVEL
           RETURN
           END SUBROUTINE EXVEL

Release 18.2 - © ANSYS, Inc. All rights reserved.