| 23 | |
| 24 | |
| 25 | == Method of Characteristics == |
| 26 | |
| 27 | If we operator split the source term from the hyperbolic term, and if the hyperbolic term is trivial |
| 28 | |
| 29 | $f(q) = aq$ |
| 30 | |
| 31 | where $a$ is a constant and via the method of characteristics |
| 32 | |
| 33 | $q(x,t)=q(x(t),0) \rightarrow \frac{\partial q}{\partial t}=\frac{\partial q}{\partial x} \frac{\partial x}{\partial t} =-a \frac{\partial q}{\partial x} \rightarrow \frac{\partial x}{\partial t}=-a$ |
| 34 | |
| 35 | which gives $x(t)=x-at$ |
| 36 | |
| 37 | and $q(x,t) = q(x-at,0)$ |
| 38 | |
| 39 | and the integral for $Q_{L_{i+1/2}}$ becomes |
| 40 | |
| 41 | $Q_{L_{i+1/2}} = \displaystyle \frac{\int_{0}^{\Delta t} q_L(t) dt}{\Delta t} = \displaystyle \frac{\int_{0}^{\Delta t} q(x_L,t) dt}{\Delta t}= \displaystyle \frac{\int_{0}^{\Delta t} q(x_L-at,0) dt}{\Delta t}$ |
| 42 | |
| 43 | $Q_{L_{i+1/2}} = \displaystyle \frac{\int_{x_L-a\Delta t}^{x_L} q(x',0) dx'}{a \Delta t}$ |
| 44 | |
| 45 | == Source term contribution == |
| 46 | |
| 47 | For the source term contribution to the time averaged interface state, things are a little tricky. Imaging a constant source term $s(q)=b$ |
| 48 | |
| 49 | Then the contribution to $q(x,t) = q(x,0)+bt$ and the time averaged value for $q$ would be |
| 50 | |
| 51 | $\frac{\displaystyle \int_0^{\Delta t} q(x_L,t') dt'}{\Delta t} = \frac{\displaystyle \int_0^{\Delta t} q(x_L,0)+bt' dt'}{\Delta t} = q(x_L,0) + \frac{1}{2} b \Delta t $ |
| 52 | |
| 53 | Now if we include the solution from characteristic tracing in our source term calculation, the first term just gives us the same spatial integration, however the second term is a double integral. |
| 54 | |
| 55 | $\frac{\displaystyle \int_0^{\Delta t} q(x_L,t') dt'}{\Delta t} = \frac{\displaystyle \int_0^{\Delta t} q(x_L-at',0) dt'+\int_0^{\Delta t} \int_0^{t'} s(q(x_L-at'',0)) dt'' dt'}{\Delta t} $ |
| 56 | |
| 57 | There are lots of ways to reduce this double integral into a single (or finite number) of source evaluations using any combination of midpoint rules or trapezoid rules. Ideally we would like to use our already calculated spatial integral which we can do by using the trapezoid rule on the outer integral and exchanging the source evaluation with the integral average. This gives |
| 58 | |
| 59 | $\frac{\int_0^{\Delta t} \int_0^{t'} s(q(x_L-at'',0)) dt'' dt'}{\Delta t} \approx \frac{1}{2} \int_0^{\Delta t} s(q(x_L-at'',0)) dt'' \approx \frac{1}{2} s \left ( \int_0^{\Delta t} q(x_L-at'',0) dt'' \right ) = \frac{1}{2} s \left( Q_{L_{i+1/2}}^* \right ) \Delta t $ |
| 60 | |
| 61 | where $Q_{L_{i+1/2}}^* = \displaystyle \frac{\int_{x_L-a\Delta t}^{x_L} q(x',0) dx'}{a \Delta t}$ |
| 62 | |
| 63 | === Summary of 1D === |
| 64 | |
| 65 | 1. Spatial reconstruction and averaging of solution over domain $\lambda \Delta t$ to get interface states |
| 66 | 2. Application of source term to interface states over $\Delta t/2$ |
| 67 | 3. Calculate Fluxes from interface states |
| 68 | 4. Update Cells using those fluxes |
| 69 | 5. Calculate source term using time averaged cell center |
| 70 | 6. Update final states using source term for $\Delta t$ |
| 71 | |
| 72 | |
| 73 | === CTU === |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | === PPM details === |
| 80 | |
| 81 | In more general terms, we can write $\frac{\partial f}{\partial x} = \frac{\partial f}{\partial q} \frac {\partial q}{\partial x}$ |
| 82 | |
| 83 | and we can estimate $\left . \frac{\partial f}{\partial q} \right | _0 = A$ |
| 84 | |
| 85 | Now $A = R \Lambda L$ and we can also add and subtract $\lambda_M I$ so that $\frac{\partial f}{\partial x} = \lambda_M \frac{\partial q}{\partial x} + R (\Lambda - \lambda_M I) L \frac{\partial q}{\partial x}$ |
| 86 | |
| 87 | and try to use characteristic tracing with $q(x,t)=q(x-\lambda_M t,0) + q'(x,t)$ |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |