Changes between Version 3 and Version 4 of u/johannjc/scratchpad24


Ignore:
Timestamp:
03/22/17 12:30:01 (8 years ago)
Author:
Jonathan
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • u/johannjc/scratchpad24

    v3 v4  
    11== Tighter coupling of source terms with Corner Transport Upwind Scheme ==
    22
    3 Consider wave equation with a source term
     3=== 1D wave equation with source term ==
    44
    55$\frac{\partial q}{\partial t} = -\frac{\partial f(q)}{\partial x} + s(q)$
     
    2121
    2222Now the trick is how to calculate $Q_{L_{i+1/2}} = \displaystyle \frac{\int_{t^n}^{t^{n+1}} q_L(t) dt}{\Delta t} =  \displaystyle \frac{\int_{0}^{\Delta t} q_L(t) dt}{\Delta t} $
     23
     24
     25== Method of Characteristics ==
     26
     27If we operator split the source term from the hyperbolic term, and if the hyperbolic term is trivial
     28
     29 $f(q) = aq$
     30
     31where $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
     35which gives $x(t)=x-at$
     36
     37and $q(x,t) = q(x-at,0)$
     38
     39and 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
     47For the source term contribution to the time averaged interface state, things are a little tricky.  Imaging a constant source term $s(q)=b$
     48
     49Then 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
     53Now 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
     57There 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
     61where $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
     651.  Spatial reconstruction and averaging of solution over domain $\lambda \Delta t$ to get interface states
     662. Application of source term to interface states over $\Delta t/2$
     673. Calculate Fluxes from interface states
     684. Update Cells using those fluxes
     695. Calculate source term using time averaged cell center
     706. Update final states using source term for $\Delta t$
     71
     72
     73=== CTU ===
     74
     75
     76
     77
     78
     79=== PPM details ===
     80
     81In more general terms, we can write $\frac{\partial f}{\partial x} = \frac{\partial f}{\partial q} \frac {\partial q}{\partial x}$
     82
     83and we can estimate $\left . \frac{\partial f}{\partial q} \right | _0 = A$
     84
     85Now $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
     87and try to use characteristic tracing with $q(x,t)=q(x-\lambda_M t,0) + q'(x,t)$
     88
     89
     90
     91
     92
    2393
    2494We can use the midpoint rule to estimate