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