21 integer(kind=kint) :: k, icel, ic_type, isect, isuf, iamp, nn, is, j
22 real(kind=kreal) :: ctime, dtime, qq, val, asect, thick, vol, beta
24 type(hecmwst_matrix) :: hecMAT
25 type(hecmwst_local_mesh) :: hecMESH
26 real(kind=kreal) :: xx(20), yy(20), zz(20)
27 real(kind=kreal) :: vect(20), ss(2000)
28 integer(kind=kint) :: ig0, ig, iS0, iE0, nodLocal(20)
29 real(kind=kreal),
allocatable :: bbak(:)
36 do k = 1, fstrheat%Q_SUF_tot
38 icel = fstrheat%Q_SUF_elem(k)
39 ic_type = hecmesh%elem_type(icel)
40 isect = hecmesh%section_ID(icel)
41 isuf = fstrheat%Q_SUF_surf(k)
42 iamp = fstrheat%Q_SUF_ampl(k)
45 val = fstrheat%Q_SUF_val (k) * qq
46 if( dabs(val) < 1.d-16 ) cycle
48 nn = hecmw_get_max_node(ic_type)
50 is = hecmesh%elem_node_index(icel-1)
52 nodlocal(j) = hecmesh%elem_node_item(is+j)
53 xx(j) = hecmesh%node( 3*nodlocal(j)-2 )
54 yy(j) = hecmesh%node( 3*nodlocal(j)-1 )
55 zz(j) = hecmesh%node( 3*nodlocal(j) )
58 if ( ic_type.eq.111 )
then
59 is = hecmesh%section%sect_R_index(isect)
60 asect = hecmesh%section%sect_R_item(is)
63 elseif( ic_type.eq.231 )
then
64 is = hecmesh%section%sect_R_index(isect)
65 thick = hecmesh%section%sect_R_item(is)
68 elseif( ic_type.eq.232 )
then
69 is = hecmesh%section%sect_R_index(isect)
70 thick = hecmesh%section%sect_R_item(is)
73 elseif( ic_type.eq.241 )
then
74 is = hecmesh%section%sect_R_index(isect)
75 thick = hecmesh%section%sect_R_item(is)
78 elseif( ic_type.eq.242 )
then
79 is = hecmesh%section%sect_R_index(isect)
80 thick = hecmesh%section%sect_R_item(is)
83 elseif( ic_type.eq.341 )
then
86 elseif( ic_type.eq.342 )
then
89 elseif( ic_type.eq.351 )
then
92 elseif( ic_type.eq.352 )
then
95 elseif( ic_type.eq.361 )
then
98 elseif( ic_type.eq.362 )
then
101 elseif( ic_type.eq.731 )
then
102 is = hecmesh%section%sect_R_index(isect)
103 thick = hecmesh%section%sect_R_item(is)
106 elseif( ic_type.eq.741 )
then
107 is = hecmesh%section%sect_R_index(isect)
108 thick = hecmesh%section%sect_R_item(is)
115 hecmat%B( nodlocal(j) ) = hecmat%B( nodlocal(j) ) - vect(j)
121 if( fstrheat%WL_tot>0 )
then
122 allocate( bbak(
size(hecmat%B)) )
124 do ig0 = 1, fstrheat%WL_tot
125 ig = fstrheat%weldline(ig0)%egrpid
126 is0= hecmesh%elem_group%grp_index(ig-1) + 1
127 ie0= hecmesh%elem_group%grp_index(ig )
130 icel = hecmesh%elem_group%grp_item(k)
131 ic_type = hecmesh%elem_type(icel)
132 isect = hecmesh%section_ID(icel)
135 nn = hecmw_get_max_node(ic_type)
136 is = hecmesh%elem_node_index(icel-1)
138 nodlocal(j) = hecmesh%elem_node_item(is+j)
139 xx(j) = hecmesh%node( 3*nodlocal(j)-2 )
140 yy(j) = hecmesh%node( 3*nodlocal(j)-1 )
141 zz(j) = hecmesh%node( 3*nodlocal(j) )
144 if( .not.
isweldactive(nn, xx,yy,zz, fstrheat%weldline(ig0), ctime-0.5d0*dtime) ) cycle
146 vol = vol +
volume_c3(ic_type,nn,xx,yy,zz)
147 val = fstrheat%weldline(ig0)%I * fstrheat%weldline(ig0)%U * &
148 fstrheat%weldline(ig0)%coe
149 write(
idbg,*)
"Element", hecmesh%global_elem_id(icel),
"with dflux", val, vol
151 if( ic_type.eq.341 )
then
154 elseif( ic_type.eq.342 )
then
157 elseif( ic_type.eq.351 )
then
160 elseif( ic_type.eq.352 )
then
163 elseif( ic_type.eq.361 )
then
166 elseif( ic_type.eq.362 )
then
171 write(*,*)
'###ERROR### : Element type not supported for heat analysis'
172 write(*,*)
' ic_type = ', ic_type
173 call hecmw_abort(hecmw_comm_get_comm())
178 bbak( nodlocal(j) ) = bbak( nodlocal(j) ) - vect(j)
184 hecmat%B = hecmat%B + bbak
193 logical function isweldactive(nn, xx,yy,zz, weldline, ctime)
194 integer,
intent(in) :: nn
195 real(kind=kreal),
intent(in) :: xx(:), yy(:), zz(:)
197 real(kind=kreal),
intent(in) :: ctime
200 real(kind=kreal) :: cpos, wpos, tend
203 tend = weldline%tstart+ (weldline%n2-weldline%n1)/weldline%v
204 if( ctime<weldline%tstart .or. ctime>tend )
return
207 if( weldline%xyz==1 )
then
209 elseif( weldline%xyz==2 )
then
216 wpos = weldline%n1 + weldline%v*(ctime-weldline%tstart)
217 if( dabs(cpos-wpos)<weldline%distol )
isweldactive = .true.