pencil.calc.shocktube
Contains the classes containing the SOD analytic data
Classes
SodShock -- holds shock profiles and coordinate arrays |
Functions
|
Solve Sod shock tube for given parameters and resolution |
Module Contents
- pencil.calc.shocktube.sod(*args, **kwargs)
Solve Sod shock tube for given parameters and resolution
Signature:
- calc_shocktube(xarr, time, par=list(), lreference=False, DEBUG=False,
lplot=False, itplot=0, magic=[‘ee’,’tt’,’Ms’])
- Parameters:
*xarr* (Coordinate vector (the initial discontinuity is always at x=0))
*time* (Time after membrane snapped.)
*par* (Param object)
*lreference* (Use default parameters for Sod's reference problem.)
*DEBUG* (Flag to switch on output)
*lplot* (Plot first snapshot profiles)
*itplot* (Iteration index of snaphot to plot)
*magic* (Optional profiles to include in Sod object.)
- Return type:
Class containing coordinates and shock profiles
Notes
Adapted from IDL script shocktube.pro Analytical solution of the shocktube problem
Initial state (pressure jump)
- ——————+——————
pl | pr
- ——————+——————
0
Evolved state: membrane has snapped, four domains
x x x x 1 2 3 4
- Velocity
Nomenclature pl, pr - pressure far left/right from the shock structure p2 - pressure in the expansion wave p3=p4 - no pressure jump across the contact discontinuity p: pressure, T: temperature, rho: density, u: flow velocity, cs: sound speed
gamma (adiabatic index) is assumed to be constant
The borders between the different domains are x1, x2, x3, x4 and move at velocities ul-csl, u4-c4, u2, u3, u4, respectively.
Warning: This works so far only in the case ul=ur=0
Examples
>>> shock = pc.calc.sod() >>> shock.keys() t x rho ux pp ee tt Ms
- class pencil.calc.shocktube.SodShock
Bases:
objectSodShock – holds shock profiles and coordinate arrays
Fill members with default values
- t
- keys()
- calc_shocktube(xarr, time, par=list(), lreference=False, DEBUG=False, lplot=False, itplot=0, magic=['ee', 'tt', 'Ms'])
xarr: Coordinate vector (the initial discontinuity is always at x=0)
time: Time after membrane snapped.
par: Param object
lreference: Use default parameters for Sod’s reference problem.
DEBUG: Flag to switch on output
lplot: Plot first snapshot profiles
itplot: Iteration index of snaphot to plot
magic: Optional profiles to include in Sod object.