pencil.calc.shocktube ===================== .. py:module:: pencil.calc.shocktube .. autoapi-nested-parse:: Contains the classes containing the SOD analytic data Classes ------- .. autoapisummary:: pencil.calc.shocktube.SodShock Functions --------- .. autoapisummary:: pencil.calc.shocktube.sod Module Contents --------------- .. py:function:: 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']) :param \*xarr*: :type \*xarr*: Coordinate vector (the initial discontinuity is always at x=0) :param \*time*: :type \*time*: Time after membrane snapped. :param \*par*: :type \*par*: Param object :param \*lreference*: :type \*lreference*: Use default parameters for Sod's reference problem. :param \*DEBUG*: :type \*DEBUG*: Flag to switch on output :param \*lplot*: :type \*lplot*: Plot first snapshot profiles :param \*itplot*: :type \*itplot*: Iteration index of snaphot to plot :param \*magic*: :type \*magic*: Optional profiles to include in Sod object. :rtype: Class containing coordinates and shock profiles .. rubric:: 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 ----------------------------------------- 1 (l) | 2 | 3 | 4 | 5 (r) --------------+------+-------+----+------ 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 .. rubric:: Examples >>> shock = pc.calc.sod() >>> shock.keys() t x rho ux pp ee tt Ms .. py:class:: SodShock Bases: :py:obj:`object` SodShock -- holds shock profiles and coordinate arrays Fill members with default values .. py:attribute:: t .. py:method:: keys() .. py:method:: 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.