RealTimeAnalysis Subroutine

subroutine RealTimeAnalysis()

Uses

  • proc~~realtimeanalysis~~UsesGraph proc~realtimeanalysis RealTimeAnalysis module~basicmod basicmod proc~realtimeanalysis->module~basicmod module~boundarymod boundarymod proc~realtimeanalysis->module~boundarymod module~eosmod eosmod proc~realtimeanalysis->module~eosmod module~mpimod mpimod proc~realtimeanalysis->module~mpimod module~config config module~basicmod->module~config module~boundarymod->module~basicmod module~boundarymod->module~config module~mpimod->module~config mpi mpi module~mpimod->mpi

To mesure the growth rate of Kelvin–Helmholtz instability, compute the related variables. (1) < v^y v^y> (2) Note that simple analytic expression of the growth rate of KH is known only idealistic case. In the case of finte length transtion, it is not easy to estimte it. In Berlok and Pformmer (2019), Gamma~1.6--1.8, in my setup Gamma~1.49. We take this value for evaluation metric.

Arguments

None

Calls

proc~~realtimeanalysis~~CallsGraph proc~realtimeanalysis RealTimeAnalysis proc~getmpisum GetMPIsum proc~realtimeanalysis->proc~getmpisum mpi_allreduce mpi_allreduce proc~getmpisum->mpi_allreduce

Source Code

subroutine RealTimeAnalysis
  !! To mesure the growth rate of Kelvin–Helmholtz instability, compute the related variables.
  !! (1) < v^y v^y>
  !! (2) <C*(1-C)>
  use basicmod
  use eosmod
  use mpimod
  use boundarymod
  implicit none
  integer::i,j,k
  real(8):: mix
  real(8):: avevy
  real(8):: dv,vol
  real(8),save:: Amp,Gamma
  integer,save:: unitevo 
  integer,parameter:: vmax=3 
  real(8),dimension(vmax):: local,global
  logical, save :: is_inited
  data is_inited / .false. /

!$acc data create (dv,vol,mix,avevy,local,global)
!$acc serial
  mix   = 0.0d0
  avevy = 0.0d0
  vol   = 0.0d0
!$acc end serial
!$acc kernels
!$acc loop collapse(3) private(dv) reduction(+:vol,mix,avevy) 
  do k=ks,ke
  do j=js,je
  do i=js,ie
     dv     = (x1a(i+1)-x1a(i)) * (x2a(j+1)-x2a(j)) * (x3a(k+1)-x3a(k))
     vol    = vol    + dv
     mix    = mix    + Xcomp(1,i,j,k) * (1.0d0- Xcomp(1,i,j,k)) * dv
     avevy  = avevy + v2(i,j,k) * v2(i,j,k)                     * dv
  enddo
  enddo
  enddo
!$acc end kernels
!$acc serial
  local(1) = vol
  local(2) = mix
  local(3) = avevy
!$acc end serial
  call GetMPIsum(vmax,local,global)
!$acc serial
  vol    = global(1)
  mix    = global(2)
  avevy  = global(3)
  mix = mix/vol
  avevy = sqrt(avevy/vol)
!$acc end serial
!$acc update host(mix,avevy)
!$acc end data
  
  if(myid_w ==0 ) then 
     if(.not. is_inited)then
        !> Note that simple analytic expression of the growth rate of KH is known only idealistic case. 
        !> In the case of finte length transtion, it is not easy to estimte it.
        !> In Berlok and Pformmer (2019), Gamma~1.6--1.8, in my setup Gamma~1.49.
        !> We take this value for evaluation metric.
        Amp   = 1.2d-3
        Gamma = 1.49d0
        open(newunit = unitevo,file="t-prof.csv", action="write")
        write(unitevo,"(A,(1x,ES24.16E3))") "# Gamma=",Gamma
        write(unitevo,"(A)") "# 1:time 2:mix 3:v_y 4:A*exp(Gamma*t)"
        is_inited = .true.
     endif
     write(unitevo,"(*(1x,ES24.16E3))") time, mix, avevy, Amp*exp(Gamma*time)
  endif
  
end subroutine RealTimeAnalysis