77 REAL*8 :: xx,yy,zz,size1,size2,size3,size4,size5,size6,size7,size8,size9,size10,size11,size12
78 REAL*8 :: dhmin,dhminp,dt_courant, dt_courantp,dt_courantht
82 dhminp = 1000000000.d0
84 IF(glb%iElType.EQ.8)
THEN
85 DO i = 1, glb%NumElVol
86 call
smallestelement(glb%NumNP, glb%MeshCoor, glb%ElConnVol(1,
i), glb%ElConnVol(4,
i), size1)
87 call
smallestelement(glb%NumNP, glb%MeshCoor, glb%ElConnVol(5,
i), glb%ElConnVol(8,
i), size2)
88 call
smallestelement(glb%NumNP, glb%MeshCoor, glb%ElConnVol(6,
i), glb%ElConnVol(7,
i), size3)
89 call
smallestelement(glb%NumNP, glb%MeshCoor, glb%ElConnVol(2,
i), glb%ElConnVol(3,
i), size4)
91 call
smallestelement(glb%NumNP, glb%MeshCoor, glb%ElConnVol(4,
i), glb%ElConnVol(8,
i), size5)
92 call
smallestelement(glb%NumNP, glb%MeshCoor, glb%ElConnVol(8,
i), glb%ElConnVol(7,
i), size6)
93 call
smallestelement(glb%NumNP, glb%MeshCoor, glb%ElConnVol(7,
i), glb%ElConnVol(3,
i), size7)
94 call
smallestelement(glb%NumNP, glb%MeshCoor, glb%ElConnVol(3,
i), glb%ElConnVol(4,
i), size8)
96 call
smallestelement(glb%NumNP, glb%MeshCoor, glb%ElConnVol(1,
i), glb%ElConnVol(5,
i), size9)
97 call
smallestelement(glb%NumNP, glb%MeshCoor, glb%ElConnVol(5,
i), glb%ElConnVol(6,
i), size10)
98 call
smallestelement(glb%NumNP, glb%MeshCoor, glb%ElConnVol(6,
i), glb%ElConnVol(2,
i), size11)
99 call
smallestelement(glb%NumNP, glb%MeshCoor, glb%ElConnVol(2,
i), glb%ElConnVol(1,
i), size12)
101 dhminp =
min(size1, size2, size3, size4, size5, size6, size7, size8, size9, size10, size11, size12, dhminp)
106 DO i = 1, glb%NumElVol
110 xx = glb%MeshCoor(1,glb%ElConnVol(1,
i)) - glb%MeshCoor(1,glb%ElConnVol(2,
i))
111 yy = glb%MeshCoor(2,glb%ElConnVol(1,
i)) - glb%MeshCoor(2,glb%ElConnVol(2,
i))
112 zz = glb%MeshCoor(3,glb%ElConnVol(1,
i)) - glb%MeshCoor(3,glb%ElConnVol(2,
i))
113 size1 =
sqrt(xx*xx+yy*yy+zz*zz)
114 xx = glb%MeshCoor(1,glb%ElConnVol(2,
i)) - glb%MeshCoor(1,glb%ElConnVol(3,
i))
115 yy = glb%MeshCoor(2,glb%ElConnVol(2,
i)) - glb%MeshCoor(2,glb%ElConnVol(3,
i))
116 zz = glb%MeshCoor(3,glb%ElConnVol(2,
i)) - glb%MeshCoor(3,glb%ElConnVol(3,
i))
117 size2 =
sqrt(xx*xx+yy*yy+zz*zz)
118 xx = glb%MeshCoor(1,glb%ElConnVol(3,
i)) - glb%MeshCoor(1,glb%ElConnVol(1,
i))
119 yy = glb%MeshCoor(2,glb%ElConnVol(3,
i)) - glb%MeshCoor(2,glb%ElConnVol(1,
i))
120 zz = glb%MeshCoor(3,glb%ElConnVol(3,
i)) - glb%MeshCoor(3,glb%ElConnVol(1,
i))
121 size3 =
sqrt(xx*xx+yy*yy+zz*zz)
122 xx = glb%MeshCoor(1,glb%ElConnVol(4,
i)) - glb%MeshCoor(1,glb%ElConnVol(1,
i))
123 yy = glb%MeshCoor(2,glb%ElConnVol(4,
i)) - glb%MeshCoor(2,glb%ElConnVol(1,
i))
124 zz = glb%MeshCoor(3,glb%ElConnVol(4,
i)) - glb%MeshCoor(3,glb%ElConnVol(1,
i))
125 size4 =
sqrt(xx*xx+yy*yy+zz*zz)
126 xx = glb%MeshCoor(1,glb%ElConnVol(4,
i)) - glb%MeshCoor(1,glb%ElConnVol(2,
i))
127 yy = glb%MeshCoor(2,glb%ElConnVol(4,
i)) - glb%MeshCoor(2,glb%ElConnVol(2,
i))
128 zz = glb%MeshCoor(3,glb%ElConnVol(4,
i)) - glb%MeshCoor(3,glb%ElConnVol(2,
i))
129 size5 =
sqrt(xx*xx+yy*yy+zz*zz)
130 xx = glb%MeshCoor(1,glb%ElConnVol(4,
i)) - glb%MeshCoor(1,glb%ElConnVol(3,
i))
131 yy = glb%MeshCoor(2,glb%ElConnVol(4,
i)) - glb%MeshCoor(2,glb%ElConnVol(3,
i))
132 zz = glb%MeshCoor(3,glb%ElConnVol(4,
i)) - glb%MeshCoor(3,glb%ElConnVol(3,
i))
133 size6 =
sqrt(xx*xx+yy*yy+zz*zz)
134 dhminp =
min(size1,size2,size3,size4,size5,size6,dhminp)
142 CALL mpi_allreduce(dhminp,dhmin,1,mpi_double_precision, &
143 mpi_min,glb%MPI_COMM_ROCFRAC,ierr)
145 dt_courant = dhmin/glb%cd_fastest
147 IF(glb%HeatTransSoln)
THEN
149 dt_courantht = dhmin**2/glb%ThermalDiffusivity/6.
151 IF(glb%ThermalExpansion)
THEN
153 dt_courant =
min( dt_courant, dt_courantht)
156 dt_courant = dt_courantht
161 dt_courant = dt_courant*glb%CourantRatio
subroutine max_dt_solid(dt_courant, glb)
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
subroutine smallestelement(NumNP, coor, Node1, Node2, lngth)