Changes between Version 36 and Version 37 of u/bliu/pnfldiff
- Timestamp:
- 08/17/18 14:56:00 (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
u/bliu/pnfldiff
v36 v37 66 66 }}} 67 67 68 == Discretization == 68 == Discretization with Flux Limiter == 69 $ \frac{\partial n_{e}}{\partial t} + \nabla\cdot(\lambda n_{e} \bold{u}) = I-r $[[BR]] 70 where $\lambda$ is the flux limiter. 69 71 Discretize the equation of $n_{e}$ in the same way as [https://astrobear.pas.rochester.edu/trac/wiki/ThermalConduction Thermal Conduction] 70 72 71 $\partial_{t}n_{e} +\partial_{i}( n_{e}u_{i})=\partial_{i}J_{i}-r$73 $\partial_{t}n_{e} +\partial_{i}(\lambda n_{e}u_{i})=\partial_{i}J_{i}-r$ 72 74 73 75 Replace $n_{e}$ with $n_{e}^{*}$ where[[BR]] … … 76 78 $\Phi=1$ for backward Euler, $\Phi=1/2$ for Crank Nicholson 77 79 78 $\partial_{t}n_{e} + u_{i}\partial_{i}n_{e}^{*}+n_{e}^{*}\partial_{i}u_{i}=\partial_{i}J_{i}-r$80 $\partial_{t}n_{e} +\lambda u_{i}\partial_{i}n_{e}^{*}+\lambda n_{e}^{*}\partial_{i}u_{i}=\partial_{i}J_{i}-r$ 79 81 80 82 $\partial_{t}n_{e}=\frac{n_{e}^{0\prime}-n_{e}^{0}}{\Delta t} $ 81 83 82 $- (1-\Phi)u_{i}\partial_{i}n_{e}=-(1-\Phi)u_{\hat{i}}\frac{n^{\hat{i}+1}_{e}-n^{\hat{i}-1}_{e}}{2\Delta x}$84 $-\lambda (1-\Phi)u_{i}\partial_{i}n_{e}=-\lambda(1-\Phi)u_{\hat{i}}\frac{n^{\hat{i}+1}_{e}-n^{\hat{i}-1}_{e}}{2\Delta x}$ 83 85 84 $-\ Phi u_{i}\partial_{i}n^{'}_{e}=-\Phi u_{\hat{i}}\frac{n^{'\hat{i}+1}_{e}-n^{'\hat{i}-1}_{e}}{2\Delta x}$86 $-\lambda \Phi u_{i}\partial_{i}n^{'}_{e}=-\lambda\Phi u_{\hat{i}}\frac{n^{'\hat{i}+1}_{e}-n^{'\hat{i}-1}_{e}}{2\Delta x}$ 85 87 86 $- (1-\Phi)n_{e}\partial_{i}u_{i}=-(1-\Phi)n_{e}^{0}\Sigma\frac{u_{\hat{i}+1}-u_{\hat{i}-1}}{2\Delta x}$88 $-\lambda (1-\Phi)n_{e}\partial_{i}u_{i}=-\lambda(1-\Phi)n_{e}^{0}\Sigma\frac{u_{\hat{i}+1}-u_{\hat{i}-1}}{2\Delta x}$ 87 89 88 $-\ Phi n_{e}^{'0}\partial_{i}u_{i}=-\Phi n_{e}^{'0}\Sigma\frac{u_{\hat{i}+1}-u_{\hat{i}-1}}{2\Delta x}$90 $-\lambda\Phi n_{e}^{'0}\partial_{i}u_{i}=-\lambda\Phi n_{e}^{'0}\Sigma\frac{u_{\hat{i}+1}-u_{\hat{i}-1}}{2\Delta x}$ 89 91 90 $n_{e}^{0}-(1-\Phi)\frac{\Delta t}{2\Delta x}\Sigma[n_{e}^{0}(u_{i+1}-u_{i-1})+u_{i}(n_{e}^{i+1}-n_{e}^{i-1})]=\\n_{e}^{'0}+\Phi\frac{\Delta t}{2\Delta x}\Sigma [n_{e}^{'0}(u_{i+1}-u_{i-1})+u_{i}(n_{e}^{'i+1}-n_{e}^{'i-1})]$ 91 92 == Flux limiting == 92 $n_{e}^{0}-\lambda(1-\Phi)\frac{\Delta t}{2\Delta x}\Sigma[n_{e}^{0}(u_{i+1}-u_{i-1})+u_{i}(n_{e}^{i+1}-n_{e}^{i-1})]=\\n_{e}^{'0}+\lambda\Phi\frac{\Delta t}{2\Delta x}\Sigma [n_{e}^{'0}(u_{i+1}-u_{i-1})+u_{i}(n_{e}^{'i+1}-n_{e}^{'i-1})]$ 93 93 94 94 … … 117 117 118 118 119 == related code==119 == Line transfer code/interface to AstroBEAR == 120 120 121 121 || tau || optical depth tau=sigmaH*nH + sigmad*nHII || ||