FrontISTR  6.0.0
Large-scale structural analysis program with finit element method
heat_mat_ass_capacity.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 !-------------------------------------------------------------------------------
7 contains
8 
9  subroutine heat_mat_ass_capacity(hecMESH, hecMAT, fstrSOLID, fstrHEAT, delta_time)
10  use m_fstr
12  implicit none
13  type(fstr_heat) :: fstrHEAT
14  type(hecmwst_matrix) :: hecMAT
15  type(fstr_solid) :: fstrSOLID
16  type(hecmwst_local_mesh) :: hecMESH
17  integer(kind=kint) :: i, in, j, nodLOCAL(20), ip, inod
18  integer(kind=kint) :: itype, iS, iE, ic_type, icel, isect, IMAT, in0, nn
19  real(kind=kreal) :: temp(20), lumped(120), mass(20*6, 20*6), ecoord(3,20)
20  real(kind=kreal) :: delta_time, surf, thick, beta
21 
22  beta = fstrheat%beta
23 
24  do itype = 1, hecmesh%n_elem_type
25  is = hecmesh%elem_type_index(itype-1) + 1
26  ie = hecmesh%elem_type_index(itype )
27  ic_type = hecmesh%elem_type_item(itype)
28  if( ic_type == 761 ) ic_type = 731
29  if( ic_type == 781 ) ic_type = 741
30 
31  if (hecmw_is_etype_link(ic_type)) cycle
32  if (hecmw_is_etype_patch(ic_type)) cycle
33  if(ic_type == 3414) cycle
34 
35  !$omp parallel default(none), &
36  !$omp& private(icel,isect,IMAT,nn,temp,in0,i,j,nodLOCAL,ecoord,in,thick,surf,inod,lumped,mass), &
37  !$omp& shared(iS,iE,hecMESH,fstrSOLID,ic_type,hecMAT,fstrHEAT,delta_time)
38  !$omp do
39  do icel = is, ie
40  if( fstrsolid%elements(icel)%elemact_flag == kelact_inactive ) cycle
41  isect = hecmesh%section_ID(icel)
42  imat = hecmesh%section%sect_mat_ID_item(isect)
43  in0 = hecmesh%elem_node_index(icel-1)
44  nn = hecmw_get_max_node(ic_type)
45  do i = 1, nn
46  nodlocal(i) = hecmesh%elem_node_item(in0+i)
47  do j = 1, 3
48  ecoord(j,i) = hecmesh%node(3*(nodlocal(i)-1)+j)
49  enddo
50  temp(i) = fstrheat%TEMP0(nodlocal(i))
51  enddo
52 
53  lumped = 0.0d0
54  if(ic_type == 231 .or. ic_type == 232 .or. ic_type == 241 .or. ic_type == 242)then
55  in = hecmesh%section%sect_R_index(isect)
56  thick = hecmesh%section%sect_R_item(in)
57  call heat_capacity_c2(ic_type, nn, ecoord(1:2,1:nn), temp, thick, lumped, mass, &
58  fstrheat%CPtab(imat), fstrheat%CPtemp(imat,:), fstrheat%CPfuncA(imat,:) ,fstrheat%CPfuncB(imat,:), &
59  fstrheat%RHOtab(imat), fstrheat%RHOtemp(imat,:), fstrheat%RHOfuncA(imat,:), fstrheat%RHOfuncB(imat,:))
60 
61  elseif(ic_type == 341 .or. ic_type == 342 .or. ic_type == 351 .or. ic_type == 352 .or. &
62  & ic_type == 361 .or. ic_type == 362)then
63  call heat_capacity_c3(ic_type, nn, ecoord(1:3,1:nn), temp, lumped, mass, &
64  fstrheat%CPtab(imat), fstrheat%CPtemp(imat,:), fstrheat%CPfuncA(imat,:) ,fstrheat%CPfuncB(imat,:), &
65  fstrheat%RHOtab(imat), fstrheat%RHOtemp(imat,:), fstrheat%RHOfuncA(imat,:), fstrheat%RHOfuncB(imat,:))
66 
67  elseif (ic_type == 541) then
68  ! skip warning
69 
70  elseif(ic_type == 731)then
71  in = hecmesh%section%sect_R_index(isect)
72  thick = hecmesh%section%sect_R_item(in)
73  call heat_capacity_shell_731(nn, ecoord(1:3,1:nn), temp, thick, lumped, mass, &
74  fstrheat%CPtab(imat), fstrheat%CPtemp(imat,:), fstrheat%CPfuncA(imat,:) ,fstrheat%CPfuncB(imat,:), &
75  fstrheat%RHOtab(imat), fstrheat%RHOtemp(imat,:), fstrheat%RHOfuncA(imat,:), fstrheat%RHOfuncB(imat,:))
76 
77  elseif(ic_type == 741)then
78  in = hecmesh%section%sect_R_index(isect)
79  thick = hecmesh%section%sect_R_item(in)
80  call heat_capacity_shell_741(nn, ecoord(1:3,1:nn), temp, thick, lumped, mass, &
81  fstrheat%CPtab(imat), fstrheat%CPtemp(imat,:), fstrheat%CPfuncA(imat,:) ,fstrheat%CPfuncB(imat,:), &
82  fstrheat%RHOtab(imat), fstrheat%RHOtemp(imat,:), fstrheat%RHOfuncA(imat,:), fstrheat%RHOfuncB(imat,:))
83 
84  elseif(ic_type == 111 .or. ic_type == 301 .or. ic_type == 611 .or. ic_type == 641)then
85  in = hecmesh%section%sect_R_index(isect)
86  surf = hecmesh%section%sect_R_item(in)
87  call heat_capacity_c1(ic_type, nn, ecoord(1:3,1:nn), temp, surf, lumped, &
88  fstrheat%CPtab(imat), fstrheat%CPtemp(imat,:), fstrheat%CPfuncA(imat,:) ,fstrheat%CPfuncB(imat,:), &
89  fstrheat%RHOtab(imat), fstrheat%RHOtemp(imat,:), fstrheat%RHOfuncA(imat,:), fstrheat%RHOfuncB(imat,:))
90 
91  else
92  !$omp critical
93  write(*,*)"** error setMASS"
94  !$omp end critical
95  endif
96 
97  do ip = 1, nn
98  inod = nodlocal(ip)
99  !$omp atomic
100  hecmat%D(inod) = hecmat%D(inod) + lumped(ip) / delta_time
101  !$omp atomic
102  hecmat%B(inod) = hecmat%B(inod) + lumped(ip)*temp(ip) / delta_time
103  enddo
104  enddo
105  !$omp end do
106  !$omp end parallel
107  enddo
108  end subroutine heat_mat_ass_capacity
109 end module m_heat_mat_ass_capacity
This module defines common data and basic structures for analysis.
Definition: m_fstr.F90:15
subroutine heat_capacity_c1(etype, nn, ecoord, temperature, surf, lumped, ntab1, temp1, funcA1, funcB1, ntab2, temp2, funcA2, funcB2)
subroutine heat_capacity_c2(etype, nn, ecoord, temperature, thick, lumped, mass, ntab1, temp1, funcA1, funcB1, ntab2, temp2, funcA2, funcB2)
subroutine heat_capacity_shell_741(nn, ecoord, temperature, thick, lumped, mass, ntab1, temp1, funcA1, funcB1, ntab2, temp2, funcA2, funcB2)
subroutine heat_capacity_shell_731(nn, ecoord, temperature, thick, lumped, mass, ntab1, temp1, funcA1, funcB1, ntab2, temp2, funcA2, funcB2)
subroutine heat_capacity_c3(etype, nn, ecoord, temperature, lumped, mass, ntab1, temp1, funcA1, funcB1, ntab2, temp2, funcA2, funcB2)
This module provides a subroutine to assemble heat capacity matrix.
subroutine heat_mat_ass_capacity(hecMESH, hecMAT, fstrSOLID, fstrHEAT, delta_time)
Data for HEAT ANSLYSIS (fstrHEAT)
Definition: m_fstr.F90:440