Page 1 (printed 2/18/99) DDDDOOOO____PPPPPPPPMMMMLLLLRRRR0000____1111DDDDCCCC((((JJJJaaaannnn 1111999999999999)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV DDDDOOOO____PPPPPPPPMMMMLLLLRRRR0000____1111DDDDCCCC((((JJJJaaaannnn 1111999999999999)))) NNNNAAAAMMMMEEEE ddddoooo____ppppppppmmmmllllrrrr0000____1111ddddcccc - Given 1d strips of zone averages of density, pressure, and velocity defined on a uniform grid, new zone averages of these quantities are returned by advancing the Euler equations forward one timestep. A gamma law EOS is not assumed. FFFFOOOORRRRTTTTRRRRAAAANNNN SSSSPPPPEEEECCCCIIIIFFFFIIIICCCCAAAATTTTIIIIOOOONNNN ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee ddddoooo____ppppppppmmmmllllrrrr0000____1111ddddcccc(((( XXXXLLLL,,,, RRRRHHHHOOOO,,,, PPPP,,,, UUUU,,,, EEEETTTT,,,, CCCCEEEE,,,, RRRRHHHHOOOONNNNUUUU,,,, EEEETTTTNNNNUUUU,,,, UUUUNNNNUUUU,,,, DDDDTTTT,,,, SSSSMMMMLLLLRRRRHHHHOOOO,,,, SSSSMMMMAAAALLLLLLLLPPPP,,,, SSSSMMMMAAAALLLLLLLLUUUU,,,, SSSSMMMMAAAALLLLLLLLEEEE,,,, CCCCOOOOUUUURRRRMMMMXXXX,,,, NNNNZZZZOOOONNNNEEEESSSS,,,, NNNNBBBBDDDDYYYY )))) rrrreeeeaaaallll****4444 XXXXLLLL((((1111----NNNNBBBBDDDDYYYY::::NNNNZZZZOOOONNNNEEEESSSS++++NNNNBBBBDDDDYYYY++++1111)))) rrrreeeeaaaallll****4444 RRRRHHHHOOOO((((1111----NNNNBBBBDDDDYYYY::::NNNNZZZZOOOONNNNEEEESSSS++++NNNNBBBBDDDDYYYY)))) rrrreeeeaaaallll****4444 PPPP((((1111----NNNNBBBBDDDDYYYY::::NNNNZZZZOOOONNNNEEEESSSS++++NNNNBBBBDDDDYYYY)))) rrrreeeeaaaallll****4444 UUUU((((1111----NNNNBBBBDDDDYYYY::::NNNNZZZZOOOONNNNEEEESSSS++++NNNNBBBBDDDDYYYY)))) rrrreeeeaaaallll****4444 EEEETTTT((((1111----NNNNBBBBDDDDYYYY::::NNNNZZZZOOOONNNNEEEESSSS++++NNNNBBBBDDDDYYYY)))) rrrreeeeaaaallll****4444 CCCCEEEE((((1111----NNNNBBBBDDDDYYYY::::NNNNZZZZOOOONNNNEEEESSSS++++NNNNBBBBDDDDYYYY)))) rrrreeeeaaaallll****4444 RRRRHHHHOOOONNNNUUUU((((1111----NNNNBBBBDDDDYYYY::::NNNNZZZZOOOONNNNEEEESSSS++++NNNNBBBBDDDDYYYY)))) rrrreeeeaaaallll****4444 EEEETTTTNNNNUUUU((((1111----NNNNBBBBDDDDYYYY::::NNNNZZZZOOOONNNNEEEESSSS++++NNNNBBBBDDDDYYYY)))) rrrreeeeaaaallll****4444 UUUUNNNNUUUU((((1111----NNNNBBBBDDDDYYYY::::NNNNZZZZOOOONNNNEEEESSSS++++NNNNBBBBDDDDYYYY)))) rrrreeeeaaaallll****4444 DDDDTTTT,,,, SSSSMMMMLLLLRRRRHHHHOOOO,,,, SSSSMMMMAAAALLLLLLLLPPPP.... SSSSMMMMAAAALLLLLLLLUUUU,,,, SSSSMMMMAAAALLLLLLLLEEEE,,,, rrrreeeeaaaallll****4444 CCCCOOOOUUUURRRRMMMMXXXX iiiinnnntttteeeeggggeeeerrrr****4444 NNNNZZZZOOOONNNNEEEESSSS,,,, NNNNBBBBDDDDYYYY ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee dddd____ddddoooo____ppppppppmmmmllllrrrr0000____1111ddddcccc(((( XXXXLLLL,,,, RRRRHHHHOOOO,,,, PPPP,,,, UUUU,,,, EEEETTTT,,,, CCCCEEEE,,,, RRRRHHHHOOOONNNNUUUU,,,, EEEETTTTNNNNUUUU,,,, UUUUNNNNUUUU,,,, DDDDTTTT,,,, SSSSMMMMLLLLRRRRHHHHOOOO,,,, SSSSMMMMAAAALLLLLLLLPPPP,,,, SSSSMMMMAAAALLLLLLLLUUUU,,,, SSSSMMMMAAAALLLLLLLLEEEE,,,, CCCCOOOOUUUURRRRMMMMXXXX,,,, NNNNZZZZOOOONNNNEEEESSSS,,,, NNNNBBBBDDDDYYYY )))) rrrreeeeaaaallll****8888 XXXXLLLL((((1111----NNNNBBBBDDDDYYYY::::NNNNZZZZOOOONNNNEEEESSSS++++NNNNBBBBDDDDYYYY++++1111)))) rrrreeeeaaaallll****8888 RRRRHHHHOOOO((((1111----NNNNBBBBDDDDYYYY::::NNNNZZZZOOOONNNNEEEESSSS++++NNNNBBBBDDDDYYYY)))) rrrreeeeaaaallll****8888 PPPP((((1111----NNNNBBBBDDDDYYYY::::NNNNZZZZOOOONNNNEEEESSSS++++NNNNBBBBDDDDYYYY)))) rrrreeeeaaaallll****8888 UUUU((((1111----NNNNBBBBDDDDYYYY::::NNNNZZZZOOOONNNNEEEESSSS++++NNNNBBBBDDDDYYYY)))) rrrreeeeaaaallll****8888 EEEETTTT((((1111----NNNNBBBBDDDDYYYY::::NNNNZZZZOOOONNNNEEEESSSS++++NNNNBBBBDDDDYYYY)))) rrrreeeeaaaallll****8888 CCCCEEEE((((1111----NNNNBBBBDDDDYYYY::::NNNNZZZZOOOONNNNEEEESSSS++++NNNNBBBBDDDDYYYY)))) rrrreeeeaaaallll****8888 RRRRHHHHOOOONNNNUUUU((((1111----NNNNBBBBDDDDYYYY::::NNNNZZZZOOOONNNNEEEESSSS++++NNNNBBBBDDDDYYYY)))) rrrreeeeaaaallll****8888 EEEETTTTNNNNUUUU((((1111----NNNNBBBBDDDDYYYY::::NNNNZZZZOOOONNNNEEEESSSS++++NNNNBBBBDDDDYYYY)))) rrrreeeeaaaallll****8888 UUUUNNNNUUUU((((1111----NNNNBBBBDDDDYYYY::::NNNNZZZZOOOONNNNEEEESSSS++++NNNNBBBBDDDDYYYY)))) rrrreeeeaaaallll****8888 DDDDTTTT,,,, SSSSMMMMLLLLRRRRHHHHOOOO,,,, SSSSMMMMAAAALLLLLLLLPPPP.... SSSSMMMMAAAALLLLLLLLUUUU,,,, SSSSMMMMAAAALLLLLLLLEEEE,,,, rrrreeeeaaaallll****8888 CCCCOOOOUUUURRRRMMMMXXXX iiiinnnntttteeeeggggeeeerrrr****4444 NNNNZZZZOOOONNNNEEEESSSS,,,, NNNNBBBBDDDDYYYY DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN These routines are examples of one-dimensional hydrodynamic subroutines following a LAgrangian plus remap style using elements from the PPMLIB library. First, piecewise Page 1 (printed 2/18/99) DDDDOOOO____PPPPPPPPMMMMLLLLRRRR0000____1111DDDDCCCC((((JJJJaaaannnn 1111999999999999)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV DDDDOOOO____PPPPPPPPMMMMLLLLRRRR0000____1111DDDDCCCC((((JJJJaaaannnn 1111999999999999)))) Parabolic interpolations are constructed for pressure and velocity. Where the input data distribution is not well represented by parabolae or poorly resolved, (that is, the data are ``unsmooth''), monotonicity constraints are applied. At the beginning of the remap step, new piecewise Parabolic interpolations are constructed for pressure and longitudinal velocity, using the updated zone-averages from the Lagrangian step. Where the data are not well represented by parabolae or poorly resolved, (that is, the data are ``unsmooth''), monotonicity constraints are applied. Piecewise Parabolic interpolations are constructed for the density. Contact discontinuity detection is performed and where it is determined likely that a contact discontinuity exists, the density interpolations are modified to better represent discontinuities, rather than a smooth distribution. Monotonicity constrains are applied where the density data are deemed unsmooth. Next, regions of overlap between the Eulerian grid (the original grid) and the Lagrangian grid are found. The piecewise parabolic interpolations found above are integrated over these overlap regions to produce advection fluxes. These fluxes are differenced conservatively to provide new zone-averaged values of density, pressure (or energy), and longitudinal velocity. Finally, a diffusion step is applied. Shock detection is performed, so that the additional diffusion is applied only in those zone which require it. This includes strong shocks and certain pathological case such as a shock moving slowly through the numerical grid. In addition to the updated zone averages of density, pressure, and velocity, an estimate of the Courant number is also returned to the calling program. In order for the method to be stable, the various Domains of Dependence for each zone interface may not exceed one zone in width. Nor may any wave travel more than one zone width during the timestep. To be stable, the Courant number should be less than 1.0. A general metal) equation of state is used: p = p00 + gamma1 * rho * ei where p is the pressure, rho is the density, ei is the internal energy, and gamma1 and p00 are two as yet to be Page 2 (printed 2/18/99) DDDDOOOO____PPPPPPPPMMMMLLLLRRRR0000____1111DDDDCCCC((((JJJJaaaannnn 1111999999999999)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV DDDDOOOO____PPPPPPPPMMMMLLLLRRRR0000____1111DDDDCCCC((((JJJJaaaannnn 1111999999999999)))) determined constants. This implies that: ce**2 = gamma1 * (ei + p / rho) where ce is the Eulerian sound speed. hence: ce**2 = ((1 + gamma1) * p - p00 ) / rho Note that the input data should be consistent with the relation: ce**2 = dp/drho + ddp/dei and of course dp/drho must be positive and ddp/dei nonnegative. However, it is not necessary that the pressure be positive. This generalized quation of state is applied separately to the zone-averaged data supplied in each zone, by solving for the constants p00 and gamma1 on a zone by zone basis. This creats a separate EOS for each zone. After gas from adjacent zones has mixed, the individual equations of state found above are no longer valid. Thus only averaged derived by physically conserved quantities are returned: density (from mass); velocity (from momentum); and total energy. It is then necessary for the user to acess the actual equation of state, which is presumedly known to him. HHHHIIIINNNNTTTTSSSS +o The required problem boundary conditions may be enforced by setting appropriate zone-averaged values of the fake zones. +o The timestep should be adjusted so that the Courant number (COURMX) remains less than 1.0. Because the actual Courant number encountered during a call is not known until after the call is completed, a common procedure is to adjust the new timestep so that the Courant number from the just completed call is <= 0.8. +o For an example of calls to the general Equation of state routines, see [[[[dddd____]]]]ddddoooo____ppppppppmmmmllllrrrr0000____1111ddddcccc. +o For an example of an non uniform grid see [[[[dddd____]]]]ddddoooo____ppppppppmmmmllllrrrr____1111ddddcccc____ggggaaaammmmmmmmaaaa. +o For examples of higher dimensions see [[[[dddd____]]]]ddddoooo____ppppppppmmmmllllrrrr0000____2222ddddcccc____ggggaaaammmmmmmmaaaa or [[[[dddd____]]]]ddddoooo____ppppppppmmmmllllrrrr0000____3333ddddcccc____ggggaaaammmmmmmmaaaa . Page 3 (printed 2/18/99) DDDDOOOO____PPPPPPPPMMMMLLLLRRRR0000____1111DDDDCCCC((((JJJJaaaannnn 1111999999999999)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV DDDDOOOO____PPPPPPPPMMMMLLLLRRRR0000____1111DDDDCCCC((((JJJJaaaannnn 1111999999999999)))) BBBBUUUUGGGGSSSS +o Does not work as a 64-bit object. Reason unknown. produces a Segmentation fault in subroutine PPM98_EUL_DIFUSE_1D when space for allocatable array UR is allocated. SSSSEEEEEEEE AAAALLLLSSSSOOOO DO_PPMLR0_1DC, DO_PPMLR_1DC_GAMMA, DO_PPMLR0_2DC_GAMMA, DO_PPMLR0_3DC_GAMMA, FFFFIIIILLLLEEEESSSS ppm98_dfns.h ppm98_bdys.h BBBBUUUUGGGG RRRREEEEPPPPOOOORRRRTTTTSSSS TTTTOOOO ppmlib@sapphire.lcse.umn.edu AAAAUUUUTTTTHHHHOOOORRRRSSSS PPPPaaaauuuullll RRRR.... WWWWooooooooddddwwwwaaaarrrrdddd paul@lcse.umn.edu BBBB.... KKKKeeeevvvviiiinnnn EEEEddddggggaaaarrrr bke@lcse.umn.edu Department of Astronomy University of Minnesota Minneapolis, MN 55455 USA Page 4 (printed 2/18/99)