wiki:u/bliu/pnfldiff

Version 16 (modified by Baowei Liu, 6 years ago) ( diff )

Project

Like to use the Flux Lim Diffusion to track ionization fronts
I know this won’t work well but its better than nothing.

Jonathan what would it take to do a test of this?

Ionizing source in media with initially low optical depth but tau builds up till it hits 1.

We are basically trying to do the strongmen(Stromgren?) sphere problem.
  I think the current FLD Radiation transport (or the thermal diffusion) scheme could be adapted.  You would have to sub-cycle within the ionization/ radiation solve as the ionization fraction changes - though we do that already with the other parabolic solvers.  Usually there's some additional restriction on the hydro time step - that we would need to work out - or find in the literature...

But a first step would be to gather the necessary equations, linearize them, and then discretize them...  similar to what is done for the thermal diffusion solver.  Using the same radiation flux limiter would be straight-forward.  

https://astrobear.pas.rochester.edu/trac/wiki/ThermalConduction

Equations


I is the rate of ionizations per unit volume and r is the rate of recombinations per unit volume


J is the flux of ionizing photons. Inside the front where the gas is nearly completely ionized the recombination rate


The thermal energy of the gas per unit mass


Links and References

  1. free-streaming limit
  1. Flux limiter
  1. Thermal Conduction
  1. Stromgren sphere problem
  1. Ionization front physics
  1. Yorke 1986
  1. Radiation pressure
  1. Radiation pressure 2
  1. Ionization front

Current code

! Goal is to take input flux and integrate equations across grid to find ionization rate and heating rate
  ! Flux has units of number per area per time in computational units 
  ! Data has computational units of the density of neutral hydrogen, ionized hydrogen, ionization rate, and heating rate
  SUBROUTINE DoLineTransfer(data, rates)
    INTEGER :: i,j,k
    REAL(KIND=qPREC) :: emtau, f, dx, tau, dtau
    REAL(KIND=qpREC), DIMENSION(:,:,:,:) :: data, rates
    !Scale parameters to computational scales

    dx=levels(MaxLevel)%dx
!    write(*,*) LineTransferFlux

    !$OMP PARALLEL DO SCHEDULE(STATIC) COLLAPSE(2) SHARED(sigmaH_scale, egamma_scale, dx, rates, data, LineTransferFlux) PRIVATE(i,j,k,tau,f,dtau,emtau) DEFAULT(NONE)
    DO j=1,size(data,2)
       DO k=1,size(data,3)
          tau=0d0
          f=LineTransferFlux
         !write(*,'(A4,20A25)'), 'i', 'f', 'nH','nHII', 'exp(-tau)', 'dtau', 'sigmaH_scale', 'dx'
          DO i=1,size(data,1)

             !First calculate exp(-tau) where tau =sigmaH*nH+sigmad*nHII
!             emtau=exp(-(sigmaH_scale*data(i,j,k,iH) + sigmad_scale*data(i,j,k,iHII))*dx) )
             dtau=(sigmaH_scale*data(i,j,k,lt_iH)*dx)
             emtau=exp(-dtau)
             !if (emtau /= 1.) write(*,'(I4,20E25.15)') i, f, data(i,j,k,iH:iHII), emtau,(sigmaH_scale*data(i,j,k,iH))*dx, sigmaH_scale, dx
             !Store the photon absorption rate used to calculate the heating and ionization rates
             rates(i,j,k,iioniz)=f*(1d0-emtau)/dx               !has computational units of number per volume per second
!             rates(i,j,k,iheat)=0
             rates(i,j,k,iheat)=f*(1d0-emtau)/dx*egamma_scale  !has computational units of energy per volume per second

             !Update the flux for the next cell along this ray
             f=f*emtau
             tau=tau+dtau
             data(i,j,k,lt_iD)=tau
          END DO
       END DO
    END DO
    !$OMP END PARALLEL DO
  END SUBROUTINE DoLineTransfer
Note: See TracWiki for help on using the wiki.