9 subroutine heat_solve_tran ( hecMESH,hecMAT,fstrSOLID,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
26 type(hecmwst_result_data) :: fstrRESULT
29 type(hecmwst_local_mesh),
pointer :: hecMESHmpc
30 type(hecmwst_matrix),
pointer :: hecMATmpc
31 integer(kind=kint),
parameter :: miniter = 4
32 logical :: is_end, outflag
34 call hecmw_mpc_mat_init(hecmesh, hecmat, hecmeshmpc, hecmatmpc)
38 start_time = start_time + fstrheat%STEP_EETIME(i)
41 total_time = start_time + current_time
43 delta_time_base = fstrheat%STEP_DLTIME(istep)
44 end_time = fstrheat%STEP_EETIME(istep)
45 delmin = fstrheat%STEP_DELMIN(istep)
46 delmax = fstrheat%STEP_DELMAX(istep)
53 if(fstrheat%beta == -1.0d0)
then
54 if(fstrheat%is_steady == 1)
then
61 if(fstrheat%is_steady /= 1 .and. total_step == 1)
then
62 if(fstrparam%fg_result==1)
then
65 if(fstrparam%fg_visual==1)
then
73 if(end_time <= current_time + delta_time_base + delta_time_base*1.0d-6)
then
74 delta_time_base = end_time - current_time
76 if( 0.0d0 < delmin .and. fstrheat%timepoint_id > 0 )
then
77 remain_time = get_remain_to_next_timepoints(total_time, 0.0d0, fstrparam%timepoints(fstrheat%timepoint_id))
78 delta_time = dmin1(delta_time_base, remain_time)
80 delta_time = delta_time_base
82 next_time = current_time + delta_time
83 total_time = start_time + next_time
85 if( fstrheat%is_steady == 1 )
then
88 if( (end_time - next_time) / end_time < 1.d-12 ) is_end = .true.
91 if( 0.0d0 < delmin .and. fstrheat%timepoint_id > 0 )
then
92 outflag = is_end .or. is_at_timepoints(total_time, 0.0d0, fstrparam%timepoints(fstrheat%timepoint_id))
97 if( hecmesh%my_rank.eq.0 )
then
98 write(
imsg,
"(a,i8,a,1pe12.5,a,1pe12.5)")
" ** Increment No. :", total_step,
", total time: ", &
99 & total_time,
", delta t: ", delta_time
100 write(*,
"(a,i8,a,1pe12.5,a,1pe12.5)")
" ** Increment No. :", total_step,
", total time: ", &
101 & total_time,
", delta t: ", delta_time
104 if(delta_time_base < delmin .and. (.not. is_end))
then
105 if(hecmesh%my_rank == 0)
write(
imsg,*)
' !!! DELTA TIME EXCEEDED TOLERANCE OF TIME INCREMENT'
110 & fstrsolid, fstrparam, fstrheat, istep, iterall, total_time, delta_time)
112 if(0.0d0 < delmin)
then
114 do i = 1, hecmesh%nn_internal
115 inod = fstrparam%global_local_id(1,i)
116 dltmp = fstrheat%TEMP0(i) - fstrheat%TEMP(i)
117 if(tmpmax < dabs(dltmp))
then
122 tmpmax_myrank = tmpmax
123 call hecmw_allreduce_r1(hecmesh, tmpmax, hecmw_max)
125 if(tmpmax_myrank < tmpmax) mnod = -1
126 call hecmw_allreduce_i1(hecmesh, mnod, hecmw_max)
128 if(delmax < tmpmax .or. fstrheat%is_iter_max_limit)
then
129 if(hecmesh%my_rank == 0)
then
130 write(*,*)
' *** EXCEEDED TOLERANCE OF VARIATION IN TEMPERATUTE.'
131 write(*,*)
' : NODE NUMBER = ', mnod,
' : DELTA TEMP = ', tmpmax
133 delta_time_base = 0.5d0*delta_time_base
137 if(iterall <= miniter) delta_time_base = delta_time_base*1.5d0
139 if(fstrheat%is_iter_max_limit)
call fstr_abort( hecmw_exit_noconv )
142 do i = 1, hecmesh%n_node
143 fstrheat%TEMP0(i) = fstrheat%TEMP(i)
146 call heat_output_log(hecmesh, fstrparam, fstrheat, total_step, total_time)
147 if(fstrparam%fg_result==1 .and. (mod(total_step, fstrparam%fg_irres)==0 .or. outflag))
then
150 if(fstrparam%fg_visual==1 .and. (mod(total_step, fstrparam%fg_iwres)==0 .or. outflag))
then
151 call heat_output_visual(hecmesh, fstrresult, fstrheat, fstrsolid, total_step, total_time)
153 if(fstrheat%restart_nout > 0)
then
154 if(mod(total_step, fstrheat%restart_nout) == 0 .or. outflag )
then
158 total_step = total_step + 1
159 current_time = next_time
164 call hecmw_mpc_mat_finalize(hecmesh, hecmat, hecmeshmpc, hecmatmpc)
This module defines common data and basic structures for analysis.
integer(kind=kint), parameter imsg
subroutine fstr_abort(code)
Terminate the analysis with a classified exit status. MPI_ABORT does not perform the Fortran I/O fina...
This module provides functions to initialize heat analysis.
This module provides a function to control heat analysis.
subroutine heat_output_visual(hecMESH, fstrRESULT, fstrHEAT, fstrSOLID, tstep, ctime)
subroutine heat_output_restart(hecMESH, fstrHEAT, istep, tstep, current_time)
subroutine heat_output_result(hecMESH, fstrHEAT, fstrSOLID, tstep, ctime)
subroutine heat_output_log(hecMESH, fstrPARAM, fstrHEAT, tstep, ctime)
This module provides a subroutine for all boundary conditions needed in heat analysis.
This module provides a subroutine to assemble heat capacity matrix.
This module provides a function for stationary heat analysis.
subroutine heat_solve_main(hecMESH, hecMAT, hecMESHmpc, hecMATmpc, fstrSOLID, fstrPARAM, fstrHEAT, ISTEP, iterALL, next_time, delta_time)
This module provide a function to control nonsteady heat analysis.
subroutine heat_solve_tran(hecMESH, hecMAT, fstrSOLID, fstrRESULT, fstrPARAM, fstrHEAT, ISTEP, total_step, current_time)
Data for HEAT ANSLYSIS (fstrHEAT)
FSTR INNER CONTROL PARAMETERS (fstrPARAM)