wiki:u/johannjc/scratchpad

Version 16 (modified by Jonathan, 11 years ago) ( diff )

For backward euler we evaluate the RHS at time although we still have to linearize

or equivalently

Now to make the scheme 2nd order in time we can set and we get

Where we can identify the left and right coefficients as

and the center coefficient as

and the RHS left and right contributions

and the RHS source term contribution as

and finally in the code the values for and are negated:

    kx = (0.5*kappa1*dt_diff/(dx**2))
    CALL getTemp(Info,i,j,k,T)
    stencil_fixed(0) = -2.0*REAL(nDim,8)*kx*T(0)**ndiff
    DO l = 1, 2*nDim
       stencil_fixed(l) = kx*T(l)**ndiff
    END DO  
    source = ((ndiff-1.0)/(ndiff+1.0))*dot_product(T(0:2*nDim),stencil_fixed(0:2*nDim)) - T(0)*gamma7*Info%q(i,j,k,1)
    stencil_fixed(0) = stencil_fixed(0) - gamma7*Info%q(i,j,k,1)

also note that the equation is multipled by the mean molecular weight… which is why and

Note: See TracWiki for help on using the wiki.