date01052013
An Introduction to Fluid Dynamics and Numerical Solution of Shock Tube Problem by Using Roe Solver
Acknowledgements
First and foremost, I offer my sincerest gratitude to my supervisor, Prof. Sanjay K. Ghosh, who has supported me throughout my thesis with his patience and knowledge whilst allowing me the room to work in my own way. I attribute the level of my Masters degree to his encouragement and effort and without him this thesis, too, would not have been completed or written. One simply could not wish for a better or friendlier supervisor.
I would like to thank the administration of Bose Institute, which played an instrumental role during the course of my project by providing me requisite computer facility.
My parents, Sukumar and Lila Roy, have been a constant source of support – emotional, moral and of source financial – during my whole life.
Abstract
The study of fluids has been a topic of intense research for several hundred years. Over the years, this has further increased due to improved computational facility, which makes it easy to numerically simulate the fluid dynamics, which was beyond the analytical reach before. In this project, we discuss the general transport theorem for moving control volume system, apply this theory to control mass system which gives the continuity equation, and on momentum conservation from which we get the Navier-Stokes equation and energy conservation. By approximating the three equations for the ideal gas flow, we get one dimensional Euler equation. These equations are non-linear, and their analytic solutions are highly non-trivial. We will use Riemann solvers to get the exact solution numerically. In this project, we have considered only the Sod’s Shock Tube problem. Finally, we focus on the exact and approximate solution of density, pressure, velocity, entropy, and Mach number using Python code.
![[Uncaptioned image]](https://cdn.awesomepapers.org/papers/6546cc27-8a79-47b0-aa4b-f8e484b2dfdc/logo.png)
1 Introduction
1.1 What is a Fluid?
A fluid is any substance that deforms continuously when subjected to a shear stress, no matter how small. Usually a liquid or a gas.
1.2 Newton’s Law of Viscosity:
The shear viscosity of a fluid expresses its resistance to shearing flows, where adjacent layers move parallel to each other with different speeds. It can be defined through the idealized situation known as a Couette flow, where a layer of fluid is trapped between two horizontal plates, one fixed and one moving horizontally at constant speed . (The plates are assumed to be very large, so that one need not consider what happens near their edges.)If the speed of the top plate is small enough, the fluid particles will move parallel to it, and their speed will vary linearly from zero at the bottom to at the top. Each layer of fluid will move faster than the one just below it, and friction between them will give rise to a force resisting their relative motion. In particular, the fluid will apply on the top plate a force in the direction opposite to its motion, and an equal but opposite to the bottom plate. An external force is therefore required in order to keep the top plate moving at constant speed.

The magnitude F of this force is found to be proportional to the speed u and the area A of each plate , and inversely proportional to the separation y. i.e.
the proportionality factor is this formula the viscosity of the fluid The ratio is called the rate of shear deformation or shear velocity, and is the derivative of the fluid speed in the direction perpendicular to the plates. Isaac Newton expressed the viscous forces by the differential equation
where and is the local shear velocity. and similar case for 2 D
This is also known as Newton’s Second law of Viscosity.
1.3 Specification of motion
Fluids are treated as continuous media. There are four main physical idea which forms the basis of fluid dynamics:
-
The continuum hypothesis,
-
Conservation of mass,
-
Balance of momentum (Newton‘s second law of motion) and
-
Balance (conservation) of energy. The last of these is not needed in the description of some types of flows
Motion and state can be specified in terms of the velocity u, pressure P, density etc evaluated at every point in space x and time t. To define the density at a point, for example, suppose the point to be surrounded by a very small element (small compared with length scales of interest in experiments) which nevertheless contains a very large number of molecules. The density is then the total mass of all the molecules in the element divided by the volume of the element. Considering the velocity, pressure etc as functions of time and position in space is consistent with measurement techniques using fixed instruments in moving fluids. It is called the Eulerian specification. However, Newton’s laws of motion (see below) are expressed in terms of individual particles, or fluid elements, which move about. Specifying a fluid motion in terms of the position of an individual particle (identified by its initial position, say) is called the Lagrangian specification. The two are linked by the fact that the velocity of such an element is equal to the velocity of the fluid evaluated at the position occupied by the element:
Path Line: The path followed by a fluid element is called a particle path or path line. Mathematically obtained by
Stream Line: A streamline is a continuous line within a fluid such that the tangent at each point is the direction of the velocity vector at that point.stream lines are defined as
the components of u and x are related by from upper expression
Streak Lines: A streak line is the locus of the temporary locations of all particles that have passed though a fixed point in the flow field at any instant of time.
1.4 Material Derivative
Identify (or label) a material of the fluid; track (or follow) it as it moves, and monitor change in its properties. The properties may be velocity, temperature, density, mass, concentration etc in the flow field. In Lagrangian Approach the trajectory of each individual fluid parcel as it moves from some initial location, often described as “―placing a coordinate system on each fluid parcel“ and “―riding on that parcel as it travels through the fluid.“
In Eulerian Approach This corresponds to a coordinate system fixed in space, and in which fluid properties are studied as functions of time as the flow passes fixed spatial locations.
suppose a fluid property f is function of coordinate (x,y,z,t) as like f = f(x,y,z,t) and velocity vector then
the term is the local acceleration and the convective acceleration. The convective acceleration is nonlinear in f,which is the source of the great complexity of the mathematics and physics of fluid motion.
2 General Transport Theorem
The general transport theorem shows a beautiful equation from which the all conservation equations can be derived. This equation gives a expression for the variation of a physical quantity distributed in a scalar or vectorial field inside a deformable volume. This deformable volume can have variable mass if its boundary is permeable (open system). The basic Reynolds Transport Theorem shows the relation for a constant mass volume and a fixed volume, but it can be easily expanded to consider changes in a generic volume. The most interesting fact about these theorem is that it is only a geometrical relation. Physics only gets into the transport theorem when we define changes in a constant mass volume, which can use known physical laws, specially from thermodynamics.
2.1 Control System
Control Mass:
-
1.
It is a system of fixed mass.
-
2.
This type of system is usually referred to as “closed system”.
-
3.
There is no mass transfer across the system boundary.
-
4.
Energy transfer may be take place into or out of the system.
Control Volume:
-
1.
It is a system of fixed Volume.
-
2.
This type of system usually referred to as “Open System” or a ”Control Volume“.
-
3.
Mass transfer take place across the control volume.
-
4.
Energy Transfer also occur into or out of the system.
2.2 Reynolds Transport Theorem:
The question arise as to how a given quantity changes (where, some fluid property per unit volume) with respect to time as a material volume deforms.
We define the material volume as: An arbitrary chosen control volume of fluid whose surface moves at the particle velocity.
The significance of the volume moving at the same rate as the particle velocity is that no mass is transported across the chosen control surface that encloses the control volume. In addition, we state by definition that the material control volume deforms with the body motion.

Consider a material volume with surface area . The unit normal to the surface is denoted by and the surface velocity is denoted by . But in our calculation and . Within this control volume is a property of the continuum that is of interest. We would like to determine how changes with time. The total amount of present in the volume can be expressed as:
(2.1) |
The time rate of change if the fluid property is defined as:
(2.2) |
Since integration limit is function of time so we can not take the derivative inside the integration directly. In order to overcome this problem we transform the volume, and material property from a spatial representation to a reference/material representation. Recall that any differential volume element at time t is
where is differential volume at t = 0 and Jacobian J is defined as
(2.3) |
Given also can be expressed in terms of material coordinates by employing the results is
Therefore we can express the integral in equation 2.2 in terms of the material coordinates:
(2.4) |
Where U is the velocity of control volume Now we recall J, from equation 2.3 we can say the J is function of i.e.
(2.5) |
Now putting the value of in equation 2.5 we get,
(2.6) |
This is known as Reynold’s Transport Theorem.[6] Now applying Gauss’s Divergence Theorem in of the integral for the surface area of the control volume of volume we get
(2.7) |
Rate of change at Net flow of . a point volume across the surface
This is another form of RTT which is known as
3 Conservation of Mass
Conservation of mass The constancy of mass is inherent in the definition of a control mass system and therefore we can write
(3.1) |
The total mass of the the control volume can be defined as
To develop the analytical statement for the conservation of mass of a control volume, by using equation 2.6 we get,
(3.2) |
This known as mass conservation equation also known as differential form of continuity equation.
4 ConservatioFconsern of Momentum
Conservation of Momentum or Momentum Theorem The principle of conservation of momentum as applied to a control volume is usually referred to as the momentum theorem.The first step in deriving the analytical statement of linear momentum theorem is to write the equation 2.7 for the property as the linear-momentum and the velocity u along x-direction . Then it becomes
(4.1) |
The last term of term of the integral and first term of term of the integral create shows the equation of mass conservation which gives zero. so that
(4.2) |
(4.3) |
We begin by noting that be a vector that there must be a matrix say T such that
Notice that the ”dot” notation for the matrix-vector product is used to emphasize that each component of is the (vector) dot product of the corresponding row of T with the unit column vector . So we get
By using Gauss Divergence Theorem for the last term of RHS and recalling as arbitrary fluid element, we get
(4.4) |
This provides a fundamental and very general momentum balance that is valid at all points of any fluid flow (following the continuum hypothesis). T is reason of surface force. Now we are not going to more expression of T. Now writing the final form of T
(4.5) |
In this equation I is the identity matrix, and is often termed the viscous stress tensor. The expression will be clear from the picture

From Newton’s law of viscosity we can express the components of shear stress
Putting this value in equation 4.4 we get(in component form)
(4.6) |
Now divide these equations by on both side and express them as
(4.7) |
Here, is kinematic viscosity, the ratio of viscosity to density and is the second-order partial differential operator (given here in Cartesian coordinates)
This is known as momentum conservation equation but well known as Nevier-Stokes Equation. and they provide a pointwise description of essentially any time-dependent incompressible fluid flow.
5 Energy Conservation
Let E be the total energy of the fluid, sum of its kinetic energy and internal energy:
Principle of energy conservation: “the variation in time of the total energy of a portion of fluid is equal to the work done per unit time over the system by the stresses (internal forces) and the external forces”. Apply E in equation 2.6, we get
(5.1) |
Here, and substituting in equation 4.7, we get
The result is
Here denotes the vector whose components are . Since for an incompressible fluid, we can write the first term on the right as a divergence:
(5.2) |
Energy Flux Energy Flux Energy Flux
due to actual due to Friction due to momentum
mass transfer change
Now from equation 5.1, we get
(5.3) |
This is known as Energy conservation equation.[2]
6 Euler Equation:
The purpose of this note derivation of Euler’s equation for fluid flow on the basis of conservation of mass, conservation of momentum and Newton’s laws.
To set the stage, consider the example shown in figure 4. The top half is a snapshot of the fluid at some initial time and the bottom half is a snapshot at some slightly later time . One parcel of fluid has been marked with blue dye, and another parcel has been marked with red dye. The rectangle represents an imaginary box, also called the “Control Volume” we will be particularly interested in what is happening within this box.

There are some qualitative observations that we can make immediately:
-
The fluid is flowing left-to-right.
-
The density depends on position: The red parcel is denser than the blue parcel.
-
The density depends on time: The density in the control volume decreases as time passes from to .
-
The velocity depends on position: during the time interval in question, the right edge of the blue parcel moves a relatively short distance, while the right edge of the red parcel moves a relatively long distance.
-
The total number of red particles does not change, and the total number of blue particles does not change. (Some particles that flow out of the frame of the diagram are not accounted for, but all particles -red, blue, or black-that affect the control volume are accounted for.
In our calculations, we consider the following assumptions
-
‡
The fluid is ideal gas.
-
‡
There is no viscous force i.e
-
‡
There is no external force.
-
‡
Fluid flow is one dimensional.
Now applying this assumption on equation 3.2
(6.1) |
This is Mass Conservation equation for ideal gas.
Momentum Conservation: In some volume of fluid with surface the total force acting on the volume is where P is the pressure. Applying force on unit volume (Newton’s Law). Then we may be written as
But for one dimensional case , then
(6.2) |
This is Momentum conservation and now applying the assumption on energy equation 5.3:
recalling arbitrary value of elementary volume and applying one dimensional case
Total energy of ideal gas , so
(6.3) |
This is known as Energy Conservation equation for ideal gas.
7 Finite Volume Method
The finite-volume method[5] is a method for representing and evaluating partial differential equations in the form of algebraic equations. In this method values are calculated from at discrete places at meshed geometry. ”Finite Volume” refers small volume surroundings about mesh grid point. The evaluated terms are Fluxes at the surface of referred volume. Because the flux entering a given volume is identical to that leaving the adjacent volume, these methods are conservative. This method is used in many CFD packages.
Let us consider a 1 Dimensional Hyperbolic Equation can be defined by partial differential equation
(7.1) |
Where, represents the state variable and represents the flux or flow of .Conventionally, positive indicates flow from left to right and negative indicates flow from right to left.If we assume that equation (7.1) represents a flowing medium of constant area, we can sub-divide the spatial domain x, into finite volumes or cells with cell center index i. For a particular cell ’i’ we can define the volume average value of at time t = and . Just look at the figure

Now average value equation is
(7.2) |
At time , the average value equation is
(7.3) |
Where, and represent locations of the upstream and downstream faces or edges respectively of the cell. Now integrating equation(7.1) with respect to time, we have:
(7.4) |
where , To obtain the volume average at time we integrate over the cell volume after then we divide the result by , implies that
(7.5) |
we can assume that is well behaved and flow is normal to the surface area, even for 1 D case , so we can apply gauss divergence theorem in equation(7.5) over the x region even x and t are independent to each other i.e. we can interchange the integration of dx and dt, now we have:
(7.6) |
(7.7) |
We can therefore derive semi discrete numerical method with cell center index i and edges at :
(7.8) |
where values for the edge fluxes, can be reconstructed by interpolation or extrapolation of the cell averages. Equation (7.8) is exact for the volume averages; i.e., no approximations have been made during its derivation.
8 Roe Scheme Method
Roe Scheme Method[1] is a method to solve fluid conservation laws which are based on exploiting the information obtained by considering a sequence of Riemann Problem. It is argued that in existing schemes much of this information is degraded, and that only certain features of the exact solution are worth striving.
we consider the initial value problem for a hyperbolic system of conservation laws, such that
(8.1) |
where, and
(8.2) |
Where, F is some vector-valued function of u, such that the Jacobian matrix has only real eigenvalues, by using the discrete representation and and consider is some approximation of but a multitude of strategies are required to obtain the numerical result which is unclear, so we recall Riemann Problem and condition are:
(8.3) |
Now we can solve exactly equation 8.1 by using this initial condition and corresponding system equation where equation(8.1) will be converted to , which is our exact solution, but now we try to solve the equation(8.1) by boundary value and which gives us the approximate solution.
we consider the approximate solutions
(8.4) |
where, which satisfy the properties:
-
1.
It constitutes a linear mapping from the vector space u to the vector space F
-
2.
As , , where
-
3.
For any ,,
-
4.
The eigenvectors of are linearly independent.
8.1 Parameter Vector:
In this section we will use experience in analytic geometry that a plane curve y(x) may in some cases be much more easily described by a parametric form y = y(t) and x = x(t). we may therefore expect that a multidimensional manifold such as may sometimes be more amenable if represented as , where w as a parameter vector. Now we exhibit parameter vector for the Euler Equations, which we write as
(8.5) |
where
(8.6) |
in which = density, P = static pressure, u = velocity in Cartesian coordinate x, and e is total energy per unit volume. For ideal gas equation :
(8.7) |
= internal energy per unit mass, so internal energy per unit volume so Total energy = Kinetic energy + Thermal energy i.e.
(8.8) |
Now we take the parameter vector as like where h = enthalpy is defined as
(8.9) |
(8.10) |
(8.11) |
Now from the expression of w and from equation 8.6, we have
(8.12) |
and
(8.13) |
8.2 Eigenvalues and Eigenvectors for Euler Equation
It is now very easy to represent any jump in space u,F in terms of its image in the space w. For example, given any pair of states and their images we can write
(8.14) |
and
(8.15) |
where , are matrix, now can be evaluated by the process:
So there is only one solution for where and , are zero. Similarly we evaluate another component of
Here , because LHS have no term of or . Now we try to solve the reduced equation. There are two solution but we have to choose the solution which containing and both. So the reduced equation is
Where and , similarly solving the third equation we have the matrix as
(8.16) |
and by using equivalent method
(8.17) |
Obviously these very simple formulas are closely related to the homogeneous property of the Euler equations. We will wish to construct the eigenvalues and the eigenvectors of some matrix which maps and with property u. Evidently we may choose . To find the find the eigenvalues and eigenvectors we simplify the matrix and divide by without loss of property.
(8.18) |
(8.19) |
we use Python code to determine the eigenvalues and eigenvector of new and :
Corresponding results are :
(8.20) |
(8.21) |
(8.22) |
Here (by using equation 8.11 ), ’s are eigenvalues and are eigenvectors.
8.3 Approximate Riemann Solver
To complete the analysis we must show how to project an arbitrary onto the eigenvectors as basis i.e., we have to find coefficient in
(8.23) |
A routine calculation yields
(8.24) |
Now from the equation :
and from equation:
So we are able to solve and :
(8.25) |
(8.26) |
Now we construct , which will construct by the eigenvalues and eigenvectors of which maps and and must be multiplied by ’s because in image space w. So we have:
Now we have have the information and on the mesh grid point so intermediate Flux is given by:
(8.27) |
8.4 Harten Sonic Entropy Fix
when, then so
This means that central discretization is used, without artificial viscosity so that there is a danger that entropy decreases, and that discontinuities are insufficiently smear out. The flow is not sonic , then we do not have central discretization , and there may be enough dissipation to prevent violation of the entropy condition. this is confirmed by the correct approximation by the subsonic fans.
An often used artifice to add dissipation to the Roe scheme near sonic condition has been proposed by Harten(1984). The eigenvalues and are slightly increased in the vicinity of zero, replacing them in value ’s by
(8.28) |
9 One-Dimensional Shock-Tube Problem
shock tube is a very long pipe in which a strong shock wave is generated. In the initial configuration, the tube is divided by a diaphragm into two compartments: the driver section containing the gas with the higher pressure and the driven section with the gas at the lower pressure .Here, we omitting the parts about reflected shock and expansion waves as well as some theory considered too general. The right-running normal shock is treated on page 21 and the solution to the complete problem is given on page 21.

We start from the continuity, momentum and energy equations for a stationary normal shock wave[3]:
(9.1) |
(9.2) |
(9.3) |
where the index 4 refers to gas upstream of the wave, index 3 to gas downstream of the wave.The important point is that and are interpreted as velocities relative to the wave; because it is stationary, they are in this case also relative to the laboratory. For the moving wave the velocities relative to the wave are (for the gas ahead) and (for the gas behind) also making the total velocity equal to because In figure, with the shock wave propagating to the right . After replacing and , equation 9.1 to 9.3 become
(9.4) |
(9.5) |
(9.6) |
Equations 9.4 to 9.6 are the normal-shock equations for a shock moving with velocity W into a stagnant gas. They can be rearranged and substituted, using h = e+p/, to obtain
(9.7) |
The states after the shock are connected by the Rankine Hugoniot shock jump conditions[9] (Landau page no. 334) is valid, because we assume the case of polytropic gas, , and ; equation 9.7 becomes
(9.8) |
(9.9) |
Equations 9.8 and 9.9 give the temperature and density ratios across the shock wave as functions of the pressure ratio. We define the moving shock Mach number as
(9.10) |
Since , Eqn. 9.10 leads to
(9.11) |
Equation 9.11 relates the velocity of the moving shock wave to the pressure ratio across the wave and the local speed of sound of the gas ahead of the shock wave.
The last quantity we are interested in is the velocity up of the mass motion induced by the shock wave. Equation 9.4 can be rewritten
(9.12) |
(9.13) |
With what we have derived so far, we can obtain for a given pressure ratio and speed of sound the corresponding values of , , W and up from Eqn 9.8, 9.9, 9.11 and 9.13. The next section deals with the counterpart of the moving shock wave, namely the expansion wave.
9.1 The incident expansion wave
In the last section discussions about the relations between the regions 3 and 4 of Fig. 6. In this section we examine the regions 1 and 2. The formulas relate to a left-running expansions wave; they would be similar for a right-running one except some changes of the signs in the equations. We use the fact that the gas in region 1 feels as if a piston was pulled to the right with velocity . In fact, is the mass-motion velocity of the gas behind the expansion wave[3] because this portion is high pressure region realtive to region 4.
Inside the wave, a mass motion with velocity u is induced, directed toward right. Temperature T and subsequently the local speed of sound a are reduced; because of this the head of the wave propagates faster into region 1 than other parts of the wave, so the wave is spreading out while running down the tube.

The tail of the wave moves at velocity . Note that if , i. e., is supersonic, the tail of the wave propagates to the right although the wave is left-running. It can be shown that the characteristics of the expansion wave are straight lines and thus the values of u, a (and consequently also p, , T etc.) are constant along them. Such a wave is called a simple wave; a non simple waves where the characteristics are curved comes up for example when the expansion wave is reflected.
To obtain a closed analytical form for the expansion wave, we use Riemann invariant form [9] (page no. 394)
(9.14) |
Applying this equation in region 1, we get
(9.15) |
Combining these equations we get
(9.16) |
Which relates u and a within the expansion wave. Because Eqn 9.16 also gives
(9.17) |
For isentropic process
Then from Eqn. 9.17, we get
(9.18) |
and
(9.19) |
These equations give all properties within the simple expansion wave as a function of the local gas velocity u. To get them as function of x and t, we use straight line characteristics as
Using this relation in Eqn. 9.16
(9.20) |
The properties can be determined within the expansion wave,
9.2 Final Expression of Shock Tube
Finally, we combine the last two section for a closed analytical solution. End of the day we recall that and across the contact surface; last expression of was
Applying Eqn. 9.18 to the tail of the expansion wave,
(9.21) |
Putting
Since , so we apply in last Eqn. and equation 9.13, we get
(9.22) |
Equation (9.22) gives the incident shock strength as an implicit function of the diaphragm pressure ratio . We can now unfold a recipe for the solution of the shock tube problem, which consists of all the boxed equations:
-
Calculate from Eqn. 9.22 to get the strength of the shock wave.
-
Calculate to get the strength of the expansion wave.
-
All other properties behind the expansion wave can be found using
9.3 Implementation in Python
Source code of these mathematics is given in section 13.3, where xgrid is a vector containing the x-positions where the solution is evaluated rho , u ,c(=a),P,machE and are vectors of the size of x_grid containing the density, local velocity,sound velocity,pressure, Mach number and entropy at the corresponding positions.
specifies at what time the solution is to be evaluated;rhoL(), rhoR , PrL , PrR , uL = uR = initial settings for density, pressure and local velocity in the two compartments.
After parsing the input and optionally setting default values, some constants are specified: the heat capacity gamma = 1.4 and position of diaphragm at 0.5 . Next local speed and the densities for region 1 and 4 are computed from the quantities known so far. To get P3, rho3, rho2, u2 and c2 we solve Eqn 9.22 for that means we have to find a satisfying
(9.23) |
This equation is solved by python function fsolve which can gives the iterative solution about a point of iterative solution by using Newton’s method, bisection method etc.
Now, the mesh is initialized, usually to a size of 1 x 300, but the number of points could also be changed to some other value if desired. Before iterating through all the solution vectors, the boundaries of the regions are determined using the knowledge about the velocities of head and tail of the expansion wave.
-
Starting expansion fan i.e Boundary between leftmost driver gas and expansion wave.
-
End of expansion fan i.e. Boundary between expansion wave and lower pressure driver gas.
-
Position of contact discontinuity i.e. Boundary between driver gas and driven gas.
-
Shock Position i.e Location of the shock wave.
10 Sod Shock Tube
The Sod shock tube problem, named after Gary A. Sod, is a common test for the accuracy of computational fluid codes, like Riemann solvers and was heavily investigated by Sod in 1978. The test consists of a one dimensional Riemann problem with the following parameters, for left and right states of an ideal gas.
(10.1) |
The time evolution of this problem can be described by solving the Euler equations. Which leads to three characteristics, describing the propagation speed of the various regions of the system. Namely the rarefaction wave, the contact discontinuity and the shock discontinuity. If this is solved numerically, one can test against the analytical solution, and get information how well a code captures and resolves shocks and contact discontinuities and reproduce the correct density profile of the rarefaction wave.
11 Result:
11.1 Shock tube Data Plot after Breaking the Diaphragm
In this case
Quantity | left side | right side |
---|---|---|
Density | 1.0 | 0.125 |
Pressure | 1.0 | 0.1 |
Velocity | 0.0 | 0.0 |
=0.17 Sec N=300 =0.35 |





Comparison to measurements yields respectable results, actually this result is only for stationary shock tube.but our program simulation for both cases. Three Python scripts on the accompanying movies, which visualize the density,pressure,velocity, Mach number and entropy in shock tube after breaking the diaphragm.See Appendix LABEL:subsec:_Contents_in_CD for details on the CD.
Script file | Video file | Quantity |
---|---|---|
exact.py | exact.avi | Exact value by Shock tube formula |
approximate.py | approximate.avi | Approximate solution by Roe Solver |
approximate_exact.py | approximate_exact.avi | Both solution |
12 Conclusions
We described a strategy for obtaining numerical solutions to hyperbolic initial-value problems by Roe Scheme Method[1]. In the project we have the details of one element in that strategy. Our investigations into the Euler equations have revealed some very tidy structures. Also the existence of a fast exact Riemann solver is found more generally useful. Our programming experience is that the present direct method is about a time-consuming as one cycle of the iterative procedures. Iterations needed to obtain more exact solutions. Also we use Harten entropy fix assuming the Harten original approach: the entropy fix as means to select the physically relevant weak solution, corresponding to the vanishing viscosity solution.
References
- [1] P. L. ROE JOURNAL OF COMPUTATIONAL. PHYSICS. 43, 357-372 (1981). Approximate. Riemann Solvers, Parameter Vectors, and Difference Schemes.
- [2] S. K. GHOSH ‘LECTURE ON ATMOSPHERIC SCIENCE. Fluid Mechanics‘
- [3] Anderson, Dale A., Tannehill, John C., & Pletcher, Richard H. 1984. Computational Fluid Mechanics and Heat Transfer. New York: McGraw-Hill.
- [4] T.J. PEDLEY, ’Introduction to Fluid Dynamics’, SCI. MAR., 61 (Supl. 1): 7-24
- [5] R. Eymard, T Gallouët and R. Herbin, ’FINITE VOLUME METHOD’, update of the article published in Handbook of Numerical Analysis, 2000
- [6] Elizabeth H. Hearn,’The Reynolds Transport Theorem’
- [7] P. Wesseling, Principles of Computational Fluid Dynamics
- [8] M. Pelanti, L. Quartapelle and L. Vigevano ’A review of entropy fixes as applied to Roe’s linerization’
- [9] L. D. LANDAU & E. M. LIFSHITZ ‘FLUID MECHANICS’ Second Edition
13 Appendix
13.1 Implementation in Python of Roe Scheme:
we will apply the Roe Scheme to the one test case of shock tube. We discretize the flow of quantity u by finite volume method of equation 7.7 in time by explicit Euler method
(13.1) |
The exact solution is used to prescribe and . The time step and mesh size ’s are constant .
-
Grid of Physical Quantity Take x_grid, density grid, pressure grid, velocity grid all have same no of grid point(in our case 300) last three grid maintain Riemann Problem given in equation 8.2 i.e. first half grid value will rhoL, PrL, uL and last half grid value rhoR, PrR, uR.
-
Grid of New Average Calculation From this new grid calculate Aav by using equation 8.11 also alpha1,Eqn 8.25 alpha2, 8.24 alpha3 8.26, lambda’s 8.21 now we have all the eigenvalues and corresponding eigenvector but to remove the problem of artificial viscosity apply Harten sonic entropy fix condition 8.28
-
Flux Average Calculate roe flux’s Eqn 8.27 where for 1st term is flux averages.
-
Average data for grid formation since we have the average data between two grid point so we can fill centering grid point by using 13.1 , which is our new grid.
-
Entropy End of the program calculate entropy
Since at t = 0 all left and right side data are same so when we calculate the average value gives us ’-nan’ so next time gives two ’-nan’ data so it will be dangerous. To remove this problem if then .