Changes between Version 195 and Version 196 of FluxLimitedDiffusion


Ignore:
Timestamp:
05/30/13 17:20:39 (11 years ago)
Author:
Baowei Liu
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • FluxLimitedDiffusion

    v195 v196  
    55[[CollapsibleStart(Spectral Intensity)]]
    66== Spectral Intensity ==
    7 Typically when we discuss the radiation field we use the spectral intensity [[latex(I \left ( \nu, \mathbf{x}, \Omega \right ) )]] which is a function of frequency, position, and direction.  This is very similar to the phase space density used in deriving the fluid equations [[latex(f \left ( \mathbf{x}, \mathbf{v} \right ) )]] except that
    8  * light always travels at \(c\), so the velocity dependence is just a direction dependence. 
     7Typically when we discuss the radiation field we use the spectral intensity [[latex($I \left ( \nu, \mathbf{x}, \Omega \right ) $)]] which is a function of frequency, position, and direction.  This is very similar to the phase space density used in deriving the fluid equations [[latex($f \left ( \mathbf{x}, \mathbf{v} \right ) $)]] except that
     8 * light always travels at  [[latex($c$)]], so the velocity dependence is just a direction dependence. 
    99 * Furthermore, photons can have different frequencies, so there is an extra dimension to the phase space. 
    1010 * Instead of storing the phase space density of photons, the spectral intensity is the phase space density of energy flux... 
    1111
    12 Going between photon number and energy just involves a factor of \( h \nu \) and going from energy density to energy flux density just involves a factor of \(c\) so we have
    13 
    14  $$ I \left ( \nu, \mathbf{x}, \Omega, \right ) = h \nu c f \left ( \nu, \mathbf{x}, \Omega, \right ) $$
     12Going between photon number and energy just involves a factor of [[latex($h\nu$)]] and going from energy density to energy flux density just involves a factor of [[latex($c$)]] so we have
     13
     14 [[latex($I \left ( \nu, \mathbf{x}, \Omega, \right ) = h \nu c f \left ( \nu, \mathbf{x}, \Omega, \right ) $)]]
    1515
    1616This can also be seen by considering the differential energy
    1717
    18  [[latex(dE = I \left ( \nu, \mathbf{x}, \Omega, \right ) d\nu d\Omega dA dt = h \nu f \left ( \nu, \mathbf{x}, \Omega, \right ) d\nu d\Omega dV)]]
     18 [[latex($dE = I \left ( \nu, \mathbf{x}, \Omega, \right ) d\nu d\Omega dA dt = h \nu f \left ( \nu, \mathbf{x}, \Omega, \right ) d\nu d\Omega dV$)]]
    1919
    2020where the number of photons traveling normal to the surface dA that cross the surface dA in time dt is just the number of photons in the volume dV = dA c dt (assuming the photons are headed normal to dA)...
    2121
    2222so we also have
    23  [[latex(dE = h \nu f \left ( \nu, \mathbf{x}, \Omega, \right ) d\nu d\Omega dA c dt)]]
     23 [[latex($dE = h \nu f \left ( \nu, \mathbf{x}, \Omega, \right ) d\nu d\Omega dA c dt$)]]
    2424
    2525which gives
    2626
    27  [[latex(I \left ( \nu, \mathbf{x}, \Omega, \right ) = h \nu c f \left ( \nu, \mathbf{x}, \Omega, \right ) )]]
     27 [[latex($I \left ( \nu, \mathbf{x}, \Omega, \right ) = h \nu c f \left ( \nu, \mathbf{x}, \Omega, \right ) $)]]
    2828
    2929
     
    3333== Deriving the Transport Equation ==
    3434
    35 If we consider the Boltzmann transport equation for photons of a specific frequency \(f_\nu\) we have
    36 
    37  [[latex(\frac{\partial}{\partial t} f_\nu + \mathbf{v} \cdot  \nabla f + \mathbf{F} \cdot \nabla_p f = \left ( \frac{\partial f}{\partial t} \right )_{coll} )]]
     35If we consider the Boltzmann transport equation for photons of a specific frequency [[latex($f_\nu$)]] we have
     36
     37 [[latex($\frac{\partial}{\partial t} f_\nu + \mathbf{v} \cdot  \nabla f + \mathbf{F} \cdot \nabla_p f = \left (\frac{\partial f}{\partial t} \right )_{coll} $)]]
    3838
    3939Now photons don't experience body forces, always travel at the speed of light,  and in general the "collision term" consists of photon emission and absorptions... so we have
    4040
    41  [[latex(\frac{\partial}{\partial t} f_\nu + c \mathbf{n} \cdot  \nabla f_\nu  = A_{\nu} - \chi_\nu f_\nu c  )]]
    42 
    43 where \(A_{\nu} \) is the emission rate of photons of frequency \(\nu\) and the mean free path length is given by \(\chi_\nu = \sigma_\nu n\) where \(\sigma_\nu\) is the particle scattering cross section and \(n\) is the number density of particles.
    44 
    45 Now if we multiply through by \( h\nu\) we have
    46  [[latex(\frac{\partial}{c \partial t} I_\nu + \mathbf{n} \cdot  \nabla I_\nu  = \eta_\nu - \sigma_\nu I_\nu  )]]
    47 
    48 where \(\eta_\nu = h\nu A_{\nu}\) is the radiative power
     41 [[latex($\frac{\partial}{\partial t} f_\nu + c \mathbf{n} \cdot  \nabla f_\nu  = A_{\nu} - \chi_\nu f_\nu c  $)]]
     42
     43where [[latex($A_{\nu} $)]] is the emission rate of photons of frequency [[latex($\nu$)]] and the mean free path length is given by [[latex($\chi_\nu = \sigma_\nu n$)]] where [[latex($\sigma_\nu$)]] is the particle scattering cross section and [[latex($n$)]] is the number density of particles.
     44
     45Now if we multiply through by [[latex($ h\nu$)]] we have
     46 [[latex($\frac{\partial}{c \partial t} I_\nu + \mathbf{n} \cdot  \nabla I_\nu  = \eta_\nu - \sigma_\nu I_\nu  $)]]
     47
     48where [[latex($\eta_\nu = h\nu A_{\nu}$)]] is the radiative power
    4949
    5050If we solve the transport equation along a characteristic
    5151
    52  [[latex(\left [ \mathbf{x} \left ( s \right ) , t \left ( s \right ) \right ] = \left [ \mathbf{x0} + \mathbf{n} s, \frac{s}{c} \right ] )]]
     52 [[latex($\left [ \mathbf{x} \left ( s \right ) , t \left ( s \right ) \right ] = \left [ \mathbf{x0} + \mathbf{n} s, \frac{s}{c} \right ] $)]]
    5353
    5454we have
    5555
    56  [[latex(\frac{d I_\nu}{d s} = \frac{\partial I_\nu}{\partial x^i} \frac{\partial{x^i}}{\partial s} + \frac{\partial I_\nu}{\partial t}\frac{\partial t}{\partial s} = \mathbf{n} \cdot \nabla I_\nu + \frac{1}{c}\frac{\partial I_\nu}{\partial t} = \eta_\nu(s) - \chi_\nu(s) I_\nu (s)  )]]
    57 
    58 where \(f(s) = f(\mathbf{x}(s), t(s)) = f \left ( \mathbf{x_0}+\mathbf{n} s, \frac{s}{c} \right ) \) and then we can divide through by \(\chi_\nu(s)\) we get
    59 
    60  [[latex(\frac{dI_\nu}{\chi_\nu(s) ds} = \frac{\eta_\nu(s)}{\chi_\nu(s)} - I_\nu(s) = S_\nu(s) - I_\nu(s))]]
    61 
    62 Now if we define \(d\tau_\nu = \chi_\nu(s) ds \) which gives
    63 
    64  [[latex(\tau_\nu(s) = \int\limits_0^s \chi_\nu(s') ds')]]
    65 and
    66  [[latex(s(\tau_\nu) = \int\limits_0^\tau_\nu \frac{1}{\chi_\nu} d\tau'_\nu )]]
     56 [[latex($\frac{d I_\nu}{d s} = \frac{\partial I_\nu}{\partial x^i} \frac{\partial{x^i}}{\partial s} + \frac{\partial I_\nu}{\partial t}\frac{\partial t}{\partial s} = \mathbf{n} \cdot \nabla I_\nu + \frac{1}{c}\frac{\partial I_\nu}{\partial t} = \eta_\nu(s) - \chi_\nu(s) I_\nu (s)  $)]]
     57
     58where [[latex($f(s) = f(\mathbf{x}(s), t(s)) = f \left ( \mathbf{x_0}+\mathbf{n} s, \frac{s}{c} \right ) $)]] and then we can divide through by [[latex($\chi_\nu(s)$)]] we get
     59
     60 [[latex($\frac{dI_\nu}{\chi_\nu(s) ds} = \frac{\eta_\nu(s)}{\chi_\nu(s)} - I_\nu(s) = S_\nu(s) - I_\nu(s)$)]]
     61
     62Now if we define [[latex($d\tau_\nu = \chi_\nu(s) ds $)]] which gives
     63
     64 [[latex($\tau_\nu(s) = \int\limits_0^s \chi_\nu(s') ds'$)]]
     65and
     66
     67 [[latex($s(\tau_\nu) = \int\limits_0^\tau_\nu \frac{1}{\chi_\nu} d\tau'_\nu$)]]
    6768
    6869we can write the transport equation in the simplest form
    6970
    70  [[latex(\frac{dI_\nu}{d\tau_\nu} = S_\nu(\tau_\nu) - I_\nu(\tau_\nu))]]
     71 [[latex($\frac{dI_\nu}{d\tau_\nu} = S_\nu(\tau_\nu) - I_\nu(\tau_\nu)$)]]
    7172
    7273although the RHS is now more difficult to evaluate as
    7374
    74  [[latex( f \left ( \tau_\nu \right ) = f \left ( s \left ( \tau_\nu \right ) \right ) = f \left ( \mathbf{x} \left (s \left ( \tau_\nu \right ) \right ), t \left ( s \left ( \tau_\nu \right ) \right ) \right ) )]]
    75 
    76 Also if we include scattering then the source function can depend on the mean radiative flux \(\frac{cE}{4 \pi}\) and the transport equation becomes an integro-differential equation that must be solved iteratively...
     75 [[latex($ f \left ( \tau_\nu \right ) = f \left ( s \left ( \tau_\nu \right ) \right ) = f \left ( \mathbf{x} \left (s \left ( \tau_\nu \right ) \right ), t \left ( s \left ( \tau_\nu \right ) \right ) \right ) $)]]
     76
     77Also if we include scattering then the source function can depend on the mean radiative flux [[latex($\frac{cE}{4 \pi}$)]] and the transport equation becomes an integro-differential equation that must be solved iteratively...
    7778
    7879There are also a few important dimensionless numbers to consider:
    7980
    80 || [[latex(\tau = l \kappa=\frac{l}{\lambda_p})]] || [[latex(\beta = \frac{u}{c})]] ||
    81 || [[latex(\tau << 1 )]] || streaming limit ||
    82 || [[latex(\tau >> 1 \mbox{, } \beta \tau << 1)]] || static diffusion limit ||
    83 || [[latex(\tau >> 1 \mbox{, } \beta \tau >> 1)]] || dynamic diffusion limit ||
     81|| [[latex($\tau = l \kappa=\frac{l}{\lambda_p}$)]] || [[latex($\beta = \frac{u}{c}$)]] ||
     82|| [[latex($\tau << 1 $)]] || streaming limit ||
     83|| [[latex($\tau >> 1 \mbox{, } \beta \tau << 1$)]] || static diffusion limit ||
     84|| [[latex($\tau >> 1 \mbox{, } \beta \tau >> 1$)]] || dynamic diffusion limit ||
    8485
    8586[[CollapsibleEnd()]]
     
    9091Some of what follows is taken from [http://adsabs.harvard.edu/abs/2007ApJ...667..626K Krumholz et al. 2007]
    9192
    92 ||  [[latex(\frac{\partial \rho}{\partial t} + \nabla \cdot \left ( \rho \mathbf{v} \right ) = 0)]]  ||
    93 ||  [[latex(\frac{\partial }{\partial t} \left ( \rho \mathbf{v} \right ) + \nabla \cdot \left ( \rho \mathbf{vv} \right ) = -\nabla P+\mathbf{G})]]  ||
    94 ||  [[latex(\frac{\partial e}{\partial t}  + \nabla \cdot \left [ \left ( e + P \right ) \mathbf{v} \right ] = c G^0)]]  ||
    95 ||  [[latex(\frac{\partial E}{\partial t} + \nabla \cdot \mathbf{F} = -c G_0 )]]  ||
    96 ||  [[latex(\frac{1}{c^2} \frac{\partial \mathbf{F}}{\partial t} + \nabla \cdot \mathbf{P} = -\mathbf{G})]]  ||
     93||  [[latex($\frac{\partial \rho}{\partial t} + \nabla \cdot \left ( \rho \mathbf{v} \right ) = 0$)]]  ||
     94||  [[latex($\frac{\partial }{\partial t} \left ( \rho \mathbf{v} \right ) + \nabla \cdot \left ( \rho \mathbf{vv} \right ) = -\nabla P+\mathbf{G}$)]]  ||
     95||  [[latex($\frac{\partial e}{\partial t}  + \nabla \cdot \left [ \left ( e + P \right ) \mathbf{v} \right ] = c G^0$)]]  ||
     96||  [[latex($\frac{\partial E}{\partial t} + \nabla \cdot \mathbf{F} = -c G_0 $)]]  ||
     97||  [[latex($\frac{1}{c^2} \frac{\partial \mathbf{F}}{\partial t} + \nabla \cdot \mathbf{P} = -\mathbf{G}$)]]  ||
    9798
    9899where the moments of the specific intensity are defined as
    99100||  Radiation Energy moments  ||   Corresponding fluid moments   ||
    100 ||  [[latex(cE =\int_0^\infty d \nu \int d \Omega I(\mathbf{n}, \nu))]]  ||  [[latex(\rho=\int d \mathbf{v} f(\mathbf{v}))]]  || 
    101 ||  [[latex(\mathbf{F}=\int_0^\infty d \nu \int d \Omega \mathbf{n} I(\mathbf{n}, \nu))]]  || [[latex(\rho \mathbf{v} =\int d \mathbf{v} \mathbf{v} f(\mathbf{v}))]]  ||   
    102 ||  [[latex(c\mathbf{P}=\int_0^\infty d \nu \int d \Omega \mathbf{nn} I(\mathbf{n}, \nu))]]   ||  [[latex(\mathbf{P} =\int d \mathbf{v} \mathbf{vv} f(\mathbf{v}))]]  ||   
     101||  [[latex($cE =\int_0^\infty d \nu \int d \Omega I(\mathbf{n}, \nu)$)]]  ||  [[latex($\rho=\int d \mathbf{v} f(\mathbf{v})$)]]  || 
     102||  [[latex($\mathbf{F}=\int_0^\infty d \nu \int d \Omega \mathbf{n} I(\mathbf{n}, \nu)$)]]  || [[latex($\rho \mathbf{v} =\int d \mathbf{v} \mathbf{v} f(\mathbf{v})$)]]  ||   
     103||  [[latex($c\mathbf{P}=\int_0^\infty d \nu \int d \Omega \mathbf{nn} I(\mathbf{n}, \nu)$)]]   ||  [[latex($\mathbf{P} =\int d \mathbf{v} \mathbf{vv} f(\mathbf{v})$)]]  ||   
    103104
    104105and the radiation 4-force density is given by
    105106
    106 ||   [[latex(cG^0 = \int_0^\infty d \nu \int d \Omega \left [ \kappa (\mathbf{n}, v)I(\mathbf{n}, \nu)-\eta(\mathbf{n},v) \right ])]]  ||
    107 ||   [[latex(c\mathbf{G} = \int_0^\infty d \nu \int d \Omega \left [ \kappa (\mathbf{n}, v)I(\mathbf{n}, \nu)-\eta(\mathbf{n},v) \right ] \mathbf{n})]]  ||
    108 
    109 If we had a closure relation for the radiation pressure then we could solve this system.  For gas particles, collisions tend to produce a Boltzmann Distribution which is isotropic and gives a pressure tensor that is a multiple of the identity tensor.  Photons do not "collide" with each other and they all have the same velocity 'c' but in various directions.  If the field were isotropic than \(P^{ij}=\delta^{ij} 1/3 E\) but in general \(P^{ij}=f^{ij} E\) where 'f' is the Eddington Tensor.
     107||   [[latex($cG^0 = \int_0^\infty d \nu \int d \Omega \left [ \kappa (\mathbf{n}, v)I(\mathbf{n}, \nu)-\eta(\mathbf{n},v) \right ]$)]]  ||
     108||   [[latex($c\mathbf{G} = \int_0^\infty d \nu \int d \Omega \left [ \kappa (\mathbf{n}, v)I(\mathbf{n}, \nu)-\eta(\mathbf{n},v) \right ] \mathbf{n}$)]]  ||
     109
     110If we had a closure relation for the radiation pressure then we could solve this system.  For gas particles, collisions tend to produce a Boltzmann Distribution which is isotropic and gives a pressure tensor that is a multiple of the identity tensor.  Photons do not "collide" with each other and they all have the same velocity 'c' but in various directions.  If the field were isotropic than [[latex($P^{ij}=\delta^{ij} 1/3 E$)]] but in general [[latex($P^{ij}=f^{ij} E$)]] where 'f' is the Eddington Tensor.
    110111
    111112[[CollapsibleEnd()]]
     
    113114== Simplifying assumptions ==
    114115* If the flux spectrum of the radiation is direction-independent then we can write the radiation four-force density in terms of the moments of the radiation field
    115 ||   [[latex(G^0=\gamma [ \gamma^2 \kappa_{0E} + (1-\gamma^2)\kappa_{0F}]E-\gamma \kappa_{0P}a_RT_0^4-\gamma(\mathbf{v} \cdot \mathbf{F}/c^2)[\kappa_{0F}-2\gamma^2(\kappa_{0F}-\kappa_{0E})] - \gamma^3(\kappa_{0F}-\kappa+{0E})(\mathbf{vv}) : \mathbf{P}/c^2)]]   ||
    116 ||   [[latex(\mathbf{G} = \gamma \kappa_{0F}(\mathbf{F}/c)-\gamma \kappa_{0P}a_RT_0^4 (\mathbf{v}/c)  - \left [ \gamma^3( \kappa_{0F} - \kappa_{0E})( \mathbf{v}/c)E + \gamma \kappa_{0F}(\mathbf{v}/c) \cdot \mathbf{P} \right ] + \gamma^3 ( \kappa_{0F} - \kappa_{0E}) \left [ 2 \mathbf{v} \cdot \mathbf{F}/c^3 - ( \mathbf{vv}) : \mathbf{P}/c^3 \right ] \mathbf{v} )]]   ||
     116||   [[latex($G^0=\gamma [ \gamma^2 \kappa_{0E} + (1-\gamma^2)\kappa_{0F}]E-\gamma \kappa_{0P}a_RT_0^4-\gamma(\mathbf{v} \cdot \mathbf{F}/c^2)[\kappa_{0F}-2\gamma^2(\kappa_{0F}-\kappa_{0E})] - \gamma^3(\kappa_{0F}-\kappa+{0E})(\mathbf{vv}) : \mathbf{P}/c^2$)]]   ||
     117||   [[latex($\mathbf{G} = \gamma \kappa_{0F}(\mathbf{F}/c)-\gamma \kappa_{0P}a_RT_0^4 (\mathbf{v}/c)  - \left [ \gamma^3( \kappa_{0F} - \kappa_{0E})( \mathbf{v}/c)E + \gamma \kappa_{0F}(\mathbf{v}/c) \cdot \mathbf{P} \right ] + \gamma^3 ( \kappa_{0F} - \kappa_{0E}) \left [ 2 \mathbf{v} \cdot \mathbf{F}/c^3 - ( \mathbf{vv}) : \mathbf{P}/c^3 \right ] \mathbf{v} $)]]   ||
    117118
    118119 where
    119120
    120 ||  [[latex(\kappa_{0P})]]  ||  comoving-frame Planck function weighted opacity ||
    121 ||  [[latex(\kappa_{0E})]]  ||  comoving-frame radiation energy weighted opacity ||
    122 ||  [[latex(\kappa_{0F})]]  ||  comoving-frame radiation flux weighted opacity ||
    123 
    124 * If the radiation has a blackbody spectrum then \(\kappa_{0E}=\kappa_{0P}\)
     121||  [[latex($\kappa_{0P}$)]]  ||  comoving-frame Planck function weighted opacity ||
     122||  [[latex($\kappa_{0E}$)]]  ||  comoving-frame radiation energy weighted opacity ||
     123||  [[latex($\kappa_{0F}$)]]  ||  comoving-frame radiation flux weighted opacity ||
     124
     125* If the radiation has a blackbody spectrum then [[latex($\kappa_{0E}=\kappa_{0P}$)]]
    125126* If the radiation is optically thick, then
    126 [[latex(\mathbf{F_0}(\nu_0) \propto -\nabla E_0(\nu_0)/\kappa_0(\nu_0) \propto -[\partial B(\nu_0, T_0) / \partial T_0](\nabla T_0)/\kappa_0(\nu_0))]]
    127  which implies that  [[latex(\kappa_{0F}^{-1}=\kappa_{0R}^{-1}=\frac{\int_0^\infty d \nu_0 \kappa_0(\nu_0)^{-1}[\partial B(\nu_0,T_0)/\partial T_0]}{\int_0^\infty d \nu_0 [\partial B(\nu_0, T_0)/\partial T_0]})]]
    128 * In the optically thin regime, \(|\mathbf{F}_0(\nu_0)| \rightarrow cE_0(\nu_0)\) so we would have \(\kappa_{0F}=\kappa_{0E}\) however assuming a blackbody temperature in the optically thin limit may be any more accurate than assuming that \(\kappa_{0F}=\kappa_{0R}\)
     127[[latex($\mathbf{F_0}(\nu_0) \propto -\nabla E_0(\nu_0)/\kappa_0(\nu_0) \propto -[\partial B(\nu_0, T_0) / \partial T_0](\nabla T_0)/\kappa_0(\nu_0)$)]]
     128 which implies that  [[latex($\kappa_{0F}^{-1}=\kappa_{0R}^{-1}=\frac{\int_0^\infty d \nu_0 \kappa_0(\nu_0)^{-1}[\partial B(\nu_0,T_0)/\partial T_0]}{\int_0^\infty d \nu_0 [\partial B(\nu_0, T_0)/\partial T_0]}$)]]
     129* In the optically thin regime, [[latex($|\mathbf{F}_0(\nu_0)| \rightarrow cE_0(\nu_0)$)]] so we would have [[latex($\kappa_{0F}=\kappa_{0E}$)]] however assuming a blackbody temperature in the optically thin limit may be any more accurate than assuming that [[latex($\kappa_{0F}=\kappa_{0R}$)]]
    129130[[CollapsibleEnd()]]
    130131
     
    133134
    134135The flux limited diffusion approximation drops the radiation momentum equation in favor of
    135 \(\mathbf{F}_0=-\frac{c\lambda}{\kappa_{0R}}\nabla E_0\) where \(\lambda\) is the flux-limiter and is given by
    136 
    137   [[latex(\lambda = \frac{1}{R} \left ( \coth R - \frac{1}{R} \right ) )]] 
    138 and
    139   [[latex(R=\frac{|\nabla E_0|}{\kappa_{0R}E_0})]] 
     136[[latex($\mathbf{F}_0=-\frac{c\lambda}{\kappa_{0R}}\nabla E_0$)]] where [[latex($\lambda$)]] is the flux-limiter and is given by
     137
     138  [[latex($\lambda = \frac{1}{R} \left ( \coth R - \frac{1}{R} \right ) $)]] 
     139and
     140  [[latex($R=\frac{|\nabla E_0|}{\kappa_{0R}E_0}$)]] 
    140141
    141142which corresponds to a pressure tensor
    142    [[latex(\mathbf{P}_0=\frac{E_0}{2}[(1-R_2)\mathbf{I}+(3R_2-1)\mathbf{n}_0\mathbf{n}_0])]]   
     143   [[latex($\mathbf{P}_0=\frac{E_0}{2}[(1-R_2)\mathbf{I}+(3R_2-1)\mathbf{n}_0\mathbf{n}_0]$)]]   
    143144where
    144    [[latex(R_2=\lambda+\lambda^2R^2)]]   
    145 
    146 Here are \(\lambda(R)\) and \(R_2(R)\) plotted
    147   [[Image(fld.png, width=400)]]
     145   [[latex($R_2=\lambda+\lambda^2R^2$)]]   
     146
     147Here are [[latex($\lambda(R)$)]] and [[latex($R_2(R)$)]] plotted
     148  [[Image(fld.png, width=400$)]]
    148149
    149150
    150151If we Lorentz boost the comoving terms into the lab frame and keep terms necessary to maintain accuracy we get:
    151152
    152    [[latex(G^0=\kappa_{0P} \left ( E-\frac{4 \pi B}{c} \right ) + \left ( \frac{\lambda}{c} \right ) \left ( 2 \frac{\kappa_{0P}}{\kappa_{0R}} - 1 \right ) \mathbf{v} \cdot \nabla E - \frac{\kappa_{0P}}{c^2} E \left [ \frac{3-R_2}{2}v^2 + \frac{3R_2-1}{2}(\mathbf{v} \cdot \mathbf{n})^2 \right ] + \frac{1}{2} \left ( \frac{v}{c} \right ) ^2 \kappa_{0P} \left ( E - \frac{4 \pi B}{c} \right ) )]]   
    153    [[latex(\mathbf{G} = -\lambda \nabla E + \kappa_{0P} \frac{\mathbf{v}}{c} \left ( E - \frac{4 \pi B}{c} \right ) - \frac{1}{2} \left ( \frac{v}{c} \right ) ^2 \lambda \nabla E + 2 \lambda \left ( \frac{\kappa_{0P}}{\kappa_{0R}} - 1 \right ) \frac{(\mathbf{v} \cdot \nabla E )\mathbf{v}}{c^2})]]   
     153   [[latex($G^0=\kappa_{0P} \left ( E-\frac{4 \pi B}{c} \right ) + \left ( \frac{\lambda}{c} \right ) \left ( 2 \frac{\kappa_{0P}}{\kappa_{0R}} - 1 \right ) \mathbf{v} \cdot \nabla E - \frac{\kappa_{0P}}{c^2} E \left [ \frac{3-R_2}{2}v^2 + \frac{3R_2-1}{2}(\mathbf{v} \cdot \mathbf{n})^2 \right ] + \frac{1}{2} \left ( \frac{v}{c} \right ) ^2 \kappa_{0P} \left ( E - \frac{4 \pi B}{c} \right ) $)]]   
     154   [[latex($\mathbf{G} = -\lambda \nabla E + \kappa_{0P} \frac{\mathbf{v}}{c} \left ( E - \frac{4 \pi B}{c} \right ) - \frac{1}{2} \left ( \frac{v}{c} \right ) ^2 \lambda \nabla E + 2 \lambda \left ( \frac{\kappa_{0P}}{\kappa_{0R}} - 1 \right ) \frac{(\mathbf{v} \cdot \nabla E )\mathbf{v}}{c^2}$)]]   
    154155
    155156[[CollapsibleEnd()]]
     
    159160If we plug the expressions for the radiation 4-momentum back into the gas equations and keep terms necessary to maintain accuracy we get:
    160161
    161   [[latex(\frac{\partial }{\partial t} \left ( \rho \mathbf{v} \right ) + \nabla \cdot \left ( \rho \mathbf{vv} \right ) = -\nabla P\color{green}{-\lambda \nabla E})]]   
    162   [[latex(\frac{\partial e}{\partial t}  + \nabla \cdot \left [ \left ( e + P \right ) \mathbf{v} \right ] = \color{red}{-\kappa_{0P}(4 \pi B-cE)} \color{green}{+\lambda \left ( 2 \frac{\kappa_{0P}}{\kappa_{0R}}-1 \right ) \mathbf{v} \cdot \nabla E} \color{blue}{-\frac{3-R_2}{2}\kappa_{0P}\frac{v^2}{c}E})]] 
    163   [[latex(\frac{\partial E}{\partial t}  \color{red}{ - \nabla \cdot \frac{c\lambda}{\kappa_{0R}} \nabla E} = \color{red}{\kappa_{0P} (4 \pi B-cE)} \color{green}{-\lambda \left(2\frac{\kappa_{0P}}{\kappa_{0R}}-1 \right )\mathbf{v}\cdot \nabla E} \color{green}{-\nabla \cdot \left ( \frac{3-R_2}{2}\mathbf{v}E \right )} \color{blue}{+\frac{3-R_2}{2}\kappa_{0P}\frac{v^2}{c}E}  )]] 
    164 
    165 
    166 For static diffusion, the terms in blue with \(\frac{v^2}{c}\) can be dropped and the system can be split into the usual hydro update (black), radiative source terms (green), and a coupled implicit solve (red) for the radiation energy density and thermal energy density (ie temperature).
     162  [[latex($\frac{\partial }{\partial t} \left(\rho\mathbf{v}\right)+\nabla\cdot\left(\rho\mathbf{vv}\right)=\nabla P\color{green}{-\lambda \nabla E}$)]]
     163   
     164  [[latex($\frac{\partial e}{\partial t}  + \nabla \cdot \left [ \left ( e + P \right ) \mathbf{v} \right ] =\color{red{\kappa_{0P}(4 \pi B-cE)} \color{green}{+\lambda \left ( 2 \frac{\kappa_{0P}}{\kappa_{0R}}-1 \right)\mathbf{v}\cdot \nabla E} \color{blue}{-\frac{3-R_2}{2}\kappa_{0P}\frac{v^2}{c}E}$)]] 
     165  [[latex($\frac{\partial E}{\partial t}  \color{red}{ - \nabla \cdot \frac{c\lambda}{\kappa_{0R}} \nabla E}=\color{red}{\kappa_{0P} (4 \pi B-cE)} \color{green}{-\lambda \left(2\frac{\kappa_{0P}}{\kappa_{0R}}-1\right)\mathbf{v}\cdot \nabla E} \color{green}{-\nabla \cdot \left ( \frac{3-R_2}{2}\mathbf{v}E\right )}\color{blue}{+\frac{3-R_2}{2}\kappa_{0P}\frac{v^2}{c}E}  $)]] 
     166
     167
     168For static diffusion, the terms in blue with [[latex($\frac{v^2}{c}$)]] can be dropped and the system can be split into the usual hydro update (black), radiative source terms (green), and a coupled implicit solve (red) for the radiation energy density and thermal energy density (ie temperature).
    167169
    168170[[CollapsibleStart(Operator Splitting 1)]]
     
    172174In AstroBEAR this would look like:
    173175* Initialization
    174  * Prolongate, \(\rho\), \(\rho\mathbf{v}\), \(e\), \(E\), and \(\dot{E}^I\)
     176 * Prolongate, [[latex($\rho$)]], [[latex($\rho\mathbf{v}$)]], [[latex($e$)]], [[latex($E$)]], and [[latex($\dot{E}^I$)]]
    175177* Step 1
    176  * Overlap \(\rho\), \(\rho \mathbf{v} \) , \(e\), \(E\) and do physical BC's
    177  * Do IR which updates \(e_0\) and \(E_0\) using \(\rho_1\), \(e_1\), \(E_1\), and \(\dot{E}^I_1\)
    178  * Update \(E_{2\mbox{mbc}}\) using \(\dot{E}^I_{2\mbox{mbc}}\)
    179  * Update \(e_{2\mbox{mbc}}\) using \(E_{2\mbox{mbc}}\), \(\dot{E}^I_{2\mbox{mbc}}\), and \(e_{2\mbox{mbc}}\)
    180  * Update \(\dot{E}^I_0\) using pre IR and post IR \(E_0\)
    181  * Ghost \(e_{2\mbox{mbc}}\), \(E_{\mbox{mbc}+1}\), \(\dot{E}^I_{\mbox{mbc}+1}\)
     178 * Overlap [[latex($\rho$)]], [[latex($\rho \mathbf{v} $)]] , [[latex($e$)]], [[latex($E$)]] and do physical BC's
     179 * Do IR which updates [[latex($e_0$)]] and [[latex($E_0$)]] using [[latex($\rho_1$)]], [[latex($e_1$)]], [[latex($E_1$)]], and [[latex($\dot{E}^I_1$)]]
     180 * Update [[latex($E_{2\mbox{mbc}}$)]] using [[latex($\dot{E}^I_{2\mbox{mbc}}$)]]
     181 * Update [[latex($e_{2\mbox{mbc}}$)]] using [[latex($E_{2\mbox{mbc}}$)]], [[latex($\dot{E}^I_{2\mbox{mbc}}$)]], and [[latex($e_{2\mbox{mbc}}$)]]
     182 * Update [[latex($\dot{E}^I_0$)]] using pre IR and post IR [[latex($E_0$)]]
     183 * Ghost [[latex($e_{2\mbox{mbc}}$)]], [[latex($E_{\mbox{mbc}+1}$)]], [[latex($\dot{E}^I_{\mbox{mbc}+1}$)]]
    182184 * Do first EH,,mbc,,
    183  * Do ER,,mbc,, --- Terms with \(\nabla E\) can be done without ghosting since EH did not change \(E\).  The \(\nabla \cdot \mathbf{v}E\) term needs time centered face centered velocities which can be stored during the hydro update.
    184  * Store \(\dot{E}\) in child arrays to be prolongated
     185 * Do ER,,mbc,, --- Terms with [[latex($\nabla E$)]] can be done without ghosting since EH did not change [[latex($E$)]].  The [[latex($\nabla \cdot \mathbf{v}E$)]] term needs time centered face centered velocities which can be stored during the hydro update.
     186 * Store [[latex($\dot{E}$)]] in child arrays to be prolongated
    185187* Step 2
    186  * Overlap \(\rho\), \(\rho \mathbf{v} \) , \(e\), \(E\) and do physical BC's
    187  * Do IR which updates \(e_0\) and \(E_0\) using \(\rho_1\), \(e_1\), \(E_1\), and \(\dot{E}^I_1\)
    188  * Update \(\dot{E}^I_0\) using pre IR and post IR \(E_0\)
    189  * Update \(E_{1}\) using \(\dot{E}^I_{1}\)
    190  * Ghost \(e_{mbc}\), \(E_{1}\), \(\dot{E}^I_{1}\)
     188 * Overlap [[latex($\rho$)]], [[latex($\rho \mathbf{v} $)]] , [[latex($e$)]], [[latex($E$)]] and do physical BC's
     189 * Do IR which updates [[latex($e_0$)]] and [[latex($E_0$)]] using [[latex($\rho_1$)]], [[latex($e_1$)]], [[latex($E_1$)]], and [[latex($\dot{E}^I_1$)]]
     190 * Update [[latex($\dot{E}^I_0$)]] using pre IR and post IR [[latex($E_0$)]]
     191 * Update [[latex($E_{1}$)]] using [[latex($\dot{E}^I_{1}$)]]
     192 * Ghost [[latex($e_{mbc}$)]], [[latex($E_{1}$)]], [[latex($\dot{E}^I_{1}$)]]
    191193 * Do second EH,,0,,
    192  * Do ER,,mbc,, --- Terms with \(\nabla E\) can be done without ghosting since EH did not
    193  * Do ER,,0,, --- Terms with grad E can be done without ghosting since EH did not change \(E\).  The \(\nabla \cdot \mathbf{v}E\) term needs time centered face centered velocities which can be stored during the hydro update.
     194 * Do ER,,mbc,, --- Terms with [[latex($\nabla E$)]] can be done without ghosting since EH did not
     195 * Do ER,,0,, --- Terms with grad E can be done without ghosting since EH did not change [[latex($E$)]].  The [[latex($\nabla \cdot \mathbf{v}E$)]] term needs time centered face centered velocities which can be stored during the hydro update.
    194196
    195197[[CollapsibleEnd()]]
     
    199201The extra terms in the explicit update due to radiation energy are as follows:
    200202
    201  [[latex(\frac{\partial }{\partial t} \left ( \rho \mathbf{v} \right ) =-\lambda \nabla E)]]   
    202  [[latex(\frac{\partial e}{\partial t}  = \lambda \left ( 2 \frac{\kappa_{0P}}{\kappa_{0R}}-1 \right ) \mathbf{v} \cdot \nabla E )]] 
    203  [[latex(\frac{\partial E}{\partial t}  = -\lambda \left(2\frac{\kappa_{0P}}{\kappa_{0R}}-1 \right )\mathbf{v}\cdot \nabla E -\nabla \cdot \left ( \frac{3-R_2}{2}\mathbf{v}E \right ) )]] 
     203 [[latex($\frac{\partial }{\partial t} \left ( \rho \mathbf{v} \right ) =-\lambda \nabla E$)]]   
     204 [[latex($\frac{\partial e}{\partial t}  = \lambda \left ( 2 \frac{\kappa_{0P}}{\kappa_{0R}}-1 \right ) \mathbf{v} \cdot \nabla E $)]] 
     205 [[latex($\frac{\partial E}{\partial t}  = -\lambda \left(2\frac{\kappa_{0P}}{\kappa_{0R}}-1 \right )\mathbf{v}\cdot \nabla E -\nabla \cdot \left ( \frac{3-R_2}{2}\mathbf{v}E \right ) $)]] 
    204206
    205207These can be discretized as follows:
    206208
    207  [[latex(p^{n+1}_i=p^n_i - \frac{1}{2}\frac{\Delta t}{\Delta x} \lambda_{i} \left ( E^n_{i+1}-E^n_{i-1} \right ) )]]
    208 
    209  [[latex(e^{n+1}_i=e^n_i + \frac{1}{2}\frac{\Delta t}{\Delta x} \lambda_i \left ( 2 \frac{\kappa^n_{i,0P}}{\kappa^n_{i,0R}}-1 \right ) \left ( v^n_i \left ( E^n_{i+1}-E^n_{i-1} \right ) \right ) )]] 
    210 
    211  [[latex(E^{n+1}_i=E^n_i - \frac{\Delta t}{\Delta x} \left ( \frac{\lambda_i}{2} \left ( 2 \frac{\kappa^n_{i,0P}}{\kappa^n_{i,0R}}-1 \right ) \left ( v^n_i \left ( E^n_{i+1}-E^n_{i-1} \right ) \right ) + \left ( F_{i+1/2}-F_{i-1/2} \right ) \right ))]] 
     209 [[latex($p^{n+1}_i=p^n_i - \frac{1}{2}\frac{\Delta t}{\Delta x} \lambda_{i} \left ( E^n_{i+1}-E^n_{i-1} \right ) $)]]
     210
     211 [[latex($e^{n+1}_i=e^n_i + \frac{1}{2}\frac{\Delta t}{\Delta x} \lambda_i \left ( 2 \frac{\kappa^n_{i,0P}}{\kappa^n_{i,0R}}-1 \right ) \left ( v^n_i \left ( E^n_{i+1}-E^n_{i-1} \right ) \right ) $)]] 
     212
     213 [[latex($E^{n+1}_i=E^n_i - \frac{\Delta t}{\Delta x} \left ( \frac{\lambda_i}{2} \left ( 2 \frac{\kappa^n_{i,0P}}{\kappa^n_{i,0R}}-1 \right ) \left ( v^n_i \left ( E^n_{i+1}-E^n_{i-1} \right ) \right ) + \left ( F_{i+1/2}-F_{i-1/2} \right ) \right )$)]] 
    212214
    213215where
    214 [[latex(F_{i+1/2}=\frac{3-R_{2,i+1/2}}{8} \left(v_{i}^n+v_{i+1}^n \right ) \left ( E^n_i+E^n_{i+1} \right ) )]]
     216[[latex($F_{i+1/2}=\frac{3-R_{2,i+1/2}}{8} \left(v_{i}^n+v_{i+1}^n \right ) \left ( E^n_i+E^n_{i+1} \right ) $)]]
    215217
    216218where
    217219
    218 [[latex(R_{2,i+1/2} = \lambda_{i+1/2}+\lambda_{i+1/2}^2 R_{i+1/2}^2)]]
    219 and
    220 [[latex(R_{i+1/2} = \frac{\left | E^n_{i+1}-E^n_{i} \right | }{2 \kappa_{0R,i+1/2} \left ( E^n_i+E^n_{i+1} \right )})]]
    221 
    222 and
    223 [[latex(\lambda_{i+1/2} = \frac{1}{R_{i+1/2}} \left ( \coth R_{i+1/2} - \frac{1}{R_{i+1/2}} \right ) )]]
    224 
    225 and
    226 [[latex(\kappa_{0R,i+1/2} = \frac{\kappa^n_{0R,i}+\kappa^n_{0R,i+1}}{2} \mbox{ and } \lambda_{i+1/2} = \frac{1}{R_{i+1/2}} \left ( \coth R_{i+1/2} - \frac{1}{R_{i+1/2}} \right ) )]]
    227 
    228 and
    229 
    230 [[latex(\lambda_{i} = \frac{1}{R_{i}} \left ( \coth R_{i} - \frac{1}{R_{i}} \right ) )]]
    231 
    232 and
    233 [[latex(R_{i} = \frac{\left | E^n_{i+1}-E^n_{i-1} \right | }{2 \kappa_{0R,i} E^n_{i}})]]
     220[[latex($R_{2,i+1/2} = \lambda_{i+1/2}+\lambda_{i+1/2}^2 R_{i+1/2}^2$)]]
     221and
     222[[latex($R_{i+1/2} = \frac{\left | E^n_{i+1}-E^n_{i} \right | }{2 \kappa_{0R,i+1/2} \left ( E^n_i+E^n_{i+1} \right )}$)]]
     223
     224and
     225[[latex($\lambda_{i+1/2} = \frac{1}{R_{i+1/2}} \left ( \coth R_{i+1/2} - \frac{1}{R_{i+1/2}} \right ) $)]]
     226
     227and
     228[[latex($\kappa_{0R,i+1/2} = \frac{\kappa^n_{0R,i}+\kappa^n_{0R,i+1}}{2} \mbox{ and } \lambda_{i+1/2} = \frac{1}{R_{i+1/2}} \left ( \coth R_{i+1/2} - \frac{1}{R_{i+1/2}} \right ) $)]]
     229
     230and
     231
     232[[latex($\lambda_{i} = \frac{1}{R_{i}} \left ( \coth R_{i} - \frac{1}{R_{i}} \right ) $)]]
     233
     234and
     235[[latex($R_{i} = \frac{\left | E^n_{i+1}-E^n_{i-1} \right | }{2 \kappa_{0R,i} E^n_{i}}$)]]
    234236
    235237[[CollapsibleEnd()]]
     
    238240== Implicit Update 1 ==
    239241
    240 For now we will assume that \(\kappa_{0P}\) and \(\kappa_{0R}\) are constant over the implicit update and we will treat the energy as the total internal energy ignoring kinetic and magnetic contributions.  In this case we can solve the radiation energy equations:
    241 
    242    [[latex(\frac{\partial E}{\partial t} = \nabla \cdot \frac{c\lambda}{\kappa_{0R}} \nabla E + \kappa_{0P} (4 \pi B(T)-cE) = \nabla \cdot \mathbf{F} + \kappa_{0P} (4 \pi B(T)-cE))]]   
    243    [[latex(\frac{\partial e}{\partial t} = - \kappa_{0P} (4 \pi B(T)-cE))]]   
    244 
    245 where [[latex(\mathbf{F} = \frac{c\lambda}{\kappa_{0R}} \nabla E)]]
     242For now we will assume that [[latex($\kappa_{0P}$)]] and [[latex($\kappa_{0R}$)]] are constant over the implicit update and we will treat the energy as the total internal energy ignoring kinetic and magnetic contributions.  In this case we can solve the radiation energy equations:
     243
     244   [[latex($\frac{\partial E}{\partial t} = \nabla \cdot \frac{c\lambda}{\kappa_{0R}} \nabla E + \kappa_{0P} (4 \pi B(T)-cE) = \nabla \cdot \mathbf{F} + \kappa_{0P} (4 \pi B(T)-cE)$)]]   
     245   [[latex($\frac{\partial e}{\partial t} = - \kappa_{0P} (4 \pi B(T)-cE)$)]]   
     246
     247where [[latex($\mathbf{F} = \frac{c\lambda}{\kappa_{0R}} \nabla E$)]]
    246248
    247249=== Expanding about e,,0,, ===
    248250
    249 Of course even if the opacity is independent of energy and radiation energy, the above combined system of equations is still non-linear due to the dependence on Temperature of the Planck Function \(B(T)\)
    250 
    251 However we can expand the Plank Function about \(e_0\)
    252 
    253 [[latex(B(T) = B \left ( T_0+dT \right ) = B \left ( T_0 \right ) + \left . \frac{\partial B}{\partial T} \right | _{T_0} \frac{\partial T}{\partial e} de = \frac{c}{4 \pi} a_R \left ( T_0^4 + 4T_0^3\Gamma de \right ) = B_0 \left ( 1 + 4\Gamma \frac{e-e_0}{T_0} \right ) )]]
     251Of course even if the opacity is independent of energy and radiation energy, the above combined system of equations is still non-linear due to the dependence on Temperature of the Planck Function [[latex($B(T)$)]]
     252
     253However we can expand the Plank Function about [[latex($e_0$)]]
     254
     255[[latex($B(T) = B \left ( T_0+dT \right ) = B \left ( T_0 \right ) + \left . \frac{\partial B}{\partial T} \right | _{T_0} \frac{\partial T}{\partial e} de = \frac{c}{4 \pi} a_R \left ( T_0^4 + 4T_0^3\Gamma de \right ) = B_0 \left ( 1 + 4\Gamma \frac{e-e_0}{T_0} \right ) $)]]
    254256
    255257where
    256258
    257 [[latex(\Gamma = \frac{\partial T}{\partial e} = \frac{(\gamma-1)}{n k_B})]]
     259[[latex($\Gamma = \frac{\partial T}{\partial e} = \frac{(\gamma-1)}{n k_B}$)]]
    258260
    259261Then the system of equations becomes
    260262
    261    [[latex(\frac{\partial E}{\partial t} = \nabla \cdot \frac{c\lambda}{\kappa_{0R}} \nabla E + \kappa_{0P} \left [4 \pi B_0 \left ( 1 + 4\Gamma \frac{e-e_0}{T_0} \right )-cE \right ] )]]   
    262    [[latex(\frac{\partial e}{\partial t} = - \kappa_{0P} \left [ 4 \pi B_0 \left ( 1 + 4\Gamma \frac{e-e_0}{T_0} \right )-cE \right ] )]]   
    263 
    264 which will be accurate as long as \(\left | 4\Gamma \frac{e-e_0}{T_0} \right | < \xi << 1\) or \(\Delta e = \left | e-e_0 \right | < \xi \frac{T_0}{4 \Gamma}\)
     263   [[latex($\frac{\partial E}{\partial t} = \nabla \cdot \frac{c\lambda}{\kappa_{0R}} \nabla E + \kappa_{0P} \left [4 \pi B_0 \left ( 1 + 4\Gamma \frac{e-e_0}{T_0} \right )-cE \right ] $)]]   
     264   [[latex($\frac{\partial e}{\partial t} = - \kappa_{0P} \left [ 4 \pi B_0 \left ( 1 + 4\Gamma \frac{e-e_0}{T_0} \right )-cE \right ] $)]]   
     265
     266which will be accurate as long as [[latex($\left | 4\Gamma \frac{e-e_0}{T_0} \right | < \xi << 1$)]] or [[latex($\Delta e = \left | e-e_0 \right | < \xi \frac{T_0}{4 \Gamma}$)]]
    265267
    266268We can calculate the time scale for this to be true using the evolution equation for the energy density
    267269
    268 [[latex(\Delta e = \Delta t \kappa_{0P} \left | 4 \pi B_0 -cE \right | < \xi \frac{T_0}{4 \Gamma})]]
    269 
    270 which gives [[latex(\Delta t < \xi \frac{T_0}{4 \Gamma \kappa_{0P} \left | 4 \pi B_0 - cE \right | })]]
     270[[latex($\Delta e = \Delta t \kappa_{0P} \left | 4 \pi B_0 -cE \right | < \xi \frac{T_0}{4 \Gamma}$)]]
     271
     272which gives [[latex($\Delta t < \xi \frac{T_0}{4 \Gamma \kappa_{0P} \left | 4 \pi B_0 - cE \right | }$)]]
    271273
    272274
     
    275277We can now discretize the equations
    276278
    277    [[latex(E^{n+1}_i-E^{n}_i = \left [ \alpha_{i+1/2} \left ( E^{*}_{i+1}-E^{*}_{i} \right ) - \alpha_{i-1/2} \left ( E^{*}_{i}-E^{*}_{i-1} \right ) \right ] - \epsilon E^{*}_i  + \phi e^{*}_i  + \theta_i - \phi_i e^n_i) )]]   
    278    [[latex(e^{n+1}_i-e^{n}_i = \epsilon_i E^{*}_i  - \phi_i e^{*}_i  - \left(\theta_i-\phi_i e^n_i \right ) )]]   
     279   [[latex($E^{n+1}_i-E^{n}_i = \left [ \alpha_{i+1/2} \left ( E^{*}_{i+1}-E^{*}_{i} \right ) - \alpha_{i-1/2} \left ( E^{*}_{i}-E^{*}_{i-1} \right ) \right ] - \epsilon E^{*}_i  + \phi e^{*}_i  + \theta_i - \phi_i e^n_i) $)]]   
     280   [[latex($e^{n+1}_i-e^{n}_i = \epsilon_i E^{*}_i  - \phi_i e^{*}_i  - \left(\theta_i-\phi_i e^n_i \right ) $)]]   
    279281
    280282where the diffusion coefficient is given by
    281283
    282 [[latex(\alpha_{i+1/2}=\frac{\Delta t}{\Delta x^2}  \frac{c \lambda_{i+1/2}}{\kappa_{0R,i+1/2}} \mbox{ where } \kappa_{0R,i+1/2} = \frac{\kappa^n_{0R,i}+\kappa^n_{0R,i+1}}{2} \mbox{ and } \lambda_{i+1/2} = \frac{1}{R_{i+1/2}} \left ( \coth R_{i+1/2} - \frac{1}{R_{i+1/2}} \right ) )]]
     284[[latex($\alpha_{i+1/2}=\frac{\Delta t}{\Delta x^2}  \frac{c \lambda_{i+1/2}}{\kappa_{0R,i+1/2}} \mbox{ where } \kappa_{0R,i+1/2} = \frac{\kappa^n_{0R,i}+\kappa^n_{0R,i+1}}{2} \mbox{ and } \lambda_{i+1/2} = \frac{1}{R_{i+1/2}} \left ( \coth R_{i+1/2} - \frac{1}{R_{i+1/2}} \right ) $)]]
    283285and where
    284 [[latex(R_{i+1/2} = \frac{\left | E^n_{i+1}-E^n_{i} \right | }{2 \kappa_{0R,i+1/2} \left ( E^n_i+E^n_{i+1} \right )})]]
    285 
    286 
    287 and
    288 
    289 [[latex(\epsilon_i=c\Delta t \kappa_{0P,i})]]
     286[[latex($R_{i+1/2} = \frac{\left | E^n_{i+1}-E^n_{i} \right | }{2 \kappa_{0R,i+1/2} \left ( E^n_i+E^n_{i+1} \right )}$)]]
     287
     288
     289and
     290
     291[[latex($\epsilon_i=c\Delta t \kappa_{0P,i}$)]]
    290292
    291293represents the number of absorption/emissions during the time step
     
    294296and
    295297
    296 [[latex(\phi_i = \epsilon_i \frac{4 \pi}{c} B \left ( T^n_i \right ) \left ( \frac{4\Gamma}{T^n_i} \right ) )]]
    297 
    298 [[latex(\theta_i = \epsilon_i \frac{4 \pi}{c} B \left ( T^n_i \right ) )]]
     298[[latex($\phi_i = \epsilon_i \frac{4 \pi}{c} B \left ( T^n_i \right ) \left ( \frac{4\Gamma}{T^n_i} \right ) $)]]
     299
     300[[latex($\theta_i = \epsilon_i \frac{4 \pi}{c} B \left ( T^n_i \right ) $)]]
    299301
    300302
    301303and we can think of the radiative flux as
    302304
    303 [[latex(\frac{\Delta t}{\Delta x}\mathbf{F}_{i+1/2} = \alpha_{i+1/2} \left ( E^{*}_{i+1} - E^{*}_i \right ) )]]
     305[[latex($\frac{\Delta t}{\Delta x}\mathbf{F}_{i+1/2} = \alpha_{i+1/2} \left ( E^{*}_{i+1} - E^{*}_i \right ) $)]]
    304306
    305307=== Time Discretization ===
    306308
    307309Now all the terms on the right hand side that are linear in E or e have been written as E^*^ or e^*^ because there are different ways to approximate E^*^ (e^*^).  For Backward Euler we have
    308 [[latex(E^*_i = E^{n+1}_i)]]
     310[[latex($E^*_i = E^{n+1}_i$)]]
    309311and for Crank Nicholson we have
    310 [[latex(E^*_i = \frac{1}{2} \left ( E^{n+1}_i + E^n_i \right ) )]]
     312[[latex($E^*_i = \frac{1}{2} \left ( E^{n+1}_i + E^n_i \right ) $)]]
    311313or we can parameterize the solution
    312 [[latex(E^*_i = \psi E^{n+1}_i + \bar{\psi}E^n_i)]]
    313 where \(\bar{\psi} = 1-\psi\)
    314 
    315 Backward Euler has \(\psi=1\) and Crank Nicholson has \(\psi=1/2\)
    316 
    317 Forward Euler has \(\psi=0\)
     314[[latex($E^*_i = \psi E^{n+1}_i + \bar{\psi}E^n_i$)]]
     315where [[latex($\bar{\psi} = 1-\psi$)]]
     316
     317Backward Euler has [[latex($\psi=1$)]] and Crank Nicholson has [[latex($\psi=1/2$)]]
     318
     319Forward Euler has [[latex($\psi=0$)]]
    318320
    319321In any event in 1D we have the following matrix coefficients
    320322
    321    [[latex(\left [ 1 + \psi \left( \alpha_{i+1/2} + \alpha_{i-1/2} + \epsilon_i \right ) \right ] E^{n+1}_i - \left ( \psi \alpha_{i+1/2} \right ) E^{n+1}_{i+1} - \left ( \psi \alpha_{i-1/2} \right ) E^{n+1}_{i-1} - \left ( \psi \phi_i \right ) e^{n+1}_i=\left [ 1 - \bar{\psi} \left( \alpha_{i+1/2} + \alpha_{i-1/2} + \epsilon_i \right ) \right ] E^n_i + \left ( \bar{\psi} \alpha_{i+1/2} \right ) E^{n}_{i+1} + \left ( \bar{\psi} \alpha_{i-1/2} \right ) E^{n}_{i-1} - \psi\phi_i e^n_i + \theta_i)]]   
    322 
    323    [[latex(\left ( 1 +\psi \phi_i \right ) e^{n+1}_i - \left ( \psi \epsilon_i \right )E^{n+1}_i =\left ( 1 +\psi\phi_i \right ) e^n_i + \left ( \bar{\psi} \epsilon_i \right ) E^n_i-\theta_i )]]   
     323   [[latex($\left [ 1 + \psi \left( \alpha_{i+1/2} + \alpha_{i-1/2} + \epsilon_i \right ) \right ] E^{n+1}_i - \left ( \psi \alpha_{i+1/2} \right ) E^{n+1}_{i+1} - \left ( \psi \alpha_{i-1/2} \right ) E^{n+1}_{i-1} - \left ( \psi \phi_i \right ) e^{n+1}_i=\left [ 1 - \bar{\psi} \left( \alpha_{i+1/2} + \alpha_{i-1/2} + \epsilon_i \right ) \right ] E^n_i + \left ( \bar{\psi} \alpha_{i+1/2} \right ) E^{n}_{i+1} + \left ( \bar{\psi} \alpha_{i-1/2} \right ) E^{n}_{i-1} - \psi\phi_i e^n_i + \theta_i$)]]   
     324
     325   [[latex($\left ( 1 +\psi \phi_i \right ) e^{n+1}_i - \left ( \psi \epsilon_i \right )E^{n+1}_i =\left ( 1 +\psi\phi_i \right ) e^n_i + \left ( \bar{\psi} \epsilon_i \right ) E^n_i-\theta_i $)]]   
    324326
    325327
    326328Now since the second equation has no spatial dependence, we can solve it for
    327    [[latex(\color{purple}{e^{n+1}_i = e^n_i + \frac{1}{ 1 +\psi \phi_i}\left \{ \left ( \psi \epsilon_i \right )E^{n+1}_i + \left ( \bar{\psi} \epsilon_i \right ) E^n_i-\theta_i \right \}} )]]   
     329   [[latex($\color{purple}{e^{n+1}_i = e^n_i + \frac{1}{ 1 +\psi \phi_i}\left \{ \left ( \psi \epsilon_i \right)E^{n+1}_i + \left ( \bar{\psi} \epsilon_i \right ) E^n_i-\theta_i \right \}}$)]]   
    328330
    329331and plug the result into the first equation to get a matrix equation involving only one variable.
    330332
    331    [[latex(\color{purple}{\left [ 1 + \psi \left( \alpha_{i+1/2} + \alpha_{i-1/2} + \frac{\epsilon_i}{ 1 +\psi \phi_i}\right ) \right ] E^{n+1}_i - \left ( \psi \alpha_{i+1/2} \right ) E^{n+1}_{i+1} - \left ( \psi \alpha_{i-1/2} \right ) E^{n+1}_{i-1} =\left [ 1 - \bar{\psi} \left( \alpha_{i+1/2} + \alpha_{i-1/2}  +\frac{\epsilon_i }{ 1 +\psi \phi_i} \right ) \right ] E^n_i + \left ( \bar{\psi} \alpha_{i+1/2} \right ) E^{n}_{i+1} + \left ( \bar{\psi} \alpha_{i-1/2} \right ) E^{n}_{i-1} + \frac{\theta_i}{ 1 +\psi \phi_i}})]]   
     333   [[latex($\color{purple}{\left [ 1 + \psi \left( \alpha_{i+1/2} + \alpha_{i-1/2} + \frac{\epsilon_i}{ 1 +\psi \phi_i}\right ) \right ] E^{n+1}_i - \left ( \psi \alpha_{i+1/2} \right ) E^{n+1}_{i+1} - \left ( \psi \alpha_{i-1/2} \right ) E^{n+1}_{i-1} =\left [ 1 - \bar{\psi} \left( \alpha_{i+1/2} + \alpha_{i-1/2}  +\frac{\epsilon_i }{ 1 +\psi \phi_i} \right ) \right ] E^n_i + \left ( \bar{\psi} \alpha_{i+1/2} \right ) E^{n}_{i+1} + \left ( \bar{\psi} \alpha_{i-1/2} \right ) E^{n}_{i-1} + \frac{\theta_i}{ 1 +\psi \phi_i}}$)]]   
    332334
    333335
     
    343345For the initial solution vector, we can just use Edot from the parent update (or last time step if we are on the coarse grid) to guess E, and then we can solve for the new e given our guess at the new E using the same time stepping (Backward Euler, Crank Nicholson, etc...).
    344346
    345 [[latex(E^{n+1}_i = E^{n}_i+\dot{E}^{I}_i \Delta t)]]
    346 [[latex(e^{n+1}_i = e^n_i + \frac{1}{1+\psi \phi_i} \left \{ \left ( \psi \epsilon_i \right )E^{n+1}_i + \left ( \bar{\psi} \epsilon_i \right ) E^n_i-\theta_i \right \} )]]
     347[[latex($E^{n+1}_i = E^{n}_i+\dot{E}^{I}_i \Delta t$)]]
     348[[latex($e^{n+1}_i = e^n_i + \frac{1}{1+\psi \phi_i} \left \{ \left ( \psi \epsilon_i \right )E^{n+1}_i + \left ( \bar{\psi} \epsilon_i \right ) E^n_i-\theta_i \right \} $)]]
    347349
    348350== Coarse-Fine Boundaries ==
     
    356358=== Open (Free streaming) boundaries ===
    357359We would like the radiation to leave at the free streaming limit.  So
    358 [[latex(\frac{c \lambda}{\kappa_{0R}} \nabla E = \mathbf{F} = cE\mathbf{n} = \frac{c \lambda_g}{\kappa_g}\frac{ \left ( E-E_g \right ) }{\Delta x})]]
    359 
    360 Clearly if we set \(E_g = 0\) and \(\lambda_g =\kappa_g \Delta x\) we should get the correct flux.
     360[[latex($\frac{c \lambda}{\kappa_{0R}} \nabla E = \mathbf{F} = cE\mathbf{n} = \frac{c \lambda_g}{\kappa_g}\frac{ \left ( E-E_g \right ) }{\Delta x}$)]]
     361
     362Clearly if we set [[latex($E_g = 0$)]] and [[latex($\lambda_g =\kappa_g \Delta x$)]] we should get the correct flux.
    361363
    362364This corresponds to an
    363 \(\alpha = c \frac{\Delta t}{\Delta x}\)
    364 
    365 So we would just modify \(\alpha\) and zero out the matrix coefficient to the ghost zone
     365[[latex($\alpha = c \frac{\Delta t}{\Delta x}$)]]
     366
     367So we would just modify [[latex($\alpha$)]] and zero out the matrix coefficient to the ghost zone
    366368
    367369=== Constant Slope Boundary ===
    368 Here we want the flux to be constant so energy does not pile up near the boundary.  If we cancel all derivative terms on both sides of the cell, this will effectively match the incoming flux with the outgoing flux.  This can also be done by setting \(\alpha_g = \alpha_i = 0\)
     370Here we want the flux to be constant so energy does not pile up near the boundary.  If we cancel all derivative terms on both sides of the cell, this will effectively match the incoming flux with the outgoing flux.  This can also be done by setting [[latex($\alpha_g = \alpha_i = 0$)]]
    369371
    370372=== Periodic Boundary ===
     
    376378
    377379=== Reflecting/ZeroSlope Boundary ===
    378 Reflecting boundary should be fairly straightforward.  This an be achieved by setting \(\alpha_g = 0\) which zeros out any flux - and has the same effect as setting \(E^{*}_g=E^{*}_i\) or \(E^{n+1}_g=E^{n+1}_i \mbox{ and } E^{n}_g=E^{n}_i\)
     380Reflecting boundary should be fairly straightforward.  This an be achieved by setting [[latex($\alpha_g = 0$)]] which zeros out any flux - and has the same effect as setting [[latex($E^{*}_g=E^{*}_i$)]] or [[latex($E^{n+1}_g=E^{n+1}_i \mbox{ and } E^{n}_g=E^{n}_i$)]]
    379381
    380382=== Constant radiative flux ===
    381 To have a constant radiative flux we must zero out terms involving the gradient and just add \(F_0 \frac{\Delta t}{\Delta x}\) in the source vector
     383To have a constant radiative flux we must zero out terms involving the gradient and just add [[latex($F_0 \frac{\Delta t}{\Delta x}$)]] in the source vector
    382384
    383385=== Summary ===
    384386
    385 || Numerical value  ||  Boundary                  ||  [[latex(E^{n+1}_{i+1})]]        ||  [[latex(E^{n+1}_i)]]                         ||   [[latex(E^{n+1}_{i-1})]]                       ||  [[latex(S)]]
    386 ||  0               ||  RAD_FREE_STREAMING        ||  [[latex(0)]]                    ||  [[latex(\psi c \frac{\Delta t}{\Delta x})]]  ||  [[latex(-\psi\alpha_{i-1/2})]]  ||  [[latex(-\bar{\psi}c \frac{\Delta t}{\Delta x} E^n_i + \bar{\psi}\alpha_{i-1/2} \left ( E^n_{i-1}-E^n_i \right ))]]    ||
    387 ||  1               ||  RAD_EXTRAPOLATE_FLUX     ||  [[latex(0)]]                    ||  [[latex(0)]]                                 ||  [[latex(0)]]  ||  [[latex(0)]]    ||
    388 ||  2               ||  INTERNAL/PERIODIC         ||  [[latex(-\psi\alpha_{i+1/2})]]  ||  [[latex(\psi\alpha_{i+1/2})]]                ||  [[latex(-\psi\alpha_{i-1/2})]]  ||  [[latex(\bar{\psi}\alpha_{i+1/2} \left ( E^n_{i+1}-E^n_i \right ) + \bar{\psi}\alpha_{i-1/2} \left ( E^n_{i-1}-E^n_i \right ))]]  ||
    389 ||  3               ||  RAD_REFLECTING            ||  [[latex(0)]]                    ||  [[latex(0)]]                                 ||  [[latex(-\psi\alpha_{i-1/2})]]  ||  [[latex( \bar{\psi}\alpha_{i-1/2} \left ( E^n_{i-1}-E^n_i \right ))]]    ||
    390 ||  4               ||  RAD_USERDEFINED_BOUNDARY/AMR_BOUNDARY  ||  [[latex(0)]]       ||  [[latex(\psi\alpha_{i+1/2})]]                ||  [[latex(-\psi\alpha_{i-1/2})]]  ||   [[latex(\bar{\psi}\alpha_{i+1/2} \left ( E^n_{i+1}-E^n_i \right ) - \psi \alpha_{i+1/2} E^{n+1}_{i+1} + \bar{\psi}\alpha_{i-1/2} \left ( E^n_{i-1}-E^n_i \right ))]]   ||
    391 ||  5               ||  RAD_USERDEFINED_FLUX      ||  [[latex(0)]]                    ||  [[latex(0)]]                                 ||   [[latex(-\psi\alpha_{i-1/2})]]  ||    [[latex(F_0 \frac{\Delta t}{\Delta x} + \bar{\psi}\alpha_{i-1/2} \left ( E^n_{i-1}-E^n_i \right ))]]   ||
     387|| Numerical value  ||  Boundary                  ||  [[latex($E^{n+1}_{i+1}$)]]        ||  [[latex($E^{n+1}_i$)]]                         ||   [[latex($E^{n+1}_{i-1}$)]]                       ||  [[latex($S$)]]
     388||  0               ||  RAD_FREE_STREAMING        ||  [[latex($0$)]]                    ||  [[latex($\psi c \frac{\Delta t}{\Delta x}$)]]  ||  [[latex($-\psi\alpha_{i-1/2}$)]]  ||  [[latex($-\bar{\psi}c \frac{\Delta t}{\Delta x} E^n_i + \bar{\psi}\alpha_{i-1/2} \left ( E^n_{i-1}-E^n_i \right )$)]]    ||
     389||  1               ||  RAD_EXTRAPOLATE_FLUX     ||  [[latex($0$)]]                    ||  [[latex($0$)]]                                 ||  [[latex($0$)]]  ||  [[latex($0$)]]    ||
     390||  2               ||  INTERNAL/PERIODIC         ||  [[latex($-\psi\alpha_{i+1/2}$)]]  ||  [[latex($\psi\alpha_{i+1/2}$)]]                ||  [[latex($-\psi\alpha_{i-1/2}$)]]  ||  [[latex($\bar{\psi}\alpha_{i+1/2} \left ( E^n_{i+1}-E^n_i \right ) + \bar{\psi}\alpha_{i-1/2} \left ( E^n_{i-1}-E^n_i \right )$)]]  ||
     391||  3               ||  RAD_REFLECTING            ||  [[latex($0$)]]                    ||  [[latex($0$)]]                                 ||  [[latex($-\psi\alpha_{i-1/2}$)]]  ||  [[latex($ \bar{\psi}\alpha_{i-1/2} \left ( E^n_{i-1}-E^n_i \right )$)]]    ||
     392||  4               ||  RAD_USERDEFINED_BOUNDARY/AMR_BOUNDARY  ||  [[latex($0$)]]       ||  [[latex($\psi\alpha_{i+1/2}$)]]                ||  [[latex($-\psi\alpha_{i-1/2}$)]]  ||   [[latex($\bar{\psi}\alpha_{i+1/2} \left ( E^n_{i+1}-E^n_i \right ) - \psi \alpha_{i+1/2} E^{n+1}_{i+1} + \bar{\psi}\alpha_{i-1/2} \left ( E^n_{i-1}-E^n_i \right )$)]]   ||
     393||  5               ||  RAD_USERDEFINED_FLUX      ||  [[latex($0$)]]                    ||  [[latex($0$)]]                                 ||   [[latex($-\psi\alpha_{i-1/2}$)]]  ||    [[latex($F_0 \frac{\Delta t}{\Delta x} + \bar{\psi}\alpha_{i-1/2} \left ( E^n_{i-1}-E^n_i \right )$)]]   ||
    392394
    393395
     
    401403
    402404
    403   [[latex(\frac{\partial }{\partial t} \left ( \rho \mathbf{v} \right ) + \nabla \cdot \left ( \rho \mathbf{vv} \right ) = -\nabla P\color{green}{-\lambda \nabla E})]]   
    404   [[latex(\frac{\partial e}{\partial t}  + \nabla \cdot \left [ \left ( e + P \right ) \mathbf{v} \right ] = \color{red}{-\kappa_{0P}(4 \pi B-cE)} \color{magenta}{+\lambda \left ( 2 \frac{\kappa_{0P}}{\kappa_{0R}}-1 \right ) \mathbf{v} \cdot \nabla E} \color{magenta}{-\frac{3-R_2}{2}\kappa_{0P}\frac{v^2}{c}E})]] 
    405   [[latex(\frac{\partial E}{\partial t}  \color{red}{ - \nabla \cdot \frac{c\lambda}{\kappa_{0R}} \nabla E} = \color{red}{\kappa_{0P} (4 \pi B-cE)} \color{magenta}{-\lambda \left(2\frac{\kappa_{0P}}{\kappa_{0R}}-1 \right )\mathbf{v}\cdot \nabla E} \color{magenta}{-\nabla \cdot \left ( \frac{3-R_2}{2}\mathbf{v}E \right )} \color{magenta}{+\frac{3-R_2}{2}\kappa_{0P}\frac{v^2}{c}E}  )]] 
     405  [[latex($\frac{\partial }{\partial t} \left ( \rho \mathbf{v} \right ) + \nabla \cdot \left ( \rho \mathbf{vv} \right ) = -\nabla P\color{green}{-\lambda \nabla E}$)]]   
     406  [[latex($\frac{\partial e}{\partial t}  + \nabla \cdot \left [ \left ( e + P \right ) \mathbf{v} \right ] = \color{red}{-\kappa_{0P}(4 \pi B-cE)} \color{magenta}{+\lambda \left ( 2 \frac{\kappa_{0P}}{\kappa_{0R}}-1 \right ) \mathbf{v} \cdot \nabla E} \color{magenta}{-\frac{3-R_2}{2}\kappa_{0P}\frac{v^2}{c}E}$)]] 
     407  [[latex($\frac{\partial E}{\partial t}  \color{red}{ - \nabla \cdot \frac{c\lambda}{\kappa_{0R}} \nabla E} = \color{red}{\kappa_{0P} (4 \pi B-cE)} \color{magenta}{-\lambda \left(2\frac{\kappa_{0P}}{\kappa_{0R}}-1 \right )\mathbf{v}\cdot \nabla E} \color{magenta}{-\nabla \cdot \left ( \frac{3-R_2}{2}\mathbf{v}E \right )} \color{magenta}{+\frac{3-R_2}{2}\kappa_{0P}\frac{v^2}{c}E}  $)]] 
    406408
    407409It is possible that with included the terms in magenta in a semi-implicit method, the dynamic diffusion regime may be stable...  In any event, it costs very little to add all of the terms in magenta to the implicit solve (using the old velocity).  Then the momentum update can be done explicitly - though using a time centered radiation field.
     
    413415In AstroBEAR this would look like:
    414416* Initialization
    415  * Prolongate, \(\rho\), \(\rho\mathbf{v}\), \(e\), \(E\), and \(\dot{E}\)
     417 * Prolongate, [[latex($\rho$)]], [[latex($\rho\mathbf{v}$)]], [[latex($e$)]], [[latex($E$)]], and [[latex($\dot{E}$)]]
    416418* Step 1
    417  * Overlap \(\rho\), \(\rho \mathbf{v} \) , \(e\), \(E\) and do physical BC's
    418  * Do IR which updates \(e_0\) and \(E_0\) using \(\rho_1\), \(e_1\), \(E_1\), and \(\dot{E}_1\)
    419  * Update \(E_{2\mbox{mbc}}\) using \(\dot{E}_{2\mbox{mbc}}\)
    420  * Update \(e_{2\mbox{mbc}}\) using \(E_{2\mbox{mbc}}\), \(\dot{E}_{2\mbox{mbc}}\), and \(e_{2\mbox{mbc}}\)
    421  * Update \(\dot{E}_0\) using pre IR and post IR \(E_0\)
    422  * Ghost \(e_{2\mbox{mbc}}\), \(E_{\mbox{mbc}+1}\), \(\dot{E}_{\mbox{mbc}+1}\)
     419 * Overlap [[latex($\rho$)]], [[latex($\rho \mathbf{v} $)]] , [[latex($e$)]], [[latex($E$)]] and do physical BC's
     420 * Do IR which updates [[latex($e_0$)]] and [[latex($E_0$)]] using [[latex($\rho_1$)]], [[latex($e_1$)]], [[latex($E_1$)]], and [[latex($\dot{E}_1$)]]
     421 * Update [[latex($E_{2\mbox{mbc}}$)]] using [[latex($\dot{E}_{2\mbox{mbc}}$)]]
     422 * Update [[latex($e_{2\mbox{mbc}}$)]] using [[latex($E_{2\mbox{mbc}}$)]], [[latex($\dot{E}_{2\mbox{mbc}}$)]], and [[latex($e_{2\mbox{mbc}}$)]]
     423 * Update [[latex($\dot{E}_0$)]] using pre IR and post IR [[latex($E_0$)]]
     424 * Ghost [[latex($e_{2\mbox{mbc}}$)]], [[latex($E_{\mbox{mbc}+1}$)]], [[latex($\dot{E}_{\mbox{mbc}+1}$)]]
    423425 * Do first EH,,mbc,,
    424  * Do ER,,mbc,, --- Terms with \(\nabla E\) can be done without ghosting since EH did not change \(E\)
    425  * Store \(\dot{E}\) in child arrays to be prolongated
     426 * Do ER,,mbc,, --- Terms with [[latex($\nabla E$)]] can be done without ghosting since EH did not change [[latex($E$)]]
     427 * Store [[latex($\dot{E}$)]] in child arrays to be prolongated
    426428* Step 2
    427  * Overlap \(\rho\), \(\rho \mathbf{v} \) , \(e\), \(E\) and do physical BC's
    428  * Do IR which updates \(e_0\) and \(E_0\) using \(\rho_1\), \(e_1\), \(E_1\), and \(\dot{E}_1\)
    429  * Update \(\dot{E}_0\) using pre IR and post IR \(E_0\)
    430  * Update \(E_{1}\) using \(\dot{E}_{1}\)
    431  * Ghost \(e_{mbc}\), \(E_{1}\), \(\dot{E}_{1}\)
     429 * Overlap [[latex($\rho$)]], [[latex($\rho \mathbf{v} $)]] , [[latex($e$)]], [[latex($E$)]] and do physical BC's
     430 * Do IR which updates [[latex($e_0$)]] and [[latex($E_0$)]] using [[latex($\rho_1$)]], [[latex($e_1$)]], [[latex($E_1$)]], and [[latex($\dot{E}_1$)]]
     431 * Update [[latex($\dot{E}_0$)]] using pre IR and post IR [[latex($E_0$)]]
     432 * Update [[latex($E_{1}$)]] using [[latex($\dot{E}_{1}$)]]
     433 * Ghost [[latex($e_{mbc}$)]], [[latex($E_{1}$)]], [[latex($\dot{E}_{1}$)]]
    432434 * Do second EH,,0,,
    433  * Do ER,,0,, --- Terms with \(\nabla E\) can be done without ghosting since EH did not change \(E\)
     435 * Do ER,,0,, --- Terms with [[latex($\nabla E$)]] can be done without ghosting since EH did not change [[latex($E$)]]
    434436
    435437
     
    440442The extra terms in the explicit update due to radiation energy are as follows:
    441443
    442  [[latex(\frac{\partial }{\partial t} \left ( \rho \mathbf{v} \right ) =-\lambda \nabla E)]]   
     444 [[latex($\frac{\partial }{\partial t} \left ( \rho \mathbf{v} \right ) =-\lambda \nabla E$)]]   
    443445
    444446These can be discretized as follows:
    445447
    446  [[latex(p^{n+1}_i=p^n_i - \frac{1}{4}\frac{\Delta t}{\Delta x} \lambda_{i} \left ( \left ( E^{n}_{i+1}+E^{n+1}_{i+1} \right ) - \left ( E^n_{i-1}+E^{n+1}_{i-1} \right ) \right ) )]]
    447 
    448 [[latex(\lambda_{i} = \frac{1}{R_{i}} \left ( \coth R_{i} - \frac{1}{R_{i}} \right ) )]]
    449 
    450 and
    451 [[latex(R_{i} = \frac{\left | E^n_{i+1}-E^n_{i-1} \right | }{2 \kappa_{0R,i} E^n_{i}})]]
     448 [[latex($p^{n+1}_i=p^n_i - \frac{1}{4}\frac{\Delta t}{\Delta x} \lambda_{i} \left ( \left ( E^{n}_{i+1}+E^{n+1}_{i+1} \right ) - \left ( E^n_{i-1}+E^{n+1}_{i-1} \right ) \right ) $)]]
     449
     450[[latex($\lambda_{i} = \frac{1}{R_{i}} \left ( \coth R_{i} - \frac{1}{R_{i}} \right ) $)]]
     451
     452and
     453[[latex($R_{i} = \frac{\left | E^n_{i+1}-E^n_{i-1} \right | }{2 \kappa_{0R,i} E^n_{i}}$)]]
    452454
    453455[[CollapsibleEnd()]]
     
    456458== Implicit Update 2 ==
    457459
    458 For now we will assume that \(\kappa_{0P}\) and \(\kappa_{0R}\) are constant over the implicit update and we will treat the energy as the total internal energy ignoring kinetic and magnetic contributions.  In this case we can solve the radiation energy equations:
    459 
    460   [[latex(\frac{\partial e}{\partial t}  = -\kappa_{0P}(4 \pi B-cE) + \lambda \left ( 2 \frac{\kappa_{0P}}{\kappa_{0R}}-1 \right ) \mathbf{v} \cdot \nabla E -\frac{3-R_2}{2}\kappa_{0P}\frac{v^2}{c}E )]] 
    461   [[latex(\frac{\partial E}{\partial t} = \nabla \cdot \frac{c\lambda}{\kappa_{0R}} \nabla E + \kappa_{0P} (4 \pi B(T)-cE) -\lambda \left(2\frac{\kappa_{0P}}{\kappa_{0R}}-1 \right )\mathbf{v}\cdot \nabla E + \frac{3-R_2}{2}\kappa_{0P}\frac{v^2}{c}E -\nabla \cdot \left ( \frac{3-R_2}{2}\mathbf{v}E \right ) )]] 
     460For now we will assume that [[latex($\kappa_{0P}$)]] and [[latex($\kappa_{0R}$)]] are constant over the implicit update and we will treat the energy as the total internal energy ignoring kinetic and magnetic contributions.  In this case we can solve the radiation energy equations:
     461
     462  [[latex($\frac{\partial e}{\partial t}  = -\kappa_{0P}(4 \pi B-cE) + \lambda \left ( 2 \frac{\kappa_{0P}}{\kappa_{0R}}-1 \right ) \mathbf{v} \cdot \nabla E -\frac{3-R_2}{2}\kappa_{0P}\frac{v^2}{c}E $)]] 
     463  [[latex($\frac{\partial E}{\partial t} = \nabla \cdot \frac{c\lambda}{\kappa_{0R}} \nabla E + \kappa_{0P} (4 \pi B(T)-cE) -\lambda \left(2\frac{\kappa_{0P}}{\kappa_{0R}}-1 \right )\mathbf{v}\cdot \nabla E + \frac{3-R_2}{2}\kappa_{0P}\frac{v^2}{c}E -\nabla \cdot \left ( \frac{3-R_2}{2}\mathbf{v}E \right ) $)]] 
    462464
    463465which we can also write as
    464466
    465   [[latex(\frac{\partial e}{\partial t}  = f \left ( e \right ) + g \left ( E,\nabla E \right ) )]]
    466   [[latex(\frac{\partial E}{\partial t} = \nabla \cdot \frac{c\lambda}{\kappa_{0R}} \nabla E -\nabla \cdot \left ( \frac{3-R_2}{2}\mathbf{v}E  \right ) - f \left ( e \right ) - g \left (e,E, \nabla E \right )  )]] 
     467  [[latex($\frac{\partial e}{\partial t}  = f \left ( e \right ) + g \left ( E,\nabla E \right ) $)]]
     468  [[latex($\frac{\partial E}{\partial t} = \nabla \cdot \frac{c\lambda}{\kappa_{0R}} \nabla E -\nabla \cdot \left ( \frac{3-R_2}{2}\mathbf{v}E  \right ) - f \left ( e \right ) - g \left (e,E, \nabla E \right )  $)]] 
    467469  where
    468 [[latex( f \left ( e \right ) = -4 \pi \kappa_{0P} B(T(e)) )]]
     470[[latex($ f \left ( e \right ) = -4 \pi \kappa_{0P} B(T(e)) $)]]
    469471 and
    470   [[latex( g \left (e,E, \nabla E \right ) = \kappa_{0P}(cE) + \lambda \left ( 2 \frac{\kappa_{0P}}{\kappa_{0R}}-1 \right ) \mathbf{v} \cdot \nabla E -\frac{3-R_2}{2}\kappa_{0P}\frac{v^2}{c}E )]]
     472  [[latex($ g \left (e,E, \nabla E \right ) = \kappa_{0P}(cE) + \lambda \left ( 2 \frac{\kappa_{0P}}{\kappa_{0R}}-1 \right ) \mathbf{v} \cdot \nabla E -\frac{3-R_2}{2}\kappa_{0P}\frac{v^2}{c}E $)]]
    471473
    472474Now we can linearize f about e,,0,,
    473 [[latex( f \left ( e \right ) = f \left ( e_0 \right ) + \frac{\partial f}{\partial e} \left ( e - e_0 \right ) )]]
     475[[latex($ f \left ( e \right ) = f \left ( e_0 \right ) + \frac{\partial f}{\partial e} \left ( e - e_0 \right ) $)]]
    474476
    475477so that the first equation can be written as
    476478
    477   [[latex(\frac{\partial e}{\partial t}  =  f \left ( e_0 \right ) + g \left ( E,\nabla E \right )  +  \frac{\partial f}{\partial e} \left ( e - e_0 \right ) )]]
     479  [[latex($\frac{\partial e}{\partial t}  =  f \left ( e_0 \right ) + g \left ( E,\nabla E \right )  +  \frac{\partial f}{\partial e} \left ( e - e_0 \right ) $)]]
    478480
    479481and then discretized as
    480482
    481   [[latex(e^{n+1}_i-e^{n}_i = \Delta t  \left ( f \left ( e^n_i \right ) + g \left (E^*,\nabla E^* \right ) \right ) +  \psi \phi  e^n_i -  \psi \phi e^{n+1}_i )]]
     483  [[latex($e^{n+1}_i-e^{n}_i = \Delta t  \left ( f \left ( e^n_i \right ) + g \left (E^*,\nabla E^* \right ) \right ) +  \psi \phi  e^n_i -  \psi \phi e^{n+1}_i $)]]
    482484
    483485where
    484486
    485 [[latex(\phi = -\Delta t \frac{\partial f}{\partial e} = 4 \pi \kappa_{0P} \Delta t \frac{\partial B(T(e))}{\partial e})]]
     487[[latex($\phi = -\Delta t \frac{\partial f}{\partial e} = 4 \pi \kappa_{0P} \Delta t \frac{\partial B(T(e))}{\partial e}$)]]
    486488
    487489which can be solved for
    488 [[latex(e^{n+1}_i = e^{n}_i + \frac{\Delta t}{1 + \psi \phi} \left ( f \left ( e^n_i \right ) + g \left (E^*,\nabla E^* \right ) \right ) )]]
     490[[latex($e^{n+1}_i = e^{n}_i + \frac{\Delta t}{1 + \psi \phi} \left ( f \left ( e^n_i \right ) + g \left (E^*,\nabla E^* \right ) \right ) $)]]
    489491
    490492or
    491493
    492 [[latex(e^{n+1}_i = e^{n}_i + \frac{1}{1 + \psi \phi_i} \left ( -\theta_i + \epsilon_i E^*_i + \omega_{x,i} v^n_{x,i} \left ( E^*_{i+1}-E^*_{i-1} \right ) - \xi_i E^* \right ) )]]
     494[[latex($e^{n+1}_i = e^{n}_i + \frac{1}{1 + \psi \phi_i} \left ( -\theta_i + \epsilon_i E^*_i + \omega_{x,i} v^n_{x,i} \left ( E^*_{i+1}-E^*_{i-1} \right ) - \xi_i E^* \right ) $)]]
    493495
    494496
    495497Then if we take the semi-discretized equation for E
    496498
    497   [[latex(\frac{\partial E}{\partial t} = \nabla \cdot \frac{c \lambda}{\kappa_{0R}} \nabla E - \nabla \cdot \left ( \frac{3-R_2}{2} \mathbf{v} E \right ) - f \left ( e^n_i \right ) - g \left ( E, \nabla E \right ) - \frac{1}{\Delta t} \left ( \psi \phi_i  e^n_i -  \psi \phi_i e^{n+1}_i \right ) )]] 
     499  [[latex($\frac{\partial E}{\partial t} = \nabla \cdot \frac{c \lambda}{\kappa_{0R}} \nabla E - \nabla \cdot \left ( \frac{3-R_2}{2} \mathbf{v} E \right ) - f \left ( e^n_i \right ) - g \left ( E, \nabla E \right ) - \frac{1}{\Delta t} \left ( \psi \phi_i  e^n_i -  \psi \phi_i e^{n+1}_i \right ) $)]] 
    498500
    499501and then plugin the solution for e^n+1^,,i,, we get
    500502
    501   [[latex(\frac{\partial E}{\partial t} = \nabla \cdot \frac{c\lambda}{\kappa_{0R}} \nabla E -\nabla \cdot \left ( \frac{3-R_2}{2}\mathbf{v}E \right ) - f \left (e^n_i \right ) - g \left (E, \nabla E \right ) - \frac{1}{\Delta t} \left ( \psi \phi_i e^n_i - \psi \phi_i e^n_i - \frac{\psi \phi_i }{1+\psi \phi_i} \left ( f \left ( e^n_i \right ) + g \left (E,\nabla E \right ) \right ) \right ) )]] 
     503  [[latex($\frac{\partial E}{\partial t} = \nabla \cdot \frac{c\lambda}{\kappa_{0R}} \nabla E -\nabla \cdot \left ( \frac{3-R_2}{2}\mathbf{v}E \right ) - f \left (e^n_i \right ) - g \left (E, \nabla E \right ) - \frac{1}{\Delta t} \left ( \psi \phi_i e^n_i - \psi \phi_i e^n_i - \frac{\psi \phi_i }{1+\psi \phi_i} \left ( f \left ( e^n_i \right ) + g \left (E,\nabla E \right ) \right ) \right ) $)]] 
    502504
    503505which simplifies to
    504506
    505   [[latex(\frac{\partial E}{\partial t} = \nabla \cdot \frac{c\lambda}{\kappa_{0R}} \nabla E -\nabla \cdot \left ( \frac{3-R_2}{2}\mathbf{v}E \right ) - \frac{1}{1+\psi \phi_i} \left ( f \left ( e^n_i \right ) + g \left ( E,\nabla E \right ) \right ) )]] 
    506 
    507 Now we have 1 equation with 1 variable that we can solve implicitly using hypre, and then we can use \(E^{n+1}\) and \(E^n\) to construct \(E^*\) which we can plug into the equation for \(e^{n+1}\)
     507  [[latex($\frac{\partial E}{\partial t} = \nabla \cdot \frac{c\lambda}{\kappa_{0R}} \nabla E -\nabla \cdot \left ( \frac{3-R_2}{2}\mathbf{v}E \right ) - \frac{1}{1+\psi \phi_i} \left ( f \left ( e^n_i \right ) + g \left ( E,\nabla E \right ) \right ) $)]] 
     508
     509Now we have 1 equation with 1 variable that we can solve implicitly using hypre, and then we can use [[latex($E^{n+1}$)]] and [[latex($E^n$)]] to construct [[latex($E^*$)]] which we can plug into the equation for [[latex($e^{n+1}$)]]
    508510
    509511
     
    512514Expanding
    513515
    514 [[latex(B(T(e)) = B \left ( T_0+dT(e) \right ) = B \left ( T_0 \right ) + \left . \frac{\partial B}{\partial T} \right | _{T_0} \frac{\partial T}{\partial e} de = \frac{c}{4 \pi} a_R \left ( T_0^4 + 4T_0^3\Gamma de \right ) = B_0 \left ( 1 + 4\Gamma \frac{e-e_0}{T_0} \right ) )]]
     516[[latex($B(T(e)) = B \left ( T_0+dT(e) \right ) = B \left ( T_0 \right ) + \left . \frac{\partial B}{\partial T} \right | _{T_0} \frac{\partial T}{\partial e} de = \frac{c}{4 \pi} a_R \left ( T_0^4 + 4T_0^3\Gamma de \right ) = B_0 \left ( 1 + 4\Gamma \frac{e-e_0}{T_0} \right ) $)]]
    515517
    516518where
    517519
    518 [[latex(\Gamma = \frac{\partial T}{\partial e} = \frac{(\gamma-1)}{n k_B})]]
    519 
    520 and we can identify [[latex(\phi = -\Delta t \frac{\partial f}{\partial e} = 4 \pi \kappa_{0P} \Delta t \frac{\partial B}{\partial e} = 16 \pi \kappa_{0P} \Delta t B_0 \frac{\Gamma}{T_0})]]
     520[[latex($\Gamma = \frac{\partial T}{\partial e} = \frac{(\gamma-1)}{n k_B}$)]]
     521
     522and we can identify [[latex($\phi = -\Delta t \frac{\partial f}{\partial e} = 4 \pi \kappa_{0P} \Delta t \frac{\partial B}{\partial e} = 16 \pi \kappa_{0P} \Delta t B_0 \frac{\Gamma}{T_0}$)]]
    521523
    522524Then the equation for e becomes
    523525
    524    [[latex(\frac{\partial e}{\partial t} = - \kappa_{0P} \left [ 4 \pi B_0 \left ( 1 + 4\Gamma \frac{e-e_0}{T_0} \right )-cE \right ] + \lambda \left ( 2 \frac{\kappa_{0P}}{\kappa_{0R}}-1 \right ) \mathbf{v} \cdot \nabla E -\frac{3-R_2}{2}\kappa_{0P}\frac{v^2}{c}E)]]   
    525 
    526 which will be accurate as long as \(4\Gamma \frac{\left | e-e_0 \right | }{T_0} < \xi << 1\) or \(\left | \Delta e \right | = \left | e-e_0 \right | < \xi \frac{T_0}{4 \Gamma}\)
     526   [[latex($\frac{\partial e}{\partial t} = - \kappa_{0P} \left [ 4 \pi B_0 \left ( 1 + 4\Gamma \frac{e-e_0}{T_0} \right )-cE \right ] + \lambda \left ( 2 \frac{\kappa_{0P}}{\kappa_{0R}}-1 \right ) \mathbf{v} \cdot \nabla E -\frac{3-R_2}{2}\kappa_{0P}\frac{v^2}{c}E$)]]   
     527
     528which will be accurate as long as [[latex($4\Gamma \frac{\left | e-e_0 \right | }{T_0} < \xi << 1$)]] or [[latex($\left | \Delta e \right | = \left | e-e_0 \right | < \xi \frac{T_0}{4 \Gamma}$)]]
    527529
    528530We can calculate the time scale for this to be true using the evolution equation for the energy density
    529531
    530 [[latex(\left | e-e_0 \right | = \left | \Delta e \right | = \Delta t \left | \frac{\partial e}{\partial t} \right | < \xi \frac{T_0}{4 \Gamma})]]
    531 
    532 which gives [[latex(\Delta t < \xi \frac{T_0}{4 \Gamma \left | \frac{\partial e}{\partial t} \right | } = \xi \frac{T_0}{4 \Gamma \left | - \kappa_{0P} \left [ 4 \pi B_0 \left ( 1 + 4\Gamma \frac{e-e_0}{T_0} \right )-cE \right ] + \lambda \left ( 2 \frac{\kappa_{0P}}{\kappa_{0R}}-1 \right ) \mathbf{v} \cdot \nabla E -\frac{3-R_2}{2}\kappa_{0P}\frac{v^2}{c}E  \right | } )]]
     532[[latex($\left | e-e_0 \right | = \left | \Delta e \right | = \Delta t \left | \frac{\partial e}{\partial t} \right | < \xi \frac{T_0}{4 \Gamma}$)]]
     533
     534which gives [[latex($\Delta t < \xi \frac{T_0}{4 \Gamma \left | \frac{\partial e}{\partial t} \right | } = \xi \frac{T_0}{4 \Gamma \left | - \kappa_{0P} \left [ 4 \pi B_0 \left ( 1 + 4\Gamma \frac{e-e_0}{T_0} \right )-cE \right ] + \lambda \left ( 2 \frac{\kappa_{0P}}{\kappa_{0R}}-1 \right ) \mathbf{v} \cdot \nabla E -\frac{3-R_2}{2}\kappa_{0P}\frac{v^2}{c}E  \right | } $)]]
    533535
    534536or in discretized form
    535537
    536 [[latex(\Delta t < \xi \frac{\theta_i}{\phi_i \frac{1}{\Delta t} \left | \left ( -\theta_i + \epsilon_i E^*_i + \omega_{x,i} v^n_{x,i} \left ( E^*_{i+1}-E^*_{i-1} \right ) - \xi_i E^* \right ) \right |} )]]
     538[[latex($\Delta t < \xi \frac{\theta_i}{\phi_i \frac{1}{\Delta t} \left | \left ( -\theta_i + \epsilon_i E^*_i + \omega_{x,i} v^n_{x,i} \left ( E^*_{i+1}-E^*_{i-1} \right ) - \xi_i E^* \right ) \right |} $)]]
    537539
    538540
    539541=== Implicit Discretization 2 ===
    540542Now we can discretize
    541 [[latex(g(E*, \nabla E*) =  \kappa_{0P}cE^* + \lambda \left ( 2 \frac{\kappa_{0P}}{\kappa_{0R}}-1 \right ) \mathbf{v} \cdot \nabla E^* -\frac{3-R_2}{2}\kappa_{0P}\frac{v^2}{c}E^*)]]
     543[[latex($g(E*, \nabla E*) =  \kappa_{0P}cE^* + \lambda \left ( 2 \frac{\kappa_{0P}}{\kappa_{0R}}-1 \right ) \mathbf{v} \cdot \nabla E^* -\frac{3-R_2}{2}\kappa_{0P}\frac{v^2}{c}E^*$)]]
    542544
    543545as
    544546
    545 [[latex(g = \epsilon_i \left ( \psi E^{n+1}_i + \bar{\psi} E^n_i \right ) + \omega_{x,i} \left ( \psi E^{n+1}_{i+1} - \psi E^{n+1}_{i-1} + \bar{\psi} E^n_{i+1}- \bar{\psi} E^n_{i-1} \right ) - \xi_i \left ( \psi E^{n+1}_i + \bar{\psi} E^{n}_i \right ) )]]
     547[[latex($g = \epsilon_i \left ( \psi E^{n+1}_i + \bar{\psi} E^n_i \right ) + \omega_{x,i} \left ( \psi E^{n+1}_{i+1} - \psi E^{n+1}_{i-1} + \bar{\psi} E^n_{i+1}- \bar{\psi} E^n_{i-1} \right ) - \xi_i \left ( \psi E^{n+1}_i + \bar{\psi} E^{n}_i \right ) $)]]
    546548
    547549which along with the other terms gives
    548 {{{
    549 #!latex
     550[[latex($
    550551\begin{eqnarray}
    551552E^{n+1}_i-E^{n}_i & = & \left [ \alpha_{i+1/2} \left ( \psi E^{n+1}_{i+1} + \bar{\psi} E^{n}_{i+1}- \psi E^{n+1}_{i} - \bar{\psi} E^n_{i} \right ) - \alpha_{i-1/2} \left ( \psi  E^{n+1}_{i} + \bar{\psi} E^{n}_i - \psi E^{n+1}_{i-1} - \bar{\psi}E^{n}_{i-1} \right ) \right ] \\
     
    553554 & - & \frac{1}{1+\psi \phi_i}  \left [ - \theta_i  + \epsilon_i \left ( \psi E^{n+1}_i + \bar{\psi} E^n_i \right ) + \omega_{x,i} v^n_{x,i} \left ( \psi E^{n+1}_{i+1} + \bar{\psi} E^n_{i+1} - \psi E^{n+1}_{i-1} - \bar{\psi} E^n_{i-1} \right ) - \xi_i \left ( \psi E^{n+1}_i + \bar{\psi} E^{n}_i \right ) \right ] \\
    554555\end{eqnarray}
    555 }}}
     556$)]]
    556557
    557558where the diffusion coefficient is given by
    558559
    559 [[latex(\alpha_{i+1/2}=\frac{\Delta t}{\Delta x^2}  \frac{c \lambda_{i+1/2}}{\kappa_{0R,i+1/2}} )]] 
     560[[latex($\alpha_{i+1/2}=\frac{\Delta t}{\Delta x^2}  \frac{c \lambda_{i+1/2}}{\kappa_{0R,i+1/2}} $)]] 
    560561
    561562and where
    562563
    563 [[latex(\zeta_{i+1/2}= \frac{\Delta t}{\Delta x}\frac{3-R_{2,i+1/2}}{4} )]]
    564 
    565 and
    566 
    567 [[latex(\epsilon_i=c\Delta t \kappa_{0P,i})]]
    568 
    569 and
    570 
    571 [[latex(\phi_i = \Delta t 4 \pi \kappa_{0P,i} B \left ( T^n_i \right ) \left ( \frac{4\Gamma}{T^n_i} \right ) )]]
    572 
    573 and
    574 
    575 [[latex(\theta_i = - \Delta t f(e^n_i) =  \Delta t 4 \pi \kappa_{0P,i} B \left ( T^n_i \right ) )]]
    576 
    577 and
    578 
    579 [[latex(\omega_{x,i} = \frac{\lambda_{x,i} \Delta t}{\Delta x} \left ( \frac{\kappa_{0P,i}}{\kappa_{0R,i}}-\frac{1}{2} \right ))]]
    580 
    581 and
    582 
    583 [[latex(\xi_i = \Delta t \frac{3-R_{2,i}}{2}\kappa_{0P,i}\frac{v_i^2}{c} )]]
    584 and
    585 
    586 where [[latex( \kappa_{0R,i+1/2} = \frac{\kappa_{0R,i}+\kappa_{0R,i+1}}{2} )]]
    587 
    588 and
    589 
    590 [[latex(R_{i+1/2} = \frac{\left | E^n_{i+1}-E^n_{i} \right | }{2 \kappa_{0R,i+1/2} \left ( E^n_i+E^n_{i+1} \right )})]]
    591 
    592 and
    593 
    594 [[latex(\lambda_{i+1/2} = \frac{1}{R_{i+1/2}} \left ( \coth R_{i+1/2} - \frac{1}{R_{i+1/2}} \right ) )]]
    595 
    596 and
    597 
    598 [[latex(R_{2,i+1/2} = \lambda_{i+1/2}+\lambda_{i+1/2}^2 R_{i+1/2}^2)]]
    599 
    600 and
    601 
    602 
    603 [[latex(R_{i} = \frac{\left | E^n_{i+1}-E^n_{i-1} \right | }{2 \kappa_{0R,i} E^n_{i}})]]
    604 
    605 and
    606 
    607 [[latex(\lambda_{i} = \frac{1}{R_{i}} \left ( \coth R_{i} - \frac{1}{R_{i}} \right ) )]]
    608 
    609 and
    610 
    611 [[latex(R_{2,i} = \lambda_{i}+\lambda_{i}^2 R_{i}^2)]]
     564[[latex($\zeta_{i+1/2}= \frac{\Delta t}{\Delta x}\frac{3-R_{2,i+1/2}}{4} $)]]
     565
     566and
     567
     568[[latex($\epsilon_i=c\Delta t \kappa_{0P,i}$)]]
     569
     570and
     571
     572[[latex($\phi_i = \Delta t 4 \pi \kappa_{0P,i} B \left ( T^n_i \right ) \left ( \frac{4\Gamma}{T^n_i} \right ) $)]]
     573
     574and
     575
     576[[latex($\theta_i = - \Delta t f(e^n_i) =  \Delta t 4 \pi \kappa_{0P,i} B \left ( T^n_i \right ) $)]]
     577
     578and
     579
     580[[latex($\omega_{x,i} = \frac{\lambda_{x,i} \Delta t}{\Delta x} \left ( \frac{\kappa_{0P,i}}{\kappa_{0R,i}}-\frac{1}{2} \right )$)]]
     581
     582and
     583
     584[[latex($\xi_i = \Delta t \frac{3-R_{2,i}}{2}\kappa_{0P,i}\frac{v_i^2}{c} $)]]
     585and
     586
     587where [[latex($ \kappa_{0R,i+1/2} = \frac{\kappa_{0R,i}+\kappa_{0R,i+1}}{2} $)]]
     588
     589and
     590
     591[[latex($R_{i+1/2} = \frac{\left | E^n_{i+1}-E^n_{i} \right | }{2 \kappa_{0R,i+1/2} \left ( E^n_i+E^n_{i+1} \right )}$)]]
     592
     593and
     594
     595[[latex($\lambda_{i+1/2} = \frac{1}{R_{i+1/2}} \left ( \coth R_{i+1/2} - \frac{1}{R_{i+1/2}} \right ) $)]]
     596
     597and
     598
     599[[latex($R_{2,i+1/2} = \lambda_{i+1/2}+\lambda_{i+1/2}^2 R_{i+1/2}^2$)]]
     600
     601and
     602
     603
     604[[latex($R_{i} = \frac{\left | E^n_{i+1}-E^n_{i-1} \right | }{2 \kappa_{0R,i} E^n_{i}}$)]]
     605
     606and
     607
     608[[latex($\lambda_{i} = \frac{1}{R_{i}} \left ( \coth R_{i} - \frac{1}{R_{i}} \right ) $)]]
     609
     610and
     611
     612[[latex($R_{2,i} = \lambda_{i}+\lambda_{i}^2 R_{i}^2$)]]
    612613
    613614Which we can arrange into the following form
    614615
    615 {{{
    616 #!latex
     616[[latex($
    617617\begin{eqnarray}
    618618 & \left ( 1 + \psi \left ( \alpha_{i+1/2} +  \alpha_{i-1/2} + \zeta_{i+1/2} v^n_{x,i+1/2} - \zeta_{i-1/2} v^n_{x,i-1/2} + \frac{\epsilon_i - \xi_i}{1+\psi \phi_i} \right ) \right ) E^{n+1}_i   \\
     
    624624+ & \frac{\theta_i}{1+\psi \phi_i}   \\
    625625\end{eqnarray}
    626 }}}
     626$)]]
    627627
    628628=== 2D etc... ===
     
    633633=== Initial solution vector ===
    634634For the initial solution vector, we can just use Edot from the parent update (or last time step if we are on the coarse grid) to guess E
    635 [[latex(E^{n+1}_i = E^{n}_i+\dot{E}^{n}_i \Delta t)]]
     635[[latex($E^{n+1}_i = E^{n}_i+\dot{E}^{n}_i \Delta t$)]]
    636636
    637637== Coarse-Fine Boundaries ==
     
    642642
    643643== Physical Boundary Conditions ==
    644 For each boundary type we need to specify \(E^n_g, E^{n+1}_g, \kappa_g, \mbox { and } v_g\) in terms of other quantities (ie including E^n+1^_i).  The v,,g,, and kappa,,g,, terms should come from the hydro boundary conditions so we just need an equation for E^n^,,g,,
     644For each boundary type we need to specify [[latex($E^n_g, E^{n+1}_g, \kappa_g, \mbox { and } v_g$)]] in terms of other quantities (ie including E^n+1^_i).  The v,,g,, and kappa,,g,, terms should come from the hydro boundary conditions so we just need an equation for E^n^,,g,,
    645645
    646646
     
    648648We would like the radiation to leave at the free streaming limit.  But we could have to modify the opacity in the ghost zone to keep the radiation energy positive
    649649
    650 [[latex(\frac{c \lambda}{\kappa_{0R}} \nabla E = \mathbf{F} = cE\mathbf{n} = \frac{c \lambda_g}{\kappa_g}\frac{ \left ( E-E_g \right ) }{\Delta x})]]
    651 
    652 Clearly if we set \(E_g = 0\) and \(\kappa_g << \frac{1}{\Delta x} \) we should get \(\lambda = \kappa_g \Delta x\) and a free streaming flux of \(c E \mathbf{n}\)
     650[[latex($\frac{c \lambda}{\kappa_{0R}} \nabla E = \mathbf{F} = cE\mathbf{n} = \frac{c \lambda_g}{\kappa_g}\frac{ \left ( E-E_g \right ) }{\Delta x}$)]]
     651
     652Clearly if we set [[latex($E_g = 0$)]] and [[latex($\kappa_g << \frac{1}{\Delta x} $)]] we should get [[latex($\lambda = \kappa_g \Delta x$)]] and a free streaming flux of [[latex($c E \mathbf{n}$)]]
    653653
    654654which also corresponds to an
    655 \(\alpha = c \frac{\Delta t}{\Delta x}\)
     655[[latex($\alpha = c \frac{\Delta t}{\Delta x}$)]]
    656656
    657657=== Constant Slope Boundary ===
    658 [[latex(E_g = 2 E_i - E_{i+1})]]
     658[[latex($E_g = 2 E_i - E_{i+1}$)]]
    659659
    660660=== Periodic Boundary ===
     
    667667=== Reflecting/ZeroSlope Boundary ===
    668668
    669 [[latex(E_g = E_i)]]
     669[[latex($E_g = E_i$)]]
    670670
    671671=== Constant radiative flux ===
    672672
    673 [[latex(E_g = E_i - F_0 \frac{\kappa_g \Delta x}{c \lambda_g})]]
    674 
    675 [[CollapsibleEnd()]]
     673[[latex($E_g = E_i - F_0 \frac{\kappa_g \Delta x}{c \lambda_g}$)]]
     674
     675[[CollapsibleEnd()]]