dns-hit3d-fdm/m_hit_result.f90

114 lines
3.8 KiB
Fortran

!================================================================================
! m_hit_result - module for printing out the results
! such as energy spectrum and velocity field
!
! Time-stamp: <2014-03-19 J. Kwon>
!================================================================================
module m_hit_result
use m_parameters
implicit none
contains
subroutine result_files_open
use m_parameters
! statistics
write(*,*) 'result_open,ITMIN',ITMIN
if(ITMIN.eq.0) then
open(tp_stat,file='tp_stat.dat',form='formatted')
write(tp_stat,*) 'VARIABLES = "itime","time","tke","rms_u`","int_LS","Eddy_TO_time","Kol_LS"' !
write(tp_stat,*) '"Kol_VS","Kol_TS","Taylor_LS","dissipation"'
else
open(tp_stat,file='tp_stat.dat',status='old',position='append')
endif
! flucating velocity field, u',v',w'
write(*,*) 'result_files_open, fdm_sw',fdm_sw
if(fdm_sw.eq.0) then
if(ITMIN.eq.0) then
open(tp_field,FILE='tp_field.dat')
write(tp_field,*) 'VARIABLES = "x","y","z","u","v","w"'
else
open(tp_field,file='tp_field.dat',status='old',position='append')
endif
else
if(ITMIN.eq.0) then
open(tp_field,file='tp_field.dat')
write(tp_field,*) 'VARIABLES = "X","Y","Z","C","U","V","W"'
else
open(tp_field,file='tp_field.dat',status='old',position='append')
endif
endif
! model spectrum
if(ITMIN.eq.0) then
open(unit=model_spectrum,file="model_spectrum.dat")
write(model_spectrum,*) 'VARIABLES = "k","Model_E(k)"' !
write(model_spectrum,*) '"Kolmogorov","Exponential","VonKarman"' !
endif
! realtime energy/dissipation spectrum
if(ITMIN.eq.0) then
open(unit=tp_spec,file="tp_spec.dat")
write(tp_spec,*) 'VARIABLES = "k","E(k)","D(k)"'
else
open(unit=tp_spec,file="tp_spec.dat",status='old',position='append')
endif
! realtime energy spectrum
if(ITMIN.eq.0) then
open(unit=tp_tke_spec,file="tp_tke_spec.dat")
write(tp_tke_spec,*) 'VARIABLES = "k","E(k)"'
else
open(unit=tp_tke_spec,file="tp_tke_spec.dat",status='old',position='append')
endif
! realtime dissipation spectrum
if(ITMIN.eq.0) then
open(unit=tp_eps_spec,file="tp_eps_spec.dat")
write(tp_eps_spec,*) 'VARIABLES = "k","D(k)"'
else
open(unit=tp_eps_spec,file="tp_eps_spec.dat",status='old',position='append')
endif
! realtime max, min velocities
if(ITMIN.eq.0) then
open(unit=tp_max_min_uvw,file="tp_max_min_uvw.dat")
write(tp_max_min_uvw,*) 'VARIABLES = "time","max_u","max_v","max_w","min_u","min_v","min_w"'
else
open(unit=tp_max_min_uvw,file="tp_max_min_uvw.dat",status='old',position='append')
endif
! FDM temporary output
! OPEN(23,FILE='St_data.dat')
! write(23,*)'VARIABLES = "Time","Mean Velocity","Sc","Flame Location"'
! OPEN(22,FILE='3D_Field.dat')
! WRITE(22,*) 'VARIABLES = "X","Y","Z","C","U","V","
if(fdm_sw.ne.0) then
if(ITMIN.eq.0) then
open(St_data,file='St_data.dat')
write(St_data,*)'VARIABLES = "Time","Mean Velocity","Sc","Flame Location"'
else
open(St_data,file='St_data.dat',status='old',position='append')
endif
endif
! if(fdm_sw.ne.0) then
! if(ITMIN.eq.0) then
! open(506,file='3D_field.dat')
! write(506,*) 'VARIABLES = "X","Y","Z","C","U","V","W"'
! else
! open(506,file='3D_field.dat',status='old',position='append')
! endif
! endif
if(ITMIN.eq.0) then
open(unit=restart_pair,file="restart_pair.txt")
else
open(unit=restart_pair,file="restart_pair.txt",status='old',position='append')
endif
end subroutine result_files_open
end module m_hit_result