| 1 |
C Copyright(C) 1999-2020 National Technology & Engineering Solutions |
| 2 |
C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with |
| 3 |
C NTESS, the U.S. Government retains certain rights in this software. |
| 4 |
C |
| 5 |
C See packages/seacas/LICENSE for details |
| 6 |
|
| 7 |
C===================================================================== |
| 8 |
* DECK,MKE |
| 9 |
SUBROUTINE MKE(NELND,NUMEB,NUMND,ICON,NDLST,ITYPE, |
| 10 |
& VELX,VELY,VELZ,EMSS,RNMS, |
| 11 |
& RMX,RMY,RMZ,RKE,PSQ,RJ2, |
| 12 |
& SIGXX,SIGYY,SIGZZ,SIGXY,SIGYZ,SIGZX) |
| 13 |
C |
| 14 |
C **************************************************************** |
| 15 |
C |
| 16 |
C Compute momenta (x, y, and z) and kinetic energy |
| 17 |
C for an element block. Totals are stored in MKEI. |
| 18 |
C Called when check on accuracy of map is requested |
| 19 |
C |
| 20 |
C Called by MAPVAR |
| 21 |
C |
| 22 |
C **************************************************************** |
| 23 |
C |
| 24 |
C NELND INT Number of nodes per element |
| 25 |
C NUMEB INT Number of elements in element block |
| 26 |
C NUMND int Number of nodes in element block |
| 27 |
C ICON INT Connectivity array (1:nelnd,1:numeb) |
| 28 |
C NDLST INT Array of nodes in element block (1:nneb) |
| 29 |
C ITYPE INT Element type |
| 30 |
C VELX REAL Array of velocities from data base (1:nnod) |
| 31 |
C VELY REAL Array of velocities from data base (1:nnod) |
| 32 |
C VELZ REAL Array of velocities from data base (1:nnod) |
| 33 |
C EMSS REAL Array of element masses from data base (1:numeb) |
| 34 |
C RNMS REAL Array of nodal masses (1:nnod) |
| 35 |
C RMX REAL X-momentum for this element block, this time step |
| 36 |
C RMY REAL Y-momentum for this element block, this time step |
| 37 |
C RMZ REAL Z-momentum for this element block, this time step |
| 38 |
C RKE REAL Kinetic energy for this element block, this time step |
| 39 |
C PSQ REAL Pressure squared * element mass for element block |
| 40 |
C RJ2 REAL J2 * element mass for element block |
| 41 |
C SIGXX REAL Component of stress tensot |
| 42 |
C SIGYY REAL Component of stress tensot |
| 43 |
C SIGZZ REAL Component of stress tensot |
| 44 |
C SIGXY REAL Component of stress tensot |
| 45 |
C SIGYZ REAL Component of stress tensot |
| 46 |
C SIGZX REAL Component of stress tensot |
| 47 |
|
| 48 |
C |
| 49 |
C **************************************************************** |
| 50 |
C |
| 51 |
include 'amesh.blk' |
| 52 |
C |
| 53 |
DIMENSION ICON(NELND,*),NDLST(*) |
| 54 |
DIMENSION VELX(*),VELY(*),VELZ(*),EMSS(*),RNMS(*) |
| 55 |
DIMENSION SIGXX(*),SIGYY(*),SIGZZ(*),SIGXY(*),SIGYZ(*),SIGZX(*) |
| 56 |
C |
| 57 |
C **************************************************************** |
| 58 |
C |
| 59 |
C zero nodal mass array |
| 60 |
C |
| 61 |
DO I = 1, NUMEB |
| 62 |
DO J = 1, NELND |
| 63 |
RNMS(ICON(J,I)) = 0. |
| 64 |
end do |
| 65 |
end do |
| 66 |
C |
| 67 |
C Translate element mass to nodal mass |
| 68 |
C First cut, come back and do better if necessary |
| 69 |
C |
| 70 |
IF (ITYPE .EQ. 3 .OR. ITYPE .EQ. 4 .OR. ITYPE .EQ. 5)THEN |
| 71 |
C |
| 72 |
C Treat all quads the same, use only four corner nodes |
| 73 |
C can fix if needed |
| 74 |
C |
| 75 |
NEND = 4 |
| 76 |
DO I = 1, NUMEB |
| 77 |
DO J = 1, NEND |
| 78 |
RNMS(ICON(J,I)) = RNMS(ICON(J,I)) + 0.25 * EMSS(I) |
| 79 |
end do |
| 80 |
end do |
| 81 |
ELSE IF (ITYPE .EQ. 10)THEN |
| 82 |
C |
| 83 |
C 8-node hex |
| 84 |
C |
| 85 |
NEND = 8 |
| 86 |
DO I = 1, NUMEB |
| 87 |
DO J = 1, NEND |
| 88 |
RNMS(ICON(J,I)) = RNMS(ICON(J,I)) + 0.125 * EMSS(I) |
| 89 |
end do |
| 90 |
end do |
| 91 |
ELSE IF (ITYPE .EQ. 13)THEN |
| 92 |
C |
| 93 |
C 4-node shell |
| 94 |
C |
| 95 |
NEND = 4 |
| 96 |
DO I = 1, NUMEB |
| 97 |
DO J = 1, NEND |
| 98 |
RNMS(ICON(J,I)) = RNMS(ICON(J,I)) + 0.25 * EMSS(I) |
| 99 |
end do |
| 100 |
end do |
| 101 |
ELSE IF (ITYPE .EQ. 6)THEN |
| 102 |
C |
| 103 |
C treat all tets the same, use only four corner nodes |
| 104 |
C can fix if needed |
| 105 |
C |
| 106 |
NEND = 4 |
| 107 |
DO I = 1, NUMEB |
| 108 |
DO J = 1, NEND |
| 109 |
RNMS(ICON(J,I)) = RNMS(ICON(J,I)) + 0.25 * EMSS(I) |
| 110 |
end do |
| 111 |
end do |
| 112 |
ELSE |
| 113 |
CALL ERROR ('MKE','UNSUPPORTED ELEMENT TYPE','ITYPE',itype, |
| 114 |
& ' ',0,' ',' ',1) |
| 115 |
END IF |
| 116 |
C |
| 117 |
C compute momenta, KE, P-sqM, J2-sqM for element block |
| 118 |
C loop over all nodes in element block |
| 119 |
C |
| 120 |
RMX = 0. |
| 121 |
RMY = 0. |
| 122 |
RMZ = 0. |
| 123 |
RKE = 0. |
| 124 |
PSQ = 0. |
| 125 |
RJ2 = 0. |
| 126 |
DO I = 1, NUMND |
| 127 |
INOD = NDLST(I) |
| 128 |
IF (NDIMA .EQ. 3)THEN |
| 129 |
VELSQ = VELX(INOD)*VELX(INOD) + VELY(INOD)*VELY(INOD) |
| 130 |
& + VElZ(INOD)*VELZ(INOD) |
| 131 |
RMZ = RMZ + (VELZ(INOD) * RNMS(INOD)) |
| 132 |
ELSE |
| 133 |
VELSQ = VELX(INOD)*VELX(INOD) + VELY(INOD)*VELY(INOD) |
| 134 |
END IF |
| 135 |
RMX = RMX + (VELX(INOD) * RNMS(INOD)) |
| 136 |
RMY = RMY + (VELY(INOD) * RNMS(INOD)) |
| 137 |
RKE = RKE + (0.5 * RNMS(INOD) * VELSQ) |
| 138 |
end do |
| 139 |
C |
| 140 |
DO I = 1, NUMEB |
| 141 |
P = (SIGXX(I) + SIGYY(I) + SIGZZ(I)) / 3. |
| 142 |
PSQ = PSQ + P*P*EMSS(I) |
| 143 |
TAUP1 = SIGXX(I) - P |
| 144 |
TAUP2 = SIGYY(I) - P |
| 145 |
TAUP3 = SIGZZ(I) - P |
| 146 |
IF (NDIMA .EQ. 3)THEN |
| 147 |
RJ2 = RJ2 + ((((TAUP1**2 + TAUP2**2 + TAUP3**2)/6.) |
| 148 |
& + SIGXY(I)**2 + SIGYZ(I)**2 + SIGZX(I)**2) * EMSS(I)) |
| 149 |
ELSE |
| 150 |
RJ2 = RJ2 + ((((TAUP1**2 + TAUP2**2 + TAUP3**2)/6.) |
| 151 |
& + SIGXY(I)**2) * EMSS(I)) |
| 152 |
END IF |
| 153 |
end do |
| 154 |
C |
| 155 |
RETURN |
| 156 |
END |