9 subroutine heat_solve_tran ( hecMESH,hecMAT,fstrRESULT,fstrPARAM,fstrHEAT,ISTEP,total_step,current_time )
19 integer(kind=kint) :: ISTEP, iterALL, i, inod, mnod
20 integer(kind=kint) :: total_step
21 real(kind=kreal) :: start_time, delta_time_base, delta_time, current_time, next_time, total_time, end_time, delmax, delmin
22 real(kind=kreal) :: tmpmax, dltmp, tmpmax_myrank, remain_time
23 type(hecmwst_local_mesh) :: hecmesh
24 type(hecmwst_matrix) :: hecMAT
25 type(hecmwst_result_data) :: fstrRESULT
28 type(hecmwst_local_mesh),
pointer :: hecMESHmpc
29 type(hecmwst_matrix),
pointer :: hecMATmpc
30 integer(kind=kint),
parameter :: miniter = 4
31 logical :: is_end, outflag
33 call hecmw_mpc_mat_init(hecmesh, hecmat, hecmeshmpc, hecmatmpc)
37 start_time = start_time + fstrheat%STEP_EETIME(i)
40 total_time = start_time + current_time
42 delta_time_base = fstrheat%STEP_DLTIME(istep)
43 end_time = fstrheat%STEP_EETIME(istep)
44 delmin = fstrheat%STEP_DELMIN(istep)
45 delmax = fstrheat%STEP_DELMAX(istep)
52 if(fstrheat%beta == -1.0d0)
then
53 if(fstrheat%is_steady == 1)
then
60 if(fstrheat%is_steady /= 1 .and. total_step == 1)
then
68 if(end_time <= current_time + delta_time_base + delta_time_base*1.0d-6)
then
69 delta_time_base = end_time - current_time
71 if( 0.0d0 < delmin .and. fstrheat%timepoint_id > 0 )
then
72 remain_time = get_remain_to_next_timepoints(total_time, 0.0d0, fstrparam%timepoints(fstrheat%timepoint_id))
73 delta_time = dmin1(delta_time_base, remain_time)
75 delta_time = delta_time_base
77 next_time = current_time + delta_time
78 total_time = start_time + next_time
80 if( fstrheat%is_steady == 1 )
then
83 if( (end_time - next_time) / end_time < 1.d-12 ) is_end = .true.
86 if( 0.0d0 < delmin .and. fstrheat%timepoint_id > 0 )
then
87 outflag = is_end .or. is_at_timepoints(total_time, 0.0d0, fstrparam%timepoints(fstrheat%timepoint_id))
92 if( hecmesh%my_rank.eq.0 )
then
93 write(
imsg,
"(a,i8,a,1pe12.5,a,1pe12.5)")
" ** Increment No. :", total_step,
", total time: ", &
94 & total_time,
", delta t: ", delta_time
95 write(*,
"(a,i8,a,1pe12.5,a,1pe12.5)")
" ** Increment No. :", total_step,
", total time: ", &
96 & total_time,
", delta t: ", delta_time
99 if(delta_time_base < delmin .and. (.not. is_end))
then
100 if(hecmesh%my_rank == 0)
write(
imsg,*)
' !!! DELTA TIME EXCEEDED TOLERANCE OF TIME INCREMENT'
101 call hecmw_abort(hecmw_comm_get_comm())
104 call heat_solve_main(hecmesh, hecmat, hecmeshmpc, hecmatmpc, fstrparam, fstrheat, istep, iterall, total_time, delta_time)
106 if(0.0d0 < delmin)
then
108 do i = 1, hecmesh%nn_internal
109 inod = fstrparam%global_local_id(1,i)
110 dltmp = fstrheat%TEMP0(i) - fstrheat%TEMP(i)
111 if(tmpmax < dabs(dltmp))
then
116 tmpmax_myrank = tmpmax
117 call hecmw_allreduce_r1(hecmesh, tmpmax, hecmw_max)
119 if(tmpmax_myrank < tmpmax) mnod = -1
120 call hecmw_allreduce_i1(hecmesh, mnod, hecmw_max)
122 if(delmax < tmpmax .or. fstrheat%is_iter_max_limit)
then
123 if(hecmesh%my_rank == 0)
then
124 write(*,*)
' *** EXCEEDED TOLERANCE OF VARIATION IN TEMPERATUTE.'
125 write(*,*)
' : NODE NUMBER = ', mnod,
' : DELTA TEMP = ', tmpmax
127 delta_time_base = 0.5d0*delta_time_base
131 if(iterall <= miniter) delta_time_base = delta_time_base*1.5d0
133 if(fstrheat%is_iter_max_limit)
call hecmw_abort( hecmw_comm_get_comm() )
136 do i = 1, hecmesh%n_node
137 fstrheat%TEMP0(i) = fstrheat%TEMP(i)
140 call heat_output_log(hecmesh, fstrparam, fstrheat, total_step, total_time)
142 call heat_output_visual(hecmesh, fstrresult, fstrheat, total_step, total_time, outflag)
145 total_step = total_step + 1
146 current_time = next_time
151 call hecmw_mpc_mat_finalize(hecmesh, hecmat, hecmeshmpc, hecmatmpc)