Sedov Analytical Solution Program

Contents

Introduction

This page provides a brief description of a C program that solves the Sedov point-blast wave problem. The details of the analytical solution to this problem are described in [1,2] and will not be repeated here. Instructions on how to download, compile, and run are the C code are provided on this page.

Contact Information

The code author can be reached via email at: ahaque@flash.uchicago.edu

License and Limits of Liability

The author grants the user permission to use and modify the code. The code may be freely redistributed provided that the contents remain intact from the original tarfile. No commercial use of this code is allowed.

The author makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. The author shall not be liable in any event for incidental or consequential damages in connection with, or arising out of, the use of the program sedov or any additional software provided here.

System Requirements

GNU gcc compiler (or a C compiler that supports the ANSI C standard)
The make utility
PERL (optional)

Definition of the Sedov Problem

The Sedov problem is a point-blast wave in an ideal gas at constant initial density and zero pressure:

ρ(r,0)=ρ0
p(r,0)=0
u(r,0)=0
E(r,0)=E0δ(r)

ρ is density, p is pressure, u is velocity, and E is total energy.

The Sedov Solution

The location of the shock front is given by:

R(t)=(E/ρ0)1/(2+ν) t2/(2+ν)

where ν is the geometry parameter.

The energy parameter E is given by:

E=E0


Unfortunately, α is not known until the solution is known. However, the solution depends on R(t) and hence on α. An iterative procedure is used to determine the proper value of α. The convergence is determined by computing the difference between total energy in the solution to the energy source E0:

Ediff = ∫ ρu2/2 dV + ∫ p/(γ-1) dV - E0

where the integrals are taken over spatial volume.

Details of the solution procedure are described in [1] and by looking through the source code sedov.c.


Downloading the Code

The tarfile of the code can be downloaded here:

sedov.tar

To untar the file, type the following:

tar -xvf sedov.tar

The following files should be present in the sedov subdirectory:

Makefile - the makefile used to compile the code with make.
sedov.c - the C source code.
sedov.param - sample parameter file.
sedov.html - this html documentation.
make_plots.pl - PERL script for making solution plots.
alpha.pl - PERL script for making alpha plots.
E_diff.pl - PERL script for making energy difference plots.


Compiling the Code

The C code compiles under GNU gcc with the ANSI C standard. A makefile is included to compile with GNU gcc. Other compilers are possible but that will require the user to modify the makefile. To compile the code, simply type:

make

To clean up the directory and remove the executeable:

make clean


Using the Code

The Parameter File

A parameter file is required in order to run the sedov program. The format of this file will now be described. Each line in this file has the following format:

<value>   <comment string>

<value> is the numerical value of the parameter and <comment string> is a continuous string. The following table describes each line of the parameter file:

Line
Description
Valid Values
1
Geometry ν
1=planar, 2=cylindrical, 3=spherical
2
Energy E0 or
E (parameteric mode)
E0 , E > 0
3
Gamma γ
1.1 ≤ γ ≤ 1.9
4
Initial density ρ0
ρ0 > 0
5
Time t
t > 0
6
Maximum r
rmax > 0

Caution! rmax should be greater than the shock location at time t.

The contents of the sample parameter file sedov.param is:

3       #geometry
1.0     #E0
1.4     #gamma
1.0     #rho0
0.5     #time
1.0     #r_max

Command Line Parameters

A summary of the command line options for the sedov program is:

./sedov <param file> [mode] [alpha] {optfile}

<param file>     : Parmater file (required)

[mode] must be exactly one of the following:
-r      : Use dimensional coordinates
-v      : Use dimensionless coordinates

[alpha] must be exactly one of the following:
-para                     : Parameteric mode
-auto                     : Choose initial α automatically
-alpha=<a>          : Set α to <a>
-alpha0=<a0>      : Set initial value of &alpha to <a0>

{optfile} is an optional data file:
-rfile=<file>       : Dump solution for r's listed in <file>


[mode]

-r uses a uniform mesh on dimensional coordinates from 0 to rmax to compute the Sedov solution.

-v uses a uniform mesh on dimensionless coordinates from the origin to the shock location.

Caution! These two options will produce different results. The -v option is usually more accurate and should be used in most cases.

[alpha]

-para uses E from the parameter file and computes E0 and α; no iterations performed.

-auto chooses an initial α automatically and performs the iteration on α until energy convergence.

-alpha=<a> sets α to <a>; no iterations performed.

-alpha0=<a0> sets initial value of &alpha to <a0> and performs the iteration on α until energy convergence.

{optfile}

-rfile=<file> dump solution for r coordinates listed in <file>. An example of such a file is:

# 5
0.1
0.2
0.3
0.4
0.5

The first line of the file contains the # symbol followed by the number of coodinates in the file. Each coordinate is listed on its own line.

Caution! The coodinates must appear in increasing order. The first coodinate must be greater than zero and the last coordinate must be greater than the shock location at time t.

Code Output

The following files are generated after running the sedov program:

sedov.dat - the solution data in dimensional values.
sedov_nd.dat - the solution data in dimensionless values.
E.dat - the energy data in dimensional values.
E_nd.dat - the energy data in dimensionless values.
alpha.dat - log file of final α values.
E_diff.dat - log file of energy differences. (-alpha=<a> mode only)

The comment headers of these files explain their contents and this will not be discussed here.


Plotting Scripts

Three PERL scripts for running and plotting are provided:

make_plots.pl - PERL script for making solution plots.
alpha.pl - PERL script for making alpha plots.
E_diff.pl - PERL script for making energy difference plots.

These scripts automatically generate various plots. Basic knowledge of PERL is required to modify these scripts.

Results

The results of running the sedov code and using the plotting scripts will be provided here. This will allow the user to see if they are properly using the code.




sedov_nd.png produced from:
./sedov sedov.param -r -auto
./make_plots.pl





alpha.png produced from:
./alpha.pl





E_diff.png produced from:
./E_diff.pl

References

[1] L.I. Sedov, Similarity and Dimensional Methods in Mechanics, Academic Press, New York, 1959.
[2] V.P. Korobeinikov, Problems of Point-Blast Theory, American Institute of Physics, 1991.