Changes between Version 9 and Version 10 of u/ehansen/buildcode


Ignore:
Timestamp:
10/31/11 19:00:07 (13 years ago)
Author:
ehansen
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • u/ehansen/buildcode

    v9 v10  
    3030Where [[latex($\tilde{U}$)]] is the global solution as opposed to the local solution [[latex($U$)]].  However, we already know that the global solution can be written in terms of its fluxes.  You just use equation (1) with a specific control volume:
    3131
    32 [[latex($\int^{x_{i+\frac{1}{2}}}_{x_{i - \frac{1}{2}}} \tilde{U}(x,t^{n+1}) \ \mathrm{d}x = \int^{x_{i+\frac{1}{2}}}_{x_{i - \frac{1}{2}}} \tilde{U}(x,t^{n}) \ \mathrm{d}x \ + \ \int_{t^{n}}^{t^{n+1}}F(\tilde{U}(x_{i-\frac{1}{2}},t)) \ \mathrm{d}t \ - \ \int_{t^{n}}^{t^{n+1}} F(\tilde{U}(x_{i+\frac{1}{2}},t)) \ \mathrm{d}t \hspace{1 in} (3)$)]]
     32[[latex($\int^{x_{i+\frac{1}{2}}}_{x_{i - \frac{1}{2}}} \tilde{U}(x,t^{n+1}) \ \mathrm{d}x = \int^{x_{i+\frac{1}{2}}}_{x_{i - \frac{1}{2}}} \tilde{U}(x,t^{n}) \ \mathrm{d}x + \int_{t^{n}}^{t^{n+1}}F(\tilde{U}(x_{i-\frac{1}{2}},t)) \ \mathrm{d}t - \int_{t^{n}}^{t^{n+1}} F(\tilde{U}(x_{i+\frac{1}{2}},t)) \ \mathrm{d}t \hspace{1 in} (3)$)]]
    3333
    3434The trick is to write the global solution in terms of the local solution.  This can be done through a transformation of coordinates:
     
    3636[[latex($\tilde{U}(x,t) = U_{i+\frac{1}{2}}(\bar{x},\bar{t}) \hspace{1 in} (4)$)]]
    3737
    38 Where [[latex($\bar{x}=x-x_{i+\frac{1}{2}}$)]] and [[latex($\bar{t}=t-t^n$)]]
     38Where
    3939
     40[[latex($ \ \ \bar{x}=x-x_{i+\frac{1}{2}} \ \ \mathrm{and} \ \ \bar{t}=t-t^n \hspace{1 in} (5)$)]]
     41
     42Now we can combine (4) and (5) to get:
     43
     44[[latex($\tilde{U}((x_{i-\frac{1}{2}},t) = U_{i-\frac{1}{2}}(0) = constant \hspace{1 in} (6)$)]]
     45[[latex($\tilde{U}({x_{i+\frac{1}{2}},t) = U_{i+\frac{1}{2}}(0) = constant \hspace{1 in} (7)$)]]
     46
     47Substitute (6) and (7) into (3), and then that result into (2) gives:
     48
     49[[latex($U_{i}^{n+1} = \frac{1}{\Delta x} \int^{x_{i+\frac{1}{2}}}_{x_{i - \frac{1}{2}}} \tilde{U}(x,t^{n}) \ \mathrm{d}x + \frac{1}{\Delta x} \int_{t^{n}}^{t^{n+1}}F(U_{i-\frac{1}{2}}(0,t)) \ \mathrm{d}t - \frac{1}{\Delta x} \int_{t^{n}}^{t^{n+1}} F(U_{i+\frac{1}{2}}(0,t)) \ \mathrm{d}t \hspace{1 in} (8)$)]]
     50
     51Just looking at the right hand side of (8)...the first term can be rewritten just by using the definition of cell average that we defined in (2), and since the flux integrands are now constants, those integrals can be simplified.  The final equation reads:
     52
     53[[latex($U_{i}^{n+1}=U_{i}^{n}+\frac{\Delta t}{\Delta x}[F(U_{i-\frac{1}{2}}(0))-F(U_{{i+\frac{1}{2}}(0)) \hspace{1 in} (9)$)]]
    4054[[BR]]
    4155== Program Outline ==