Changes between Version 21 and Version 22 of u/ehansen/buildcode


Ignore:
Timestamp:
11/01/11 13:01:39 (13 years ago)
Author:
ehansen
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • u/ehansen/buildcode

    v21 v22  
    3636=== 1.  Find the pressure and velocity in the star region ===
    3737This pressure is computed through an iteration scheme.  You start with a guess for the star pressure.  This can be found using approximate Riemann solvers.  Then, you calculate pressure functions to get a better value for the pressure.  If the difference between the guess pressure and better pressure is below some tolerance then you have found the star pressure.  If it is not below the tolerance, the better pressure becomes the new guess pressure and the process repeats.  The star velocity is then very straightforward, as it is computed directly from the star pressure.
    38 === 2.  Sampling the wave speed ===
    39 Now that we have the solution for the star region, we can get the solution everywhere.  This is done by sampling the wave speed S as opposed to sampling the position x.  There are essentially 10 possible solutions for any given S:
     38=== 2.  Sample the wave speed ===
     39Now that we have the solution for the star region, we can get the solution everywhere.  This is done by sampling the wave speed S as opposed to sampling the position x.  There are essentially 10 possible solutions for any given S.  Let W be a column matrix containing the correct values for the primitive variables.
    4040||= =||= Left side of contact discontinuity =||= Right side of contact discontinuity =||
    4141||=  Data =||= [[latex($W_L$)]] =||= [[latex($W_R$)]] =||
     
    4444||= Rarefaction Fan =||= [[latex($W_{L}^{FAN}$)]] =||= [[latex($W_{R}^{FAN}$)]] =||
    4545
    46 A sampling procedure involves checking several logical statements to determine which state S is in.
     46A sampling procedure involves checking several logical statements to determine which state S is in.  With the Riemann problem now solved, we have the correct values for the ''primitive'' variables.
    4747[[BR]]
    4848== Discretisation ==
     
    107107Where v is the particle velocity and a is the sound speed.  Like the boundary condition routine, the CFL condition routine must be called every time step since [[latex($S_{max}$)]] is not constant.
    108108
     109Now we have everything we need to write a hydro code.
     110
    109111[[BR]]
    110112== Program Outline ==
     
    117119   * Impose CFL condition to get appropriate time step
    118120   * Begin flux calculation procedure
    119       * Solve local Riemann problem
     121      * Solve local Riemann problem (primitive variable solution)
    120122      * Use solution from Riemann solver to compute fluxes
    121123      * Repeat flux calculation procedure until fluxes are computed for all cells
    122    * Use fluxes to update conserved variables
     124   * Use fluxes to update ''conserved'' variables
    123125   * Use updated conserved variables to update primitive variables
    124126   * Repeat time stepping procedure until final time is reached