Changes between Version 2 and Version 3 of ThermalConduction


Ignore:
Timestamp:
01/16/14 11:27:05 (11 years ago)
Author:
Baowei Liu
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • ThermalConduction

    v2 v3  
    134134}}}
    135135
     136== If the right boundary is a zero-slope boundary, we have ==
     137[[latex($T_{i+1}^{j+1}=T_{i}^{j+1}$)]]
     138and
     139[[latex($T_{i+1}^{j}=T_{i}^{j}$)]]
     140
     141So now on the right boundary, the equation becomes
     142{{{
     143#!latex
     144\setcounter{equation} 4
     145\begin{eqnarray}
     146\rho_i c_v \left ( T_i^{j+1}-T_i^j \right ) & =  & \frac{\kappa \Delta t}{2 \Delta x^2}\left (- T_{i}^{j^n}  T_{i}^{j+1} + T_{i-1}^{j^n}  T_{i-1}^{j+1} \right ) \\
     147 & - & \frac{\left (n - 1 \right ) \kappa \Delta t}{ 2 \left ( n+ 1 \right ) \Delta x^2} \left (-  T_{i}^{j^{n+1}} + T_{i-1}^{j^{n+1}} \right ) 
     148\end{eqnarray}
     149}}}
     150And the coeeficients becomes
     151
     152[[latex($A_+ = 0 $)]]
     153
     154[[latex($A_-=-\frac{\kappa \Delta t}{2 \Delta x^2}T_{i-1}^{j^n} $)]]
     155
     156[[latex($A_0=\frac{\kappa \Delta t}{2 \Delta x^2}T_{i}^{j^n}T_{i}^{j+1}+ \rho c_v$)]]
     157
     158and the RHS left and right contributions
     159
     160[[latex($B_+=0 $)]]
     161
     162[[latex($B_-=-\frac{\left (n - 1 \right ) \kappa \Delta t}{ 2  \left ( n+ 1 \right ) \Delta x^2} T_{i\pm 1}^{j^{n+1}}$)]]
     163
     164[[latex($B_0=\frac{\left (n - 1 \right ) \kappa \Delta t}{ 2  \left ( n+ 1 \right ) \Delta x^2} T_{i}^{j^n}+\rho C_vT_{i}^{j}$)]]
     165
     166Again in AstroBEAR everything is negated
     167
     168This is accomplished by
     169
     170{{{
     171stencil_fixed(0) =stencil_fixed(0)+kx*info%q(iq(1),iq(2),iq(3),itemp)**ndiff ! store the stencil value to temp
     172!source = source -((ndiff-1.0)/(ndiff+1.0))*(stencil_fixed(p)*info%q(ip(1),ip(2),ip(3),itemp)-kx*info%q(iq(1),iq(2),iq(3),itemp)**(ndiff+1))
     173source = source -((ndiff-1.0)/(ndiff+1.0))*(stencil_fixed(p)*info%q(ip(1),ip(2),ip(3),itemp)+kx*info%q(iq(1),iq(2),iq(3),itemp)**(ndiff+1))
     174stencil_fixed(p) = 0.0 ! zero out the stencil
     175}}}
     176
     177where the commented out line is the old-version which got the sign before the "kx" wrong.
     178
    136179== Limiting case ==
    137180