1.5 Research plan
2.2.1 Chec: a 1D Eulerian hydrocode
Chec is a one-dimensional Eulerian hydrocode that was written (in Fortran 90) during the initial stages of this work. Chec solves the Eulerian reactive-flow modelling equa- tions2.1to2.5in one-dimensional plane geometry neglecting chemistry, heat conduction and diffusion. A polytropic gas is used for the equation of state:
p=(γ−1)ρe, (2.12)
whereγis the ratio of specific heat at constant pressure to that at constant volume. This can be derived from the more familiar ideal gas equations p = ρRT and e = cvT, for constant cv, which were originally determined experimentally but can also be derived from kinetic theory [101]. The temperatureT is eliminated in equation2.12to create an equation of state (EOS) of the formp(ρ,e) which is sufficient to solve the hydrodynamic equations. A temperature relation T(ρ,e) is only required when additional physics like heat conduction is modelled. The polytropic gas equation of state is used here because it is convenient for hydrocode testing purposes owing to its simple analytic form, but it begins to break down even for gases under atmospheric conditions [88], and is inadequate for modelling both solid unreacted explosives and hot, high-pressure gaseous reaction products. For these reasons, more advanced equations of state will be used elsewhere in this work (see chapter3).
A simple quadratic artificial viscous pressure [97] is used:
Q= 0 for ∂u∂x ≥ 0 βQρ∆x2 ∂u ∂x 2 for ∂u∂x ≤ 0, (2.13)
where ∆x is the computational cell size and βQ is a constant known as the quadratic artificial viscosity coefficient. This is known as the standard form by Noh [111] and, although it smooths shock discontinuities sufficiently to enable hydrocode calculations to run, it fails to entirely eliminate oscillations behind shocks. These can be mitigated by adding a linear artificial viscosity term βLρc∆x(∂u/∂x) [112], where βL is the linear
artificial viscosity coefficient andcis the sound speed. More advanced artificial viscosity forms, for example monotonic viscosity [27] and Wilkins viscosity [98], are implemented in Peruse and Petra and will be used in subsequent chapters to produce better results.
Chec is an explicit finite-difference code. This means that the flow variables are ad- vanced to time tn+1 using the known values at the previous time tn, in contrast to an implicit or semi-implicit scheme where a combination of values at tn+1 and tn is used. Explicit schemes are favoured for unsteady flow since they are more accurate and compu- tationally efficient [89]. However, the timestep∆t = tn+1−tn used in an explicit scheme needs to be controlled to ensure stability. The Courant-Friedrichs-Lewy (CFL) condition for hyperbolic equations is used:
∆t= C∆x
c , (2.14)
whereCis the Courant factor. It is necessary thatC ≤1 for stability but it is desirable that
Cshould be as close to 1 as possible to enable an accurate solution to be obtained [89]. A predictor-corrector scheme is used in Chec to provide second-order accuracy in time. In the predictor step, the numerical solution is advanced to time tn+1/2 with first-order accuracy to calculate a half-timestep pressure and artificial viscosity. These are then used in the corrector step to advance the solution fromtn totn+1with second-order accuracy.
A staggered grid is used: the velocityuis stored at cell edges whileρ,e, pandQare stored at cell centres. Staggered grids allow strength models to be implemented relatively easily and are generally favoured by the hydrocode community [105]. Two different boundary conditions, reflective and transmissive, are implemented in Chec using a ghost cell at each end of the computational domain. The final boundary condition needed to run a hydrocode simulation is the initial condition att0. The initial geometry is defined in the hydrocode input and the thermodynamic state within each computation cell is calculated during initialisation.
In common with most hydrocodes, Chec uses operator splitting to solve the hydrody- namics equations in a series of steps [27]. These steps, which are based on the scheme in Petra [109], are summarised in figure2.2. The left side of the flow-chart describes how the solution is advanced to the next timestep on a Lagrangian mesh. The right side shows the advection step that is used to re-map the solution back to the fixed grid. During the Lagrangian predictor step, the particle velocity and specific internal energy are advanced to tn+1/2 using the momentum and energy conservation equations, in order to calculate
and artificial viscosity Calculate timestep
Advection step
Print out data
Calculate total energy to check energy conservation
Check for end time End
Call EOS to update pressures
Mass advection Energy advection Momentum advection Update values, including call
EOS to update pressures Interface construction Lagrangian
predictor step Lagrangian corrector step
to update u and e Set up problem
Figure 2.2: A flow-chart for the computational scheme in Chec. To achieve second- order accuracy, a predictor step calculates the pressure and artificial viscosity at the half- timestep, before the full-timestep Lagrangian corrector step. The advection step is used to remap the full-timestep solution back to the fixed computational grid.
half-timestep values for pressure and artificial viscosity. The velocity and specific inter- nal energy updates are repeated using the half-timestep values for p and Q during the corrector step. During the advection step, the mass, energy and momentum conservation equations are used to calculate the density, specific internal energy and particle veloci- ties at tn+1, before the equation of state is called to determine the pressure and artificial viscosity.
The total energy is calculated at the end of each timestep to check that total energy conservation across the computational grid is satisfactory. A consequence of expressing the hydrodynamics equations in terms of specific internal energy rather than total energy is that the momentum advection step does not conserve kinetic energy exactly [28]. In common with many Eulerian codes, Chec includes an energy dissipation function to add
the kinetic energy lost from each cell to its internal energy, subject to an artificial viscosity cutoffofQ≥ 10−3p. The cutoffensures that dissipated kinetic energy is converted to in- ternal energy only in the presence of shocks, where this process is physically reasonable. First, second and third-order van Leer advection schemes [106] have been imple- mented to allow the differences between the three schemes to be observed. The first-order scheme is significantly more diffusive than the higher-order schemes but flux limiters are needed to reduce non-physical oscillations with the second and third-order methods [109]. An interface construction method is needed to reduce numerical diffusion at material in- terfaces [28]. The Simple Line Interface Calculation (SLIC) scheme [113] is used in Chec. This recognises six fluid configuration types and allocates volume fluxes for each material according to its position relative to the surrounding computational cells. SLIC is a relatively simple first-order algorithm and more advanced techniques, e.g. Youngs’ method [109], are often used in 2D and 3D hydrocodes. Another error arises when mixed cells (containing more than one material) are used in Eulerian hydrocodes. During the La- grangian step, the compression of a mixed cell is distributed evenly between the materials present in the cell. This assumption is not appropriate when one material is significantly softer than the others, so inaccurate pressures and temperatures will be produced. A pressure relaxation option is included in many Eulerian hydrocodes to allow the materials within a cell to approach pressure equilibrium at the end of the Lagrangian step. However, this option is not available in Chec.
Chec uses well-established methods to solve the hydrodynamics equations and so it is not useful to describe its workings in detail here. Instead, the results of two one- dimensional test problems (sketched in figure 2.3) will be shown to demonstrate that the code works correctly. The analytic solution [99] to the Sod shock-tube problem is compared to the results of a Chec simulation at 15µs in figure2.4, showing that the code performs reasonably well. The internal energy overshoot at x= 64 cm is due to the wall heating effect that will be discussed below. The oscillations near x=50 cm are a start-up error caused by the initial shock discontinuity, and could be reduced by suppressing the timestep at the start of the calculation. Importantly, Chec gives results of similar quality to other hydrocodes [105,107] with 100 zones across the computational domain, the mesh resolution originally defined for the Sod shock-tube problem [100].
The results of a plate impact simulation are compared with the analytic solution at 5µs in figure2.5. The wall heating effect reduces the density and increases the internal energy at the boundary between the two regions (x =4.5 cm). Apart from this, figure2.5shows
u =0, = p =1, =2.5
Ideal gas, =1.4γ Ideal gas, =1.4γ
x=50 x=100
x=0
Sod shock tube
Ideal gas, =5/3γ Ideal gas, =5/3γ
x=0 x=2 x=6 Plate impact 0 0 e 0 ρ0 0 e0 0 ρ0 u =1, =p =0, =1 0 u =0, =0.125, p =0.1, =2.0ρ0 0 e0 u =0, =p =0, =10 e0 0 ρ0
Figure 2.3: Two standard one-dimensional hydrocode test problems: the Sod shock-tube problem (above) and a plate-impact problem (below). Any set of self-consistent units can be used: in figures 2.4 and 2.5 we use g, cm, µs and Mbar to be consistent with other hydrocodes.
that the code gives good results for the plate impact test problem. The satisfactory results for both test problems demonstrate that, by writing Chec, an understanding of hydrocode numerics has been achieved.
The wall heating errors observed in figures2.4and2.5are a well-documented effect, described by Noh [111]. They are caused by near-discontinuous shocks being driven into the computational domain att = 0µs. The shocks must travel through several computa- tional cells before the artificial viscosity is able to smear them sufficiently. This means that internal energy is over-predicted, and density under-predicted, at the interface. The effect can be reduced by introducing heat conduction to dissipate the excess energy and/or by the use of adaptive mesh refinement, but it cannot be eliminated. Wall heating errors occur in most of the simulations described in this thesis, and their effects will be described as they arise in each of the chapters.
Noh [111] also defined a spherical rigid-wall impact geometry that is routinely used as a hydrocode test problem. It highlights two types of errors associated with the use of artificial viscosity: the wall heating error described above and the overheating that occurs in convergent geometry. Since the second error does not occur in plane geometry and Chec does not have the capability to run in cylindrical or spherical geometry, the Noh test problem is not used here.
Figure 2.4: The analytic solution to the Sod shock-tube problem (black lines) is compared to the results of a Chec simulation (points) with 500 zones across the 100 cm computa- tional domain, at timet =15µs, showing reasonably good agreement.
Figure 2.5: The analytic solution to a plate-impact test problem (black lines) is compared to the results of a Chec simulation (points) with 1000 zones across the 6 cm computational domain, at timet= 5µs, showing good agreement.