FrontISTR  6.0.0
Large-scale structural analysis program with finit element method
fstr_ctrl_heat.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  use m_fstr
8  use hecmw
10 
11 contains
12 
14  function fstr_ctrl_get_heat( ctrl, dt, etime, dtmin, deltmx, itmax, eps, tpname, beta )
15  implicit none
16  integer(kind=kint) :: ctrl
17  real(kind=kreal),pointer :: dt(:)
18  real(kind=kreal),pointer :: etime(:)
19  real(kind=kreal),pointer :: dtmin(:)
20  real(kind=kreal),pointer :: deltmx(:)
21  integer(kind=kint),pointer :: itmax(:)
22  real(kind=kreal),pointer :: eps(:)
23  character(len=*), intent(out) :: tpname
24  integer(kind=kint) :: fstr_ctrl_get_heat
25  real(kind=kreal) :: beta, t_beta
26 
28 
29  tpname=""
30  if( fstr_ctrl_get_param_ex( ctrl, 'TIMEPOINTS ', '# ', 0, 'S', tpname )/= 0) return
31 
32  ! JP-7
33  if( fstr_ctrl_get_data_array_ex( ctrl, 'rrrrir ', dt, etime, dtmin, deltmx, itmax, eps )/= 0) return
34 
35  beta = -1.0d0
36  t_beta = -1.0d0
37  if( fstr_ctrl_get_param_ex( ctrl, 'BETA ', '# ', 0, 'R', t_beta)/=0 ) return
38  if(0.0d0 <= t_beta .and. t_beta <= 1.0d0) beta = t_beta
39 
41  end function fstr_ctrl_get_heat
42 
44  function fstr_ctrl_get_fixtemp( ctrl, amp, node_grp_name, node_grp_name_len, value )
45  implicit none
46  integer(kind=kint) :: ctrl
47  character(len=HECMW_NAME_LEN) :: amp
48  character(len=HECMW_NAME_LEN) :: node_grp_name(:)
49  integer(kind=kint) :: node_grp_name_len
50  real(kind=kreal), pointer :: value(:)
51  integer(kind=kint) :: fstr_ctrl_get_fixtemp
52 
53  character(len=HECMW_NAME_LEN) :: data_fmt,ss
54 
56 
57  ! JP-8
58  if( fstr_ctrl_get_param_ex( ctrl, 'AMP ', '# ', 0, 'S', amp )/= 0) return
59 
60  write(ss,*) node_grp_name_len
61  write(data_fmt,'(a,a,a)') 'S',trim(adjustl(ss)),'r '
62 
63  fstr_ctrl_get_fixtemp = fstr_ctrl_get_data_array_ex( ctrl, data_fmt, node_grp_name, value )
64 
65  end function fstr_ctrl_get_fixtemp
66 
67 
69  function fstr_ctrl_get_cflux( ctrl, amp, node_grp_name, node_grp_name_len, value )
70  implicit none
71  integer(kind=kint) :: ctrl
72  character(len=HECMW_NAME_LEN) :: amp
73  character(len=HECMW_NAME_LEN) :: node_grp_name(:)
74  integer(kind=kint) :: node_grp_name_len
75  real(kind=kreal),pointer :: value(:)
76  integer(kind=kint) :: fstr_ctrl_get_cflux
77 
78  character(len=HECMW_NAME_LEN) :: data_fmt,ss
79 
81 
82  ! JP-9
83  if( fstr_ctrl_get_param_ex( ctrl, 'AMP ', '# ', 0, 'S', amp )/= 0) return
84 
85  write(ss,*) node_grp_name_len
86  write(data_fmt,'(a,a,a)') 'S',trim(adjustl(ss)),'r '
87 
88  fstr_ctrl_get_cflux = fstr_ctrl_get_data_array_ex( ctrl, data_fmt, node_grp_name, value )
89 
90  end function fstr_ctrl_get_cflux
91 
93  function fstr_ctrl_get_dflux( ctrl, amp, elem_grp_name, elem_grp_name_len, load_type, value )
94  implicit none
95  integer(kind=kint) :: ctrl
96  character(len=HECMW_NAME_LEN) :: amp
97  character(len=HECMW_NAME_LEN) :: elem_grp_name(:)
98  integer(kind=kint) :: elem_grp_name_len
99  integer(kind=kint),pointer :: load_type(:)
100  real(kind=kreal),pointer :: value(:)
101  integer(kind=kint) :: fstr_ctrl_get_dflux
102 
103  integer(kind=kint), parameter :: type_name_size = 5
104  integer(kind=kint) :: i, n
105  character(len=HECMW_NAME_LEN) :: data_fmt,s1,s2
106  character(len=type_name_size),pointer :: type_name_list(:)
107  integer(kind=kint) :: rcode
108  integer(kind=kint) :: lid = -1
109 
111 
112  ! JP-10
113  if( fstr_ctrl_get_param_ex( ctrl, 'AMP ', '# ', 0, 'S', amp )/= 0) return
114 
115  write(s1,*) elem_grp_name_len
116  write(s2,*) type_name_size
117  write(data_fmt,'(a,a,a,a,a)') 'S',trim(adjustl(s1)),'S',trim(adjustl(s2)),'r '
118 
119  n = fstr_ctrl_get_data_line_n(ctrl)
120  allocate( type_name_list(n) )
121 
122  rcode = fstr_ctrl_get_data_array_ex( ctrl, data_fmt, elem_grp_name, type_name_list, value)
123 
124  if( rcode /= 0 ) then
125  deallocate( type_name_list )
126  return
127  end if
128 
129  do i = 1, n
130  lid = -1;
131  if( type_name_list(i)(1:2) == 'BF' ) then; lid = 0
132  else if( type_name_list(i)(1:2) == 'S0' ) then; lid = 1
133  else if( type_name_list(i)(1:2) == 'S1' ) then; lid = 1
134  else if( type_name_list(i)(1:2) == 'S2' ) then; lid = 2
135  else if( type_name_list(i)(1:2) == 'S3' ) then; lid = 3
136  else if( type_name_list(i)(1:2) == 'S4' ) then; lid = 4
137  else if( type_name_list(i)(1:2) == 'S5' ) then; lid = 5
138  else if( type_name_list(i)(1:2) == 'S6' ) then; lid = 6
139  end if
140  if( lid < 0 ) then
141  write(ilog,*) 'Error : !DFLUX : Load type ',type_name_list(i),' is unknown'
142  deallocate( type_name_list )
143  return
144  end if
145  load_type(i) = lid
146  end do
147 
148  deallocate( type_name_list )
150  end function fstr_ctrl_get_dflux
151 
152  !* ----------------------------------------------------------------------------------------------- *!
154  !* ----------------------------------------------------------------------------------------------- *!
155 
156  function fstr_ctrl_get_sflux( ctrl, amp, surface_grp_name, surface_grp_name_len, value )
157  implicit none
158  integer(kind=kint) :: ctrl
159  character(len=HECMW_NAME_LEN) :: amp
160  character(len=HECMW_NAME_LEN) :: surface_grp_name(:)
161  integer(kind=kint) :: surface_grp_name_len
162  real(kind=kreal),pointer :: value(:)
163  integer(kind=kint) :: fstr_ctrl_get_sflux
164 
165  character(len=HECMW_NAME_LEN) :: data_fmt,ss
166 
168 
169  ! JP-11
170  if( fstr_ctrl_get_param_ex( ctrl, 'AMP ', '# ', 0, 'S', amp )/= 0) return
171 
172  write(ss,*) surface_grp_name_len
173  write(data_fmt,'(a,a,a)') 'S',trim(adjustl(ss)),'r '
174 
175  fstr_ctrl_get_sflux = fstr_ctrl_get_data_array_ex( ctrl, data_fmt, surface_grp_name, value )
176  end function fstr_ctrl_get_sflux
177 
178 
179  !* ----------------------------------------------------------------------------------------------- *!
181  !* ----------------------------------------------------------------------------------------------- *!
182 
183  function fstr_ctrl_get_film( ctrl, amp1, amp2, elem_grp_name, elem_grp_name_len, load_type, value, sink)
184  implicit none
185  integer(kind=kint) :: ctrl
186  character(len=HECMW_NAME_LEN) :: amp1
187  character(len=HECMW_NAME_LEN) :: amp2
188  character(len=HECMW_NAME_LEN) :: elem_grp_name(:)
189  integer(kind=kint) :: elem_grp_name_len
190  integer(kind=kint),pointer :: load_type(:)
191  real(kind=kreal),pointer :: value(:)
192  real(kind=kreal),pointer :: sink(:)
193  integer(kind=kint) :: fstr_ctrl_get_film
194 
195  integer(kind=kint),parameter :: type_name_size = 5
196  integer(kind=kint) :: i, n
197  character(len=HECMW_NAME_LEN) :: data_fmt,s1,s2
198  character(len=type_name_size),pointer :: type_name_list(:)
199  integer(kind=kint) :: lid
200  integer(kind=kint) :: rcode
201 
202  fstr_ctrl_get_film = -1
203 
204  ! JP-12
205  if( fstr_ctrl_get_param_ex( ctrl, 'AMP1 ', '# ', 0, 'S', amp1 )/= 0) return
206  if( fstr_ctrl_get_param_ex( ctrl, 'AMP2 ', '# ', 0, 'S', amp2 )/= 0) return
207 
208  write(s1,*) elem_grp_name_len
209  write(s2,*) type_name_size
210  write(data_fmt,'(a,a,a,a,a)') 'S',trim(adjustl(s1)),'S',trim(adjustl(s2)),'Rr '
211 
212  n = fstr_ctrl_get_data_line_n(ctrl)
213  allocate( type_name_list(n) )
214 
215  rcode = fstr_ctrl_get_data_array_ex( ctrl, data_fmt, elem_grp_name, type_name_list, value, sink)
216 
217  if( rcode /= 0 ) then
218  deallocate( type_name_list )
219  return
220  end if
221 
222  do i = 1, n
223  lid = -1;
224  if( type_name_list(i)(1:2) == 'F0' ) then; lid = 1
225  else if( type_name_list(i)(1:2) == 'F1' ) then; lid = 1
226  else if( type_name_list(i)(1:2) == 'F2' ) then; lid = 2
227  else if( type_name_list(i)(1:2) == 'F3' ) then; lid = 3
228  else if( type_name_list(i)(1:2) == 'F4' ) then; lid = 4
229  else if( type_name_list(i)(1:2) == 'F5' ) then; lid = 5
230  else if( type_name_list(i)(1:2) == 'F6' ) then; lid = 6
231  end if
232  if( lid < 0 ) then
233  write(ilog,*) 'Error : !FILM : Load type ',type_name_list(i),' is unknown'
234  deallocate( type_name_list )
235  return
236  end if
237  load_type(i) = lid
238  end do
239 
240  deallocate( type_name_list )
241 
243  end function fstr_ctrl_get_film
244 
245  !* ----------------------------------------------------------------------------------------------- *!
247  !* ----------------------------------------------------------------------------------------------- *!
248 
249  function fstr_ctrl_get_sfilm( ctrl, amp1, amp2, surface_grp_name, surface_grp_name_len, value, sink)
250  implicit none
251  integer(kind=kint) :: ctrl
252  character(len=HECMW_NAME_LEN) :: amp1
253  character(len=HECMW_NAME_LEN) :: amp2
254  character(len=HECMW_NAME_LEN) :: surface_grp_name(:)
255  integer(kind=kint) :: surface_grp_name_len
256  real(kind=kreal),pointer :: value(:)
257  real(kind=kreal),pointer :: sink(:)
258  integer(kind=kint) :: fstr_ctrl_get_sfilm
259 
260  character(len=HECMW_NAME_LEN) :: data_fmt,ss
261 
263 
264  ! JP-13
265  if( fstr_ctrl_get_param_ex( ctrl, 'AMP1 ', '# ', 0, 'S', amp1 )/= 0) return
266  if( fstr_ctrl_get_param_ex( ctrl, 'AMP2 ', '# ', 0, 'S', amp2 )/= 0) return
267 
268  write(ss,*) surface_grp_name_len
269  write(data_fmt,'(a,a,a)') 'S',trim(adjustl(ss)),'Rr '
270 
271  fstr_ctrl_get_sfilm = fstr_ctrl_get_data_array_ex( ctrl, data_fmt, surface_grp_name, value, sink )
272  end function fstr_ctrl_get_sfilm
273 
274 
275  !* ----------------------------------------------------------------------------------------------- *!
277  !* ----------------------------------------------------------------------------------------------- *!
278 
279  function fstr_ctrl_get_radiate( ctrl, amp1, amp2, elem_grp_name, elem_grp_name_len, load_type, value, sink)
280  implicit none
281  integer(kind=kint) :: ctrl
282  character(len=HECMW_NAME_LEN) :: amp1
283  character(len=HECMW_NAME_LEN) :: amp2
284  character(len=HECMW_NAME_LEN) :: elem_grp_name(:)
285  integer(kind=kint) :: elem_grp_name_len
286  integer(kind=kint),pointer :: load_type(:)
287  real(kind=kreal),pointer :: value(:)
288  real(kind=kreal),pointer :: sink(:)
289  integer(kind=kint) :: fstr_ctrl_get_radiate
290 
291  integer(kind=kint),parameter :: type_name_size = 5
292  integer(kind=kint) :: i, n
293  character(len=HECMW_NAME_LEN) :: data_fmt,s1,s2
294  character(len=type_name_size),pointer :: type_name_list(:)
295  integer(kind=kint) :: lid
296  integer(kind=kint) :: rcode
297 
299 
300  ! JP-14
301  if( fstr_ctrl_get_param_ex( ctrl, 'AMP1 ', '# ', 0, 'S', amp1 )/= 0) return
302  if( fstr_ctrl_get_param_ex( ctrl, 'AMP2 ', '# ', 0, 'S', amp2 )/= 0) return
303 
304  write(s1,*) elem_grp_name_len
305  write(s2,*) type_name_size
306  write(data_fmt,'(a,a,a,a,a)') 'S',trim(adjustl(s1)),'S',trim(adjustl(s2)),'Rr '
307 
308  n = fstr_ctrl_get_data_line_n(ctrl)
309  allocate( type_name_list(n) )
310 
311  rcode = fstr_ctrl_get_data_array_ex( ctrl, data_fmt, elem_grp_name ,type_name_list, value, sink)
312 
313  if( rcode /= 0 ) then
314  deallocate( type_name_list )
315  return
316  end if
317 
318  do i = 1, n
319  lid = -1;
320  if( type_name_list(i)(1:2) == 'R0' ) then; lid = 1
321  else if( type_name_list(i)(1:2) == 'R1' ) then; lid = 1
322  else if( type_name_list(i)(1:2) == 'R2' ) then; lid = 2
323  else if( type_name_list(i)(1:2) == 'R3' ) then; lid = 3
324  else if( type_name_list(i)(1:2) == 'R4' ) then; lid = 4
325  else if( type_name_list(i)(1:2) == 'R5' ) then; lid = 5
326  else if( type_name_list(i)(1:2) == 'R6' ) then; lid = 6
327  end if
328  if( lid < 0 ) then
329  write(ilog,*) 'Error : !RADIATE : Load type ',type_name_list(i),' is unknown'
330  deallocate( type_name_list )
331  return
332  end if
333  load_type(i) = lid
334  end do
335 
336  deallocate( type_name_list )
338  end function fstr_ctrl_get_radiate
339 
340 
341  !* ----------------------------------------------------------------------------------------------- *!
343  !* ----------------------------------------------------------------------------------------------- *!
344 
345  function fstr_ctrl_get_sradiate( ctrl, amp1, amp2, surface_grp_name, surface_grp_name_len, value, sink)
346  implicit none
347  integer(kind=kint) :: ctrl
348  character(len=HECMW_NAME_LEN) :: amp1
349  character(len=HECMW_NAME_LEN) :: amp2
350  character(len=HECMW_NAME_LEN) :: surface_grp_name(:)
351  integer(kind=kint) :: surface_grp_name_len
352  real(kind=kreal),pointer :: value(:)
353  real(kind=kreal),pointer :: sink(:)
354  integer(kind=kint) :: fstr_ctrl_get_sradiate
355 
356  character(len=HECMW_NAME_LEN) :: data_fmt
357  character(len=HECMW_NAME_LEN) :: s1
358 
360 
361  ! JP-15
362  if( fstr_ctrl_get_param_ex( ctrl, 'AMP1 ', '# ', 0, 'S', amp1 )/= 0) return
363  if( fstr_ctrl_get_param_ex( ctrl, 'AMP2 ', '# ', 0, 'S', amp2 )/= 0) return
364 
365  write(s1,*) surface_grp_name_len;
366  write(data_fmt,'(a,a,a)') 'S', trim(adjustl(s1)), 'Rr '
367 
368  fstr_ctrl_get_sradiate = fstr_ctrl_get_data_array_ex( ctrl, data_fmt, surface_grp_name, value, sink )
369 
370  end function fstr_ctrl_get_sradiate
371 
372  !* ----------------------------------------------------------------------------------------------- *!
374  !* ----------------------------------------------------------------------------------------------- *!
375 
376  function fstr_ctrl_get_weldline( ctrl, hecMESH, grp_name_len, weldline )
378 ! use fstr_setup_util
379  implicit none
380  integer(kind=kint), intent(in) :: ctrl
381  type(hecmwst_local_mesh), intent(in) :: hecmesh
382  integer(kind=kint), intent(in) :: grp_name_len
383  type(tweldline), intent(inout) :: weldline
384  integer(kind=kint) :: fstr_ctrl_get_weldline
385 
386  character(len=HECMW_NAME_LEN) :: data_fmt
387  character(len=HECMW_NAME_LEN) :: s1, grp_id_name(1)
388  integer :: grp_id(1)
389 
391  if( fstr_ctrl_get_data_ex( ctrl, 1, 'RRRR ', weldline%I, weldline%U, weldline%coe, weldline%v )/=0 ) return
392  write(s1,*) grp_name_len
393  write(data_fmt,'(a,a,a)') 'S', trim(adjustl(s1)), 'IRRRR '
394  if( fstr_ctrl_get_data_ex( ctrl, 2, data_fmt, grp_id_name(1), weldline%xyz, weldline%n1, &
395  weldline%n2, weldline%distol, weldline%tstart )/=0 ) return
396  call elem_grp_name_to_id( hecmesh, 'WELD_LINE ', 1, grp_id_name, grp_id )
397  weldline%egrpid = grp_id(1)
398 
400  end function fstr_ctrl_get_weldline
401 
402  !* ----------------------------------------------------------------------------------------------- *!
403 end module fstr_ctrl_heat
int fstr_ctrl_get_param_ex(int *ctrl, const char *param_name, const char *value_list, int *necessity, char *type, void *val)
int fstr_ctrl_get_data_array_ex(int *ctrl, const char *format,...)
int fstr_ctrl_get_data_ex(int *ctrl, int *line_no, const char *format,...)
This module contains control file data obtaining functions for heat conductive analysis.
integer(kind=kint) function fstr_ctrl_get_dflux(ctrl, amp, elem_grp_name, elem_grp_name_len, load_type, value)
Read in !DFLUX (heat)
integer(kind=kint) function fstr_ctrl_get_sflux(ctrl, amp, surface_grp_name, surface_grp_name_len, value)
Read in !SFLUX (heat)
integer(kind=kint) function fstr_ctrl_get_weldline(ctrl, hecMESH, grp_name_len, weldline)
Read in !WELD_LINE (heat)
integer(kind=kint) function fstr_ctrl_get_heat(ctrl, dt, etime, dtmin, deltmx, itmax, eps, tpname, beta)
Read in !HEAT.
integer(kind=kint) function fstr_ctrl_get_film(ctrl, amp1, amp2, elem_grp_name, elem_grp_name_len, load_type, value, sink)
Read in !FILM (heat)
integer(kind=kint) function fstr_ctrl_get_radiate(ctrl, amp1, amp2, elem_grp_name, elem_grp_name_len, load_type, value, sink)
Read in !RADIATE (heat)
integer(kind=kint) function fstr_ctrl_get_cflux(ctrl, amp, node_grp_name, node_grp_name_len, value)
Read in !CFLUX (heat)
integer(kind=kint) function fstr_ctrl_get_fixtemp(ctrl, amp, node_grp_name, node_grp_name_len, value)
Read in !FIXTEMP.
integer(kind=kint) function fstr_ctrl_get_sfilm(ctrl, amp1, amp2, surface_grp_name, surface_grp_name_len, value, sink)
Read in !SFILM (heat)
integer(kind=kint) function fstr_ctrl_get_sradiate(ctrl, amp1, amp2, surface_grp_name, surface_grp_name_len, value, sink)
Read in !SRADIATE (heat)
This module contains auxiliary functions in calculation setup.
subroutine elem_grp_name_to_id(hecMESH, header_name, n, grp_id_name, grp_ID)
Definition: hecmw.f90:6
This module defines common data and basic structures for analysis.
Definition: m_fstr.F90:15
real(kind=kreal) eps
Definition: m_fstr.F90:153
real(kind=kreal) etime
Definition: m_fstr.F90:151
integer(kind=kint) itmax
Definition: m_fstr.F90:152
integer(kind=kint), parameter ilog
FILE HANDLER.
Definition: m_fstr.F90:118
real(kind=kreal) dt
ANALYSIS CONTROL for NLGEOM and HEAT.
Definition: m_fstr.F90:150
-1:not relation, >1:index of coupled_node
Definition: m_fstr.F90:678