Changes between Version 5 and Version 6 of u/johannjc/scratchpad


Ignore:
Timestamp:
08/12/13 17:22:25 (11 years ago)
Author:
Jonathan
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • u/johannjc/scratchpad

    v5 v6  
    1 {{{
    2 #!latex
    3 \[ \left [
    4 \begin{array}{c}
    5 \partial_t{\rho_1} \\
    6 \partial_t{v_1} \\
    7 \partial_{xx}{\phi_1} \\
    8 \end{array}
    9 \right ]
    10 =\left [
    11 \begin{array}{c}
    12 -\rho_0\partial_x v_1 \\
    13 -\frac{c_s^2}{\rho_0}\partial_x \rho_1 -\partial_x \phi_1 \\
    14 4 \pi G \rho_1
    15 \end{array}
    16 \right ] = \left [
    17 \begin{array}{ccc}
    18 0 & -\rho_0\partial_x & 0 \\
    19 -\frac{c_s^2}{\rho_0}\partial_x & 0 & -\partial_x \\
    20 4 \pi G & 0 & 0
    21 \end{array}
    22 \right ]
    23 \left [
    24 \begin{array}{c}
    25 \rho_1\\
    26 v_1 \\
    27 \phi_1 \\
    28 \end{array}
    29 \right ]
    30 \]
    31 \[
    32 \partial_t
    33 \left [
    34 \begin{array}{c}
    35 \rho_1 \\
    36 v_1 \\
    37 \end{array}
    38 \right ]
    39 =
    40 \left [
    41 \begin{array}{cc}
    42 0 & -ik\rho_0 \\
    43 -ik\frac{c_s^2}{\rho_0} + \frac{4 \pi i G}{k} &  0 \\
    44 \end{array}
    45 \right ]
    46 \left [
    47 \begin{array}{c}
    48 \rho_1\\
    49 v_1 \\
    50 \end{array}
    51 \right ]
    52 \]
     1So Marshak boundary conditions are mixed
    532
    54 which gives a characteristic equation
     3[[latex($\left . \left ( E-\frac{2}{3\kappa}\nabla{E} \right ) \right |_0 = \frac{4}{c} F$)]]
    554
    56 }}}
    57 [[latex($\lambda^2 + k^2 c_s^2 -4 \pi G \rho_0 = 0$)]]
     5If we discretize this equation we get (E_g is ghost zone, E_i is internal zone at left edge)
     6
     7[[latex($E_g + E_i - \frac{4}{3\kappa \Delta x} \left ( E_i - E_g \right ) = \frac{8}{c} F$)]]
     8
     9which we can solve for [[latex($E_g$)]] as
     10
     11[[latex($E_g = \frac{\left ( 1 - \frac{3\kappa \Delta x}{4} \right ) E_i + \frac{3\kappa \Delta x}{4} \left ( \frac{8}{c} F \right )}{1 + \frac{3 \kappa \Delta x}{4}}$)]]
    5812
    5913and we have
     14[[latex($E_g - E_i = \frac{\left ( -\frac{6\kappa \Delta x}{4} \right ) E_i + \frac{3\kappa \Delta x}{4} \left ( \frac{8}{c} F \right )}{1 + \frac{3 \kappa \Delta x}{4}}$)]]
    6015
    61 [[latex($\lambda = \pm \sqrt{4 \pi G \rho_0-k^2 c_s^2}$)]]
     16and
    6217
    63 with eigen vectors
     18[[latex($E_g + E_i = \frac{ 2 E_i + \frac{3\kappa \Delta x}{4} \left ( \frac{8}{c} F \right )}{1 + \frac{3 \kappa \Delta x}{4}}$)]]
    6419
    6520
    66 {{{
    67 #!latex
    68 \[
    69 \left [
    70 \begin{array}{c}
    71 k \rho_0 \\
    72 i \lambda
    73 \end{array}
    74 \right ]
    75 \]
    76 }}}
     21If we then plug this into the time evolution equation:
    7722
    78 So for stable waves we have [[latex($\lambda = i\omega$)]] where [[latex($\omega$)]] is real.  And there are two solutions...
     23[[latex($E^{n+1}_i-E^{n}_i = \alpha \left ( E_g^*-E_i^* \right )$)]]
    7924
    80 {{{
    81 #!latex
    82 \[
    83 \left [
    84 \begin{array}{c}
    85 \rho_1 \\
    86 v_1 \\
    87 \end{array}
    88 \right ]
    89 =
    90 \left [
    91 \begin{array}{c}
    92 d\rho e^{\pm i \omega t} e^{i k x} \\
    93 dv e^{\pm i \omega t} e^{i k x} \\
    94 \end{array}
    95 \right ]
    96 \]
    97 }}}
    98 where
     25we get
    9926
    100 {{{
    101 #!latex
    102 $dv = -\frac{\omega}{k}\frac{d\rho}{\rho}$
    103 }}}
     27[[latex($E^{n+1}_i-E^{n}_i = \alpha \left ( \frac{-\frac{6\kappa \Delta x}{4} E_i^* + \frac{3\kappa \Delta x}{4} \left ( \frac{8}{c} F \right )}{1 + \frac{3 \kappa \Delta x}{4}} \right )$)]]
    10428
    105 So if [[latex($\lambda=\omega$)]] where [[latex($\omega$)]] is real -  then we have two solutions as well.
    10629
    107 {{{
    108 #!latex
    109 \[
    110 \left [
    111 \begin{array}{c}
    112 \rho_1 \\
    113 v_1 \\
    114 \end{array}
    115 \right ]
    116 =
    117 \left [
    118 \begin{array}{c}
    119 d\rho e^{\pm \omega t} e^{i k x} \\
    120 dv e^{\pm \omega t} e^{i k x + i \pi} \\
    121 \end{array}
    122 \right ]
    123 \]
    124 }}}
     30where [[latex($E^* = \psi E^{n+1} + \bar{\psi} E^n$)]] is the time averaged energy and depends on the time stepping (crank-nicholson or forward euler)
     31
     32
     33and finally we arrive at
     34
     35[[latex($\left ( 1+\frac{2 \psi \alpha}{1+\frac{4}{3\kappa\Delta x}} \right ) E^{n+1}_i = \left ( 1-\frac{2 \bar{\psi} \alpha}{1+\frac{4}{3\kappa\Delta x}} \right )  E^{n}_i+ \frac{\frac{8\alpha}{c} F}{1+\frac{4}{3\kappa \Delta x}}$)]]
     36 
     37This is very similar to what we normally get   ie
     38
     39[[latex($\left ( 1+\psi \alpha \right ) E^{n+1}_i - \psi \alpha E^{n+1}_g = \left ( 1-\bar{\psi} \alpha \right )  E^{n}_i + \bar{\psi} \alpha E^{n}_g$)]]
     40
     41
     42and noting that [[latex($\alpha = \frac{c \Delta t}{3 \kappa \Delta x^2}$)]] for the limiter [[latex($\lambda=1/3$)]]
     43
     44or flux is just
     45
     46[[latex($F \frac{\Delta t}{\Delta x} \rightarrow F \frac{\Delta t}{\Delta x} \frac{2}{1+\frac{3\kappa\Delta x}{4}}$)]]
    12547
    12648
    12749
     50Note that [[latex($E^{n+1}_i = E^{n}_i$)]] for
    12851
     52
     53
     544 \alpha \psi