Changes between Version 7 and Version 8 of ThermalConduction
- Timestamp:
- 08/15/16 13:24:22 (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ThermalConduction
v7 v8 174 174 So in summary we have 175 175 176 || $A$ || $\frac{ \kappa}{\rho c_v \left ( \lambda + 1 \right ) }$ ||176 || $A$ || $\frac{1}{\rho c_v \left ( \lambda + 1 \right ) }$ || 177 177 || $B_{ij} $ || $\kappa \delta{ij}$|| 178 178 || $C$ || $\left ( 1 - \phi \left ( \lambda+ 1 \right ) \right )$ || … … 182 182 183 183 ||$\alpha_0$ || $- \displaystyle \sum_{i} \frac{B_{\hat{i}} + B_{-\hat{i}}}{\Delta x^2}$ || 184 ||$\alpha_{\pm i}$ || $ \frac{ B_{\pm \hat{i}}}{\Delta x^2}$ ||184 ||$\alpha_{\pm i}$ || $ \frac{\kappa_{\pm \hat{i}}}{\Delta x^2}$ || 185 185 || $\alpha*_{\pm i \pm j}$ || $ 0$ || 186 186 … … 192 192 193 193 194 Now in the code, 195 || $ A =A$ ||196 || $ C= \frac{\Delta t A C}{\Delta x^2}$ ||197 || $ D= \frac{\Delta t A D}{\Delta x^2}$ ||194 Now in the code, $\kappa$ is assumed constant 195 || $\mbox{A} = \kappa A$ || 196 || $\mbox{C} = \frac{\Delta t A C}{\Delta x^2}$ || 197 || $\mbox{D} = \frac{\Delta t A D}{\Delta x^2}$ || 198 198 || $\mbox{Tlambda} = T_{\pm \hat{j}}^\lambda$ || 199 199 || $\mbox{T} = T_{\pm \hat{j}}$ || 200 200 || $\mbox{T0} = T $ || 201 201 || $\mbox{T0lambda} = T^{\lambda}$ || 202 203 And stencil(0) has the coefficient of $T_0'$, and stencil(1:2*ndim) has the coefficients of $T_{\pm \hat{j}}'$ and source has everything else. 204 205 206 207 208 Now if $\kappa$ is a constant, then we have 209 210 ||$\alpha_0$ || $- \displaystyle \sum_{i} \frac{2B}{\Delta x^2}$ || 211 ||$\alpha_{\pm i}$ || $ \frac{B}{\Delta x^2}$ || 212 || $\alpha*_{\pm i \pm j}$ || $ 0$ || 202 || $\mbox{alpha} = 1 $ || 203 204 205 And stencil(0) has the coefficient of $T_0'$, and stencil(1:2*ndim) has the coefficients of $T_{\pm \hat{j}}'$ and source has everything else. Note that the coefficients $\alpha_0$ has a term for $+\hat{i}$ and $-\hat{i}$ but the way the code is written, it loops over each neighbor and adds the contribution from $-\hat{i}$ and $+\hat{i}$ on separate iterations. 206 207 208 209 210 213 211 214 212