Changes between Version 145 and Version 146 of FluxLimitedDiffusion


Ignore:
Timestamp:
03/31/13 17:05:54 (12 years ago)
Author:
Jonathan
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • FluxLimitedDiffusion

    v145 v146  
    537537- & \left ( \psi \left (  \alpha^n_{i-1/2} - \zeta^n_{i-1/2} v^n_{x,i-1/2} + \frac{\omega v^n_x}{1-\psi \phi} \right ) \right ) E^{n+1}_{i-1}  \\
    538538= & \left ( 1 - \bar{\psi} \left ( \alpha^n_{i+1/2} + \alpha^n_{i-1/2} - \zeta^n_{i+1/2} v^n_{x,i+1/2} +  \zeta^n_{i-1/2} v^n_{x,i-1/2} + \frac{\epsilon - \xi}{1-\psi \phi} \right ) \right ) E^{n}_i  \\
    539 + & \left ( \bar{\psi} \left (  alpha^n_{i+1/2} + \zeta^n_{i+1/2} v^n_{x,i+1/2} - \frac{\omega v^n_x}{1-\psi \phi} \right ) \right ) E^{n}_{i+1}  \\
    540 + & \left ( \bar{\psi} \left (  alpha^n_{i-1/2} - \zeta^n_{i-1/2} v^n_{x,i-1/2} + \frac{\omega v^n_x}{1-\psi \phi} \right ) \right ) E^{n}_{i-1}  \\
     539+ & \left ( \bar{\psi} \left (  \alpha^n_{i+1/2} + \zeta^n_{i+1/2} v^n_{x,i+1/2} - \frac{\omega v^n_x}{1-\psi \phi} \right ) \right ) E^{n}_{i+1}  \\
     540+ & \left ( \bar{\psi} \left (  \alpha^n_{i-1/2} - \zeta^n_{i-1/2} v^n_{x,i-1/2} + \frac{\omega v^n_x}{1-\psi \phi} \right ) \right ) E^{n}_{i-1}  \\
    541541- & \frac{\theta}{1-\psi \phi}   \\
    542542\end{eqnarray}
    543543}}}
    544544
    545 
    546 Now since the second equation has no spatial dependence, we can solve it for
    547    [[latex(\color{purple}{e^{n+1}_i = \frac{1}{ 1 +\psi \phi^n_i}\left \{ \left ( \psi \epsilon^n_i \right )E^{n+1}_i + \left ( \psi \omega_i v_{x,i} \right ) E^{n+1}_{i+1} - \left ( \psi \omega_i v_{x,i} \right ) E^{n+1}_{i-1} + \left ( 1 - \bar{\psi}\phi^n_i \right ) e^n_i + \left ( \bar{\psi} \epsilon^n_i \right ) E^n_i-\theta^i_n + \bar{\psi} \omega_i v_{x,i}  \left ( E^{n}_{i+1}- E^{n}_{i-1} \right ) \right \}} )]]   
    548 
    549 and plug the result into the first equation to get a matrix equation involving only one variable.
    550 
    551    [[latex(\color{purple}{\left [ 1 + \psi \left( \alpha^n_{i+1/2} + \alpha^n_{i-1/2} + \frac{\epsilon^n_i}{ 1 +\psi \phi^n_i}\right ) \right ] E^{n+1}_i - \left ( \psi \left ( \alpha^n_{i+1/2}- \frac{\omega_i v_{x,i}}{1+\psi \phi^n_i} \right ) \right ) E^{n+1}_{i+1} - \left ( \psi \left ( \alpha^n_{i-1/2} + \frac{\omega_i v_{x,i}}{1+\psi \phi^n_i} \right ) \right ) E^{n+1}_{i-1} =\left [ 1 - \bar{\psi} \left( \alpha^n_{i+1/2} + \alpha^n_{i-1/2}  + \frac{\epsilon^n_i }{ 1 +\psi \phi^n_i} \right ) \right ] E^n_i + \left ( \bar{\psi} \left ( \alpha^n_{i+1/2} - \frac{\omega_i v_{x,i}}{1+\psi \phi^n_i} \right ) \right ) E^{n}_{i+1} + \left ( \bar{\psi} \left ( \alpha^n_{i-1/2} + \frac{\omega_i v_{x,i}}{1+\psi \phi^n_i} \right ) \right ) E^{n}_{i-1} + \frac{ \phi^n_i}{ 1 +\psi \phi^n_i}  e^n_i+ \frac{1}{ 1 +\psi \phi^n_i}\theta^i_n})]]   
    552 
    553 
    554545=== 2D etc... ===
    555546
    556 For 2D or 3D we have more connections to add to the matrix elements but it is very straight forward...  There will be additional alpha terms for each dimension - and the velocity components (v,,x,,) will change, but everything else stays the same.
     547For 2D or 3D we have more connections to add to the matrix elements but it is very straight forward...  There will be additional terms for each dimension - and the velocity components (v,,x,,) will change, but everything else stays the same.
    557548
    558549
    559550=== Initial solution vector ===
    560 For 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...).
    561 
     551For 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
    562552[[latex(E^{n+1}_i = E^{n}_i+\dot{E}^{n}_i \Delta t)]]
    563 [[latex(e^{n+1}_i = \frac{1}{1+\psi \phi^n_i} \left \{ \left ( \psi \epsilon^n_i \right )E^{n+1}_i + \left ( 1 - \bar{\psi}\phi^n_i \right ) e^n_i + \left ( \bar{\psi} \epsilon^n_i \right ) E^n_i-\theta^i_n \right \} )]]
    564553
    565554== Coarse-Fine Boundaries ==
     
    570559
    571560== Physical Boundary Conditions ==
     561For 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,,
     562
    572563
    573564=== Open (Free streaming) boundaries ===
    574 We would like the radiation to leave at the free streaming limit.  So
     565We 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
     566
    575567[[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})]]
    576568
    577 Clearly if we set [[latex(E_g = 0)]] and [[latex(\lambda_g =\kappa_g \Delta x)]] we should get the correct flux.
    578 
    579 This corresponds to an
     569Clearly 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})]]
     570
     571which also corresponds to an
    580572[[latex(\alpha = c \frac{\Delta t}{\Delta x})]]
    581573
    582 So we would just modify [[latex(\alpha)]] and zero out the matrix coefficient to the ghost zone
    583 
    584 
    585 
    586574=== Constant Slope Boundary ===
    587 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 [[latex(\alpha_g = \alpha_i = 0)]]
     575[[latex(E_g = 2 E_i - E_{i+1})]]
    588576
    589577=== Periodic Boundary ===
     
    595583
    596584=== Reflecting/ZeroSlope Boundary ===
    597 Reflecting 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)]]
     585
     586[[latex(E_g = E_i)]]
    598587
    599588=== Constant radiative flux ===
    600 To 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
    601 
    602 === Summary ===
    603 
    604 
    605 || Numerical value  ||  Boundary                  ||  [[latex(E^{n+1}_{i+1})]]        ||  [[latex(E^{n+1}_i)]]                         ||   [[latex(E^{n+1}_{i-1})]]                       ||  [[latex(S)]]
    606 ||  0               ||  RAD_FREE_STREAMING        ||  [[latex(\color{red}{0})]]                    ||  [[latex(\color{red}{\psi c \frac{\Delta t}{\Delta x}})]]  ||  [[latex(-\psi\alpha_{i-1/2})]]  ||  [[latex(\color{red}{-\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 ))]]    ||
    607 ||  1               ||  RAD_EXTRAPOLATE_FLUX     ||  [[latex(\color{red}{0})]]                    ||  [[latex(\color{red}{0})]]                                 ||  [[latex(\color{red}{0})]]  ||  [[latex(\color{red}{0})]]    ||
    608 ||  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 ))]]  ||
    609 ||  3               ||  RAD_REFLECTING            ||  [[latex(\color{red}{0})]]                    ||  [[latex(\color{red}{0})]]                                 ||  [[latex(-\psi\alpha_{i-1/2})]]  ||  [[latex( \bar{\psi}\alpha_{i-1/2} \left ( E^n_{i-1}-E^n_i \right ))]]    ||
    610 ||  4               ||  RAD_USERDEFINED_BOUNDARY/AMR_BOUNDARY  ||  [[latex(\color{red}{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 ) \color{red}{- \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 ))]]   ||
    611 ||  5               ||  RAD_USERDEFINED_FLUX      ||  [[latex(\color{red}{0})]]                    ||  [[latex(\color{red}{0})]]                                 ||   [[latex(-\psi\alpha_{i-1/2})]]  ||    [[latex(\color{red}{F_0 \frac{\Delta t}{\Delta x}} + \bar{\psi}\alpha_{i-1/2} \left ( E^n_{i-1}-E^n_i \right ))]]   ||
    612 
    613 
    614 
    615 And for the semi implicit term
    616 
    617 || Numerical value  ||  Boundary                  ||  [[latex(E^{n+1}_{i+1})]]        ||  [[latex(E^{n+1}_{i})]]        ||   [[latex(E^{n+1}_{i-1})]]     ||   [[latex(S)]]
    618 ||  0               ||  RAD_FREE_STREAMING        ||    [[latex(0)]]                    ||  [[latex(\frac{\psi \omega_i v_{x,i}}{1+\psi \phi^n_i}-\frac{\psi \epsilon^n_i \left ( 2 - \frac{\kappa_{0R,i}}{\kappa_{0P,i}} \right ) \frac{v_{x,i}}{c}}{1+\psi \phi^n_i})]]  ||  [[latex(-\frac{\psi\omega_i v_{x,i}}{1+\psi \phi^n_i})]]  || [[latex(-\frac{\bar{\psi}\omega_i v_{x,i}}{1+\psi \phi^n_i} \left ( E^n_{i}-E^n_{i-1} \right ) + \frac{\bar{\psi} \epsilon^n_i \left ( 2 - \frac{\kappa_{0R,i}}{\kappa_{0P,i}} \right ) \frac{v_{x,i}}{c}}{1+\psi \phi^n_i} E^n_i)]]  ||
    619 ||  1               ||  RAD_EXTRAPOLATE_FLUX*     ||  [[latex(0)]]  ||  [[latex(2\frac{\psi\omega_i v_{x,i}}{1+\psi \phi^n_i})]]  ||  [[latex(-2\frac{\psi\omega_i v_{x,i}}{1+\psi \phi^n_i})]]  ||  [[latex(-2\frac{\bar{\psi}\omega_i v_{x,i}}{1+\psi \phi^n_i} \left ( E^n_{i}-E^n_{i-1} \right ))]]  ||
    620 ||  2               ||  INTERNAL/PERIODIC         ||  [[latex(\frac{\psi\omega_i v_{x,i}}{1+\psi \phi^n_i})]]  ||  [[latex(0)]]  ||  [[latex(-\frac{\psi\omega_i v_{x,i}}{1+\psi \phi^n_i})]]  ||  [[latex(-\frac{\bar{\psi}\omega_i v_{x,i}}{1+\psi \phi^n_i} \left ( E^n_{i+1}-E^n_{i-1} \right ))]]  ||
    621 ||  3               ||  RAD_REFLECTING            ||  [[latex(0)]]                    ||  [[latex(\frac{\psi\omega_i v_{x,i}}{1+\psi \phi^n_i})]]  ||  [[latex(-\frac{\psi\omega_i v_{x,i}}{1+\psi \phi^n_i})]]  || [[latex(-\frac{\bar{\psi}\omega_i v_{x,i}}{1+\psi \phi^n_i} \left ( E^n_{i}-E^n_{i-1} \right ))]]  ||
    622 ||  4               ||  RAD_USERDEFINED_BOUNDARY/AMR_BOUNDARY  ||  [[latex(0)]]       ||   [[latex(0)]]   ||   [[latex(-\frac{\psi\omega_i v_{x,i}}{1+\psi \phi^n_i})]]  ||  [[latex(-\frac{\bar{\psi}\omega_i v_{x,i}}{1+\psi \phi^n_i} \left ( E^n_{i+1}-E^n_{i-1} \right )  - \frac{\psi\omega_i v_{x,i}}{1+\psi \phi^n_i} E^{n+1}_{i+1})]]   ||
    623 ||  5               ||  RAD_USERDEFINED_FLUX      ||  [[latex(0)]]                    ||  [[latex(\frac{\psi\omega_i v_{x,i}}{1+\psi \phi^n_i})]]  ||  [[latex(-\frac{\psi\omega_i v_{x,i}}{1+\psi \phi^n_i})]]  || [[latex(-\frac{\bar{\psi}\omega_i v_{x,i}}{1+\psi \phi^n_i} \left ( E^n_{i}-E^n_{i-1} \right ))]]  ||
    624 
    625 !* We can make the left boundary look like the right boundary by reflecting the domain in x.  Then we just swap every ,,i+1,, <-> ,,i-1,, and v,,x,, -> -v,,x,,
    626 
    627 [[CollapsibleEnd()]]
     589
     590[[latex(E_g = E_i - F_0 \frac{\kappa_g \Delta x}{c \lambda_g}
     591
     592[[CollapsibleEnd()]]