FrontISTR  5.7.0
Large-scale structural analysis program with finit element method
heat_mat_ass_conductivity.f90
Go to the documentation of this file.
1 !-------------------------------------------------------------------------------
2 ! Copyright (c) 2019 FrontISTR Commons
3 ! This software is released under the MIT License, see LICENSE.txt
4 !-------------------------------------------------------------------------------
6 contains
7 
8  subroutine heat_mat_ass_conductivity( hecMESH,hecMAT,fstrHEAT,beta )
9  use hecmw
10  use m_fstr
11  use m_heat_lib
12  use m_static_lib
13  implicit none
14  type(fstr_heat) :: fstrheat
15  type(hecmwst_matrix) :: hecMAT
16  type(hecmwst_local_mesh) :: hecMESH
17  integer(kind=kint) :: itype, is, iE, ic_type, icel, isect, IMAT, ntab, itab, NDOF
18  integer(kind=kint) :: in0, nn, i, in, j, nodLOCAL(20), jsect, ic, ip, inod, jp, jnod, isU, ieU, ik, isL, ieL
19  real(kind=kreal) :: beta, tzero, alfa, temp(1000), funca(1000), funcb(1000), tt(20), t0(20), ss(400)
20  real(kind=kreal) :: asect, thick, gth, ghh, gr1, gr2
21  real(kind=kreal) :: lumped(20), stiff(20, 20), ecoord(3,20)
22  real(kind=kreal), allocatable :: s(:)
23 
24  ndof = hecmesh%n_dof
25  tzero = hecmesh%zero_temp
26  alfa = 1.0 - beta
27 
28  call hecmw_mat_clear(hecmat)
29  call hecmw_mat_clear_b(hecmat)
30 
31  do itype = 1, hecmesh%n_elem_type
32  is = hecmesh%elem_type_index(itype-1) + 1
33  ie = hecmesh%elem_type_index(itype )
34  ic_type= hecmesh%elem_type_item(itype)
35  if (hecmw_is_etype_link(ic_type)) cycle
36  if (hecmw_is_etype_patch(ic_type)) cycle
37 
38  !$omp parallel default(none), &
39  !$omp& private(icel,isect,IMAT,ntab,itab,temp,funcA,funcB,in0,nn,i,j,nodLOCAL,SS,TT,GTH,GHH,GR1,GR2,ecoord,&
40  !$omp& stiff,in,ASECT,thick,jsect), &
41  !$omp& shared(iS,iE,hecMESH,ic_type,hecMAT,fstrHEAT,TZERO)
42  !$omp do
43  do icel = is, ie
44  isect = hecmesh%section_ID(icel)
45  imat = hecmesh%section%sect_mat_ID_item(isect)
46 
47  if( hecmesh%section%sect_type(isect) .ne. 4 ) then
48  ntab = fstrheat%CONDtab(imat)
49  do itab = 1, ntab
50  temp(itab) = fstrheat%CONDtemp (imat,itab)
51  funca(itab) = fstrheat%CONDfuncA(imat,itab)
52  funcb(itab) = fstrheat%CONDfuncB(imat,itab)
53  enddo
54  funca(ntab+1) = fstrheat%CONDfuncA(imat,ntab+1)
55  funcb(ntab+1) = fstrheat%CONDfuncB(imat,ntab+1)
56  endif
57 
58  in0 = hecmesh%elem_node_index(icel-1)
59  nn = hecmw_get_max_node(ic_type)
60  do i = 1, nn
61  nodlocal(i) = hecmesh%elem_node_item(in0+i)
62  tt(i) = fstrheat%TEMP ( nodlocal(i) )
63  !T0(i) = fstrHEAT%TEMP0( nodLOCAL(i) )
64  do j = 1, 3
65  ecoord(j,i) = hecmesh%node(3*(nodlocal(i)-1)+j)
66  enddo
67  enddo
68  do i = 1, nn*nn
69  ss(i) = 0.0
70  enddo
71 
72  if(ic_type == 111) then
73  in = hecmesh%section%sect_R_index(isect)
74  asect = hecmesh%section%sect_R_item(in)
75  call heat_conductivity_c1(ic_type, nn, ecoord(1:2,1:nn), tt, imat, asect, stiff, &
76  fstrheat%CONDtab(imat), fstrheat%CONDtemp(imat,:), fstrheat%CONDfuncA(imat,:) ,fstrheat%CONDfuncB(imat,:))
77 
78  elseif(ic_type == 231 .or. ic_type == 232 .or. ic_type == 241 .or. ic_type == 242)then
79  in = hecmesh%section%sect_R_index(isect)
80  thick = hecmesh%section%sect_R_item(in)
81  call heat_conductivity_c2(ic_type, nn, ecoord(1:2,1:nn), tt, imat, thick, stiff, &
82  fstrheat%CONDtab(imat), fstrheat%CONDtemp(imat,:), fstrheat%CONDfuncA(imat,:) ,fstrheat%CONDfuncB(imat,:))
83 
84  elseif(ic_type == 341 .or. ic_type == 342 .or. ic_type == 351 .or. ic_type == 352 .or. &
85  & ic_type == 361 .or. ic_type == 362)then
86  call heat_conductivity_c3(ic_type, nn, ecoord(1:3,1:nn), tt, imat, stiff, &
87  fstrheat%CONDtab(imat), fstrheat%CONDtemp(imat,:), fstrheat%CONDfuncA(imat,:) ,fstrheat%CONDfuncB(imat,:))
88 
89  elseif (ic_type == 541) then
90  jsect = hecmesh%section%sect_R_index(isect-1)+1
91  gth = hecmesh%section%sect_R_item(jsect)
92  ghh = hecmesh%section%sect_R_item(jsect+1)
93  gr1 = hecmesh%section%sect_R_item(jsect+2)
94  gr2 = hecmesh%section%sect_R_item(jsect+3)
95  call heat_conductivity_541(nn, ecoord, tt, tzero, gth, ghh, gr1, gr2, ss, stiff)
96 
97  elseif(ic_type == 731)then
98  nn = 4
99  nodlocal(nn) = hecmesh%elem_node_item(in0+nn-1)
100  in = hecmesh%section%sect_R_index(isect)
101  thick = hecmesh%section%sect_R_item(in)
102  ss = 0.0d0
103  call heat_conductivity_shell_731(ic_type, nn, ecoord(1:3,1:nn), tt, imat, thick, ss, stiff, &
104  fstrheat%CONDtab(imat), fstrheat%CONDtemp(imat,:), fstrheat%CONDfuncA(imat,:) ,fstrheat%CONDfuncB(imat,:))
105 
106  elseif(ic_type == 741)then
107  in = hecmesh%section%sect_R_index(isect)
108  thick = hecmesh%section%sect_R_item(in)
109  call heat_conductivity_shell_741(ic_type, nn, ecoord(1:3,1:nn), tt, imat, thick, ss, stiff, &
110  fstrheat%CONDtab(imat), fstrheat%CONDtemp(imat,:), fstrheat%CONDfuncA(imat,:) ,fstrheat%CONDfuncB(imat,:))
111 
112  else
113  write(*,*)"** error setMASS"
114  endif
115 
116  if(ic_type == 541 .or. ic_type == 731 .or. ic_type == 741)then
117  stiff = 0.0d0
118  in = 1
119  do i = 1, nn
120  do j = 1, nn
121  stiff(j,i) = ss(in)
122  in = in + 1
123  enddo
124  enddo
125  endif
126 
127  call hecmw_mat_ass_elem(hecmat, nn, nodlocal, stiff)
128 
129  enddo
130  !$omp end do
131  !$omp end parallel
132  enddo
133 
134  allocate(s(hecmat%NP))
135  s = 0.0d0
136 
137  call hecmw_matvec(hecmesh, hecmat, fstrheat%TEMP0, s)
138 
139  hecmat%D = beta*hecmat%D
140  hecmat%AU = beta*hecmat%AU
141  hecmat%AL = beta*hecmat%AL
142  hecmat%B = hecmat%B - alfa*s
143 
144  deallocate(s)
145 
146  end subroutine heat_mat_ass_conductivity
m_fstr::fstr_heat
Data for HEAT ANSLYSIS (fstrHEAT)
Definition: m_fstr.f90:425
m_fstr
This module defines common data and basic structures for analysis.
Definition: m_fstr.f90:15
hecmw
Definition: hecmw.f90:6
m_heat_mat_ass_conductivity
Definition: heat_mat_ass_conductivity.f90:5
m_static_lib
This modules just summarizes all modules used in static analysis.
Definition: static_LIB.f90:6
m_heat_lib
This modules just summarizes all modules used in heat analysis.
Definition: heat_LIB.f90:6
m_heat_mat_ass_conductivity::heat_mat_ass_conductivity
subroutine heat_mat_ass_conductivity(hecMESH, hecMAT, fstrHEAT, beta)
Definition: heat_mat_ass_conductivity.f90:9