VM210 Input Listing


/COM,ANSYS MEDIA REL. 2024R2 (05/10/2024) REF. VERIF. MANUAL: REL. 2024R2
/VERIFY,VM210
/TITLE,VM210, BENDING OF HEX-TO-TET INTERFACE, FORMATION OF PYRAMIDS
/COM,   ****** USING 3-D SOLID95 ******
/OUT,SCRATCH
/PREP7 
SMRT,OFF
ET,1,95                                  ! ELEMENT TYPE SOLID95
ET,2,95                                  ! ELEMENT TYPE SOLID95

*CREATE,MSHGEN3D,MAC                     ! CREATE MACRO TO GENERATE MESH
MP,EX,1,30E6                             ! ELASTIC MODULUS
MP,NUXY,1,0.3                            ! POISSON RATIO
P = 200                                  ! FORCE
W = 31.071                               ! WIDTH
H = 33.917                               ! HEIGHT
L = 37.264                               ! LENGTH
I = 1/12*(W)*(H**3)                      ! MOMENT OF INERTIA
SURF = P/(W*H)                           ! SURFACE FORCE 
BLOCK,-W/2, 0  , 0  , H/2, 0  ,  L
BLOCK, 0  , W/2, 0  , H/2, 0  ,  L       ! CREATE BLOCKS
BLOCK, 0  , W/2,-H/2, 0  , 0  ,  L       ! FORMING MIDPLANES
BLOCK,-W/2, 0  ,-H/2, 0  , 0  ,  L
WPOFF,,,L/2                              ! OFFSET WORKPLANE 
WPLANE,-1,0,0,18.632,.87653,.402592,18.896,-.437455,.894952,18.72
WPLANE,-1,0,0,18.632,.890222,.338091,18.937,-.405661,.893273,18.826
VSBW,ALL,,
VGLUE,ALL
NUMCMP,ALL
/VIEW, 1, 0.9227    , 0.3132    ,-0.2246
/ANG,  1,  4.473
/PNUM,LINE,1
/NUM,-1
LPLO
/PNUM,LINE,0
/NUM,0
LESIZE,ALL,,,2
MOPT,PYRA,ON                              ! MESH SET TO TRANSITIONAL PYRAMID
MSHK,1
MSHA,0
MSHM,0
TYPE,1
VSEL,S,VOLU,,1,2,1
VSEL,A,VOLU,,5,7,2
VMESH,ALL                                 ! VMESH ELEMENT TYPE 1
MSHK,0
MSHA,1,3D
MSHM,0
TYPE,2
VSEL,S,VOLU,,3,4,1
VSEL,A,VOLU,,6,8,2
VMESH,ALL                                ! VMESH ELEMENT TYPE 2
VSEL,ALL 
CSYS,4                                   ! USE WP AS LOCAL COOR. SYS
NSEL,S,LOC,Z,0                           ! SELECT ALL NODES ON WP
CSYS,0                                   ! REVERT COOR. SYS TO CART.
ESLN                                     ! ALL ELEMENTS ATTACHED TO WP NODES
NSLE                                     ! AND ALL NODES ATT. TO ELEMS
/SHRINK,0.5
/VIEW,1,  0.51440  , -0.35450 ,  -0.78090
/ANG,1 ,1.41
EPLO                                     ! ADJUST VIEW AND CAPTURE INTERFACE
/SHRINK,0
*END

MSHGEN3D                                 ! READ MACRO TO GENERATE MESH

*CREATE,SOLV3D,MAC                       ! CREATE MACRO TO PERFORM SOLUTION
! THIS IS THE SECTION CONTAINING THE LOADING.  THE MOMENT 
! USED IN THE VERIFICATION EQUATION IS THE SUM OF ALL 
! OF THE MOMENTS ON THE AREA LOCATED AT Z=0 OR Z=L.  NOTE
! THAT THE LOADS ON EITHER AREA FORM A COUPLE.
SFGRAD,PRES,,Y,H/2,2*SURF/H                ! APPLY GRADIENT SURFACE LOADS  
ASEL,S,LOC,Z,0
ASEL,A,LOC,Z,L
SFA,ALL,1,PRES,SURF,
ALLS
SFTRAN                                     ! LOADS END
NSEL,S,LOC,X,W/2                           ! DEFINE DOF CONSTRAINTS
NSEL,R,LOC,Y,0                             ! SIMILAR TO PATCH TEST 
NSEL,R,LOC,Z,0                             ! CONSTRAINTS
D,ALL, UX ,
D,ALL, UY ,
D,ALL, UZ ,
NSEL,S,LOC,X,-W/2
NSEL,R,LOC,Y,0
NSEL,R,LOC,Z,0
D,ALL, UY ,
D,ALL, UZ ,
NSEL,S,LOC,X,W/2
NSEL,R,LOC,Y,0
NSEL,R,LOC,Z,L
D,ALL, UY ,                                ! CONSTRAINTS END
ALLSEL
FINISH
/SOLU
/OUT,SCRATCH
SOLVE                                      ! SOLVE
FINISH
*END

SOLV3D                                     ! READ MACRO TO PERFORM SOLUTION

*CREATE,RES3D,MAC
/POST1
SET,LAST
PRRSOL                                     ! PRINT REACTION SOLUTIONS
/GRA,OFF
/VIEW,1,1,0,0
/GLINE,1,0
/DEV,VECT,ON
PLNSOL,S,Z                                 ! Z-STRESS CONTOUR 
/NUM,0 

MST1=0                                     ! INIT PARAMETERS
NDE1=0
MST2=0
NDE2=0
MST3=0
NDE3=0
*DIM,RESULTS,ARRAY,3                       ! DEFINE ARRAY PARAMETER RESULTS
                                           ! CALCULATION : TOP AVERAGE OF STRESS 
NSEL,S,LOC,Y,H/2                           ! SELECT NODES IN TOP AREA
*GET,NUMNOD1,NODE,,COUNT                   ! OBTAIN NUMBER OF TOP SURFACE NODES

ZSTR1=0
TOTAL=0
COUNT=0

*DO,J,1,NUMNOD1,1
   NDE1=NDNEXT(NDE1)
   NSEL,,,,NDE1
   ESLN
   *GET,NUMELM,ELEM,0,COUNT               ! GET NUMBER OF ELEMS CONNECTED TO NDE1
   ELNUM=0
   TRIP=0
   *DO,K,1,NUMELM,1                       ! LOOP ON ELEMS CONNECTED TO NDE1
      ELNUM=ELNEXT(ELNUM)
      *DO,L,1,8,1                         ! VOLUME : SOLID95 CORNER NODES
         POS=NELEM(ELNUM,L)               ! CHECK POS 1-8 ON SOLID95 FOR 
                                          ! NODE NUMBER
         *IF,POS,EQ,NDE1,THEN            
            TRIP=1                        ! SET TRIP IF OUR CURRENTLY SELECTED
                                          ! NODE IS CORNER OF ELEMENT ELNUM
         *ENDIF
         *IF,TRIP,EQ,1,EXIT
      *ENDDO
      *IF,TRIP,EQ,1,EXIT
   *ENDDO

   *IF,TRIP,NE,1,THEN
      NSEL,S,LOC,Y,H/2                    ! IF ENTRY IS GAINED TO HERE
      ESEL,ALL                            ! THEN IT MUST BE THAT NDE1 IS A
      *CYCLE                              ! MIDNODE : NO STRESS CALC WANTED!
   *ENDIF

   ALLSEL
   *GET,ZSTR1,NODE,NDE1,S,Z               ! IF ENTRY GAINED TO THIS POINT OF 
   TOTAL=TOTAL+ZSTR1                      ! THE LOOP, THEN GRAB Z-STRESS AT
   COUNT=COUNT+1                          ! NODE NDE1 AND ADD IT TO TOTAL.
   NSEL,S,LOC,Y,H/2                       ! RESET SELECTED SETS TO WHAT IS 
   ESEL,ALL                               ! NEEDED.
*ENDDO

MST1=(TOTAL/COUNT)                        ! AVERAGE OF Z-STRESS ON TOP SURFACE
RESULTS(1)=MST1

NSEL,S,LOC,Y,0                            ! SELECT NODES ALONG Z AXIS
NSEL,R,LOC,X,0                            ! ( THE NURTRAL AXIS )
*GET,NUMNOD2,NODE,,COUNT                  ! OBTAIN NUMBER OF TOP SURFACE NODES

ZSTR2=0 
COUNT=0
TOTAL=0

*DO,J,1,NUMNOD2,1                         ! LOGIC IS SIMILAR TO ABOVE *DO LOOP!
   NDE2=NDNEXT(NDE2)
   NSEL,,,,NDE2
   ESLN
   *GET,NUMELM,ELEM,0,COUNT
   ELNUM=0
   TRIP=0
   *DO,K,1,NUMELM,1
      ELNUM=ELNEXT(ELNUM)
      *DO,L,1,8,1                         ! VOLUME : SOLID95 CORNER NODES
         POS=NELEM(ELNUM,L)
         *IF,POS,EQ,NDE2,THEN
            TRIP=1
         *ENDIF
         *IF,TRIP,EQ,1,EXIT
      *ENDDO
      *IF,TRIP,EQ,1,EXIT
   *ENDDO

   *IF,TRIP,NE,1,THEN
      NSEL,S,LOC,Y,0
      NSEL,R,LOC,X,0
      ESEL,ALL
      *CYCLE
   *ENDIF

   ALLSEL
   
   *GET,ZSTR2,NODE,NDE2,S,Z
   TOTAL=TOTAL+ZSTR2 
   COUNT=COUNT+1
   NSEL,S,LOC,Y,0
   NSEL,R,LOC,X,0
   ESEL,ALL
*ENDDO

MST2=TOTAL/COUNT                         ! AVERAGE STRESS OF NEURTRAL AXIS
RESULTS(2)=MST2

NSEL,S,LOC,Y,-H/2                        ! SELECT NODES IN BOTTOM AREA 
*GET,NUMNOD3,NODE,,COUNT

ZSTR3=0
COUNT=0
TOTAL=0

*DO,J,1,NUMNOD3,1                        !  LOGIC IS SIMILAR TO ABOVE *DO LOOP!
   NDE3=NDNEXT(NDE3)
   NSEL,,,,NDE3
   ESLN
   *GET,NUMELM,ELEM,0,COUNT
   ELNUM=0
   TRIP=0
   *DO,K,1,NUMELM,1
      ELNUM=ELNEXT(ELNUM)
      *DO,L,1,8,1                        ! VOLUME : SOLID CORNER NODES
         POS=NELEM(ELNUM,L)
         *IF,POS,EQ,NDE3,THEN
            TRIP=1
         *ENDIF
         *IF,TRIP,EQ,1,EXIT
      *ENDDO
      *IF,TRIP,EQ,1,EXIT
   *ENDDO

   *IF,TRIP,NE,1,THEN
      NSEL,S,LOC,Y,-H/2
      ESEL,ALL
      *CYCLE
   *ENDIF
   ALLSEL

   *GET,ZSTR3,NODE,NDE3,S,Z
   TOTAL=TOTAL+ZSTR3
   COUNT=COUNT+1
   NSEL,S,LOC,Y,-H/2
   ESEL,ALL
*ENDDO

MST3=TOTAL/COUNT                         ! AVERAGE STRESS ON BOTTOM NODES                 
RESULTS(3)=MST3
                                         ! CALCULATE THE RATIOS
RAT1=MST1/(-SURF)

!* EXPECTED VALUE FOR MST2 = 0.0
*if,MST2,le,1E-3,then
   RAT2=1
*else
   RAT2=MST2
*endif

RAT3=MST3/SURF

*DIM,RATIO,ARRAY,3                       ! DEFINE ARRAY PARAMETER RATIO
*VFILL,RATIO(1),DATA,RAT1,RAT2,RAT3      ! DEFINE ARRAY PARAMETER TAR

*DIM,TAR,ARRAY,3
*VFILL,TAR(1),DATA,(-SURF),0,SURF

*DIM,LABEL,CHAR,3,2
LABEL(1,1) = 'TOP'
LABEL(1,2) = 'STRESS'

LABEL(2,1) = 'MIDDLE'
LABEL(2,2) = 'STRESS'

LABEL(3,1) = 'BOTTOM'
LABEL(3,2) = 'STRESS'
FINISH
*END

RES3D                             ! READ MACRO TO RETRIEVE RESULTS
SAVE,TABLE_1

/CLEAR, NOSTART ! CLEAR DATABASE FOR 2ND SOLUTION
/PREP7
SMRT,OFF
/TITLE, VM210, BENDING OF HEX-TO-TET INTERFACE, FORMATION OF PYRAMIDS 
/COM,   ****** USING 3-D SOLID186 ******
ET,1,186                                 ! ELEMENT TYPE SOLID186
ET,2,186                                 ! ELEMENT TYPE SOLID186

MSHGEN3D                                 ! READ MACRO TO GENERATE MESH

/OUT,SCRATCH
SOLV3D                                   ! READ MACRO TO PERFORM SOLUTION

RES3D                                    ! READ MACRO TO RETRIEVE RESULTS
/OUT,

SAVE,TABLE_2

/COM
/OUT,vm210,vrt
/NOPR
RESUME,TABLE_1
/GOPR
/COM,------------------- VM210 RESULTS COMPARISON ---------------
/COM,
/COM,                 |   TARGET   |   Mechanical APDL   |   RATIO
/COM,
/COM,RESULTS USING SOLID95:
*VWRITE,LABEL(1,1),LABEL(1,2),TAR(1),RESULTS(1),RATIO(1)
(1X,A8,A8,'   ',F12.4,'  ',F13.4,'   ',1F15.3)
/NOPR
RESUME,TABLE_2
/GOPR
/COM,
/COM,RESULTS USING SOLID186:
*VWRITE,LABEL(1,1),LABEL(1,2),TAR(1),RESULTS(1),RATIO(1)
(1X,A8,A8,'   ',F12.4,'  ',F13.4,'   ',1F15.3)
/COM,----------------------------------------------------------------
/COM,
/OUT
FINISH
*LIST,vm210,vrt
/DELETE,MSHGEN3D,MAC
/DELETE,SOLV3D,MAC
/DELETE,RES3D,MAC