FrontISTR  5.8.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, alfa, 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 
29  if (hecmw_is_etype_link(ic_type)) cycle
30  if (hecmw_is_etype_patch(ic_type)) cycle
31  if(ic_type == 3414) cycle
32 
33  !$omp parallel default(none), &
34  !$omp& private(icel,isect,IMAT,nn,temp,in0,i,j,nodLOCAL,ecoord,in,thick,surf,inod,lumped,mass), &
35  !$omp& shared(iS,iE,hecMESH,fstrSOLID,ic_type,hecMAT,fstrHEAT,delta_time)
36  !$omp do
37  do icel = is, ie
38  if( fstrsolid%elements(icel)%elemact_flag == kelact_inactive ) cycle
39  isect = hecmesh%section_ID(icel)
40  imat = hecmesh%section%sect_mat_ID_item(isect)
41  in0 = hecmesh%elem_node_index(icel-1)
42  nn = hecmw_get_max_node(ic_type)
43  do i = 1, nn
44  nodlocal(i) = hecmesh%elem_node_item(in0+i)
45  do j = 1, 3
46  ecoord(j,i) = hecmesh%node(3*(nodlocal(i)-1)+j)
47  enddo
48  temp(i) = fstrheat%TEMP0(nodlocal(i))
49  enddo
50 
51  lumped = 0.0d0
52  if(ic_type == 231 .or. ic_type == 232 .or. ic_type == 241 .or. ic_type == 242)then
53  in = hecmesh%section%sect_R_index(isect)
54  thick = hecmesh%section%sect_R_item(in)
55  call heat_capacity_c2(ic_type, nn, ecoord(1:2,1:nn), temp, imat, thick, lumped, mass, &
56  fstrheat%CPtab(imat), fstrheat%CPtemp(imat,:), fstrheat%CPfuncA(imat,:) ,fstrheat%CPfuncB(imat,:), &
57  fstrheat%RHOtab(imat), fstrheat%RHOtemp(imat,:), fstrheat%RHOfuncA(imat,:), fstrheat%RHOfuncB(imat,:))
58 
59  elseif(ic_type == 341 .or. ic_type == 342 .or. ic_type == 351 .or. ic_type == 352 .or. &
60  & ic_type == 361 .or. ic_type == 362)then
61  call heat_capacity_c3(ic_type, nn, ecoord(1:3,1:nn), temp, imat, lumped, mass, &
62  fstrheat%CPtab(imat), fstrheat%CPtemp(imat,:), fstrheat%CPfuncA(imat,:) ,fstrheat%CPfuncB(imat,:), &
63  fstrheat%RHOtab(imat), fstrheat%RHOtemp(imat,:), fstrheat%RHOfuncA(imat,:), fstrheat%RHOfuncB(imat,:))
64 
65  elseif (ic_type == 541) then
66  ! skip warning
67 
68  elseif(ic_type == 731)then
69  in = hecmesh%section%sect_R_index(isect)
70  thick = hecmesh%section%sect_R_item(in)
71  call heat_capacity_shell_731(ic_type, nn, ecoord(1:3,1:nn), temp, imat, thick, lumped, mass, &
72  fstrheat%CPtab(imat), fstrheat%CPtemp(imat,:), fstrheat%CPfuncA(imat,:) ,fstrheat%CPfuncB(imat,:), &
73  fstrheat%RHOtab(imat), fstrheat%RHOtemp(imat,:), fstrheat%RHOfuncA(imat,:), fstrheat%RHOfuncB(imat,:))
74 
75  elseif(ic_type == 741)then
76  in = hecmesh%section%sect_R_index(isect)
77  thick = hecmesh%section%sect_R_item(in)
78  call heat_capacity_shell_741(ic_type, nn, ecoord(1:3,1:nn), temp, imat, thick, lumped, mass, &
79  fstrheat%CPtab(imat), fstrheat%CPtemp(imat,:), fstrheat%CPfuncA(imat,:) ,fstrheat%CPfuncB(imat,:), &
80  fstrheat%RHOtab(imat), fstrheat%RHOtemp(imat,:), fstrheat%RHOfuncA(imat,:), fstrheat%RHOfuncB(imat,:))
81 
82  elseif(ic_type == 111 .or. ic_type == 301 .or. ic_type == 611 .or. ic_type == 641)then
83  in = hecmesh%section%sect_R_index(isect)
84  surf = hecmesh%section%sect_R_item(in)
85  call heat_capacity_c1(ic_type, nn, ecoord(1:3,1:nn), temp, imat, surf, lumped, mass, &
86  fstrheat%CPtab(imat), fstrheat%CPtemp(imat,:), fstrheat%CPfuncA(imat,:) ,fstrheat%CPfuncB(imat,:), &
87  fstrheat%RHOtab(imat), fstrheat%RHOtemp(imat,:), fstrheat%RHOfuncA(imat,:), fstrheat%RHOfuncB(imat,:))
88 
89  else
90  write(*,*)"** error setMASS"
91  endif
92 
93  do ip = 1, nn
94  inod = nodlocal(ip)
95  !$omp atomic
96  hecmat%D(inod) = hecmat%D(inod) + lumped(ip) / delta_time
97  !$omp atomic
98  hecmat%B(inod) = hecmat%B(inod) + lumped(ip)*temp(ip) / delta_time
99  enddo
100  enddo
101  !$omp end do
102  !$omp end parallel
103  enddo
104  end subroutine heat_mat_ass_capacity
105 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_c2(etype, nn, ecoord, temperature, IMAT, thick, lumped, mass, ntab1, temp1, funcA1, funcB1, ntab2, temp2, funcA2, funcB2)
subroutine heat_capacity_c1(etype, nn, ecoord, temperature, IMAT, surf, lumped, mass, ntab1, temp1, funcA1, funcB1, ntab2, temp2, funcA2, funcB2)
subroutine heat_capacity_c3(etype, nn, ecoord, temperature, IMAT, lumped, mass, ntab1, temp1, funcA1, funcB1, ntab2, temp2, funcA2, funcB2)
subroutine heat_capacity_shell_731(etype, nn, ecoord, temperature, IMAT, thick, lumped, mass, ntab1, temp1, funcA1, funcB1, ntab2, temp2, funcA2, funcB2)
subroutine heat_capacity_shell_741(etype, nn, ecoord, temperature, IMAT, thick, 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:431