AstroFV

FV Solver for RSTP problem

This project is maintained by njase

As a user, you can use AstroFV to perform simulation of an astrophysical application. The following simulations are currently supported. Please click on the relevant one:

  1. Relativistic Shock Tube Problem (RSTP) in 1-D

RSTP

Introduction

Astrophysical scenarios involving relativistic flows occur in several phenomenon, most notably in the jets in extragalactic radio sources associated with active galactic nuclei. Similar to shock wave phenomenon in classical Newtonian fluid mechanics, strong shocks are a common feature in such astrophysical scenarios. Numerical simulations are therefore needed to study the formation, evolution and interaction of shock waves in relativistic fluids.

Relativistic shock tube problem (RSTP) involves the decay of an initially discontinuous two fluids into three elementary wave structures: a shock, a contact, and a rarefaction wave.

Governing Equations

This application considers the hydrodynamics model of a perfect fluid. The model is thus given by the hyperbolic system of conservation laws of the relativistic hydrodynamics.

Following Hujeirat and Font, the 1-dimensional hydrodynamical system in Minkowski space can be reformulated in terms of dynamical variables as:

where we define

= Relativistic Density

= Momentum

= Total energy (assuming conservation of mechanical energy)

= Transport Velocity

in Minkowski space

= four-velocity of the fluid

= rest mass density in locally intertial reference frame

= relativistic specific enthalpy

= specific internal energy

= pressure of ideal gas

The above equations are the desired equations which can be solved for the following cases:

Numerical techniques

Spatial discretization

Using first order upwinding with constant grid size

Temporal discretization

Constant grid size is used

We use cell centered FV discretization for Density and Momentum conservation and vertex centered FV discretization for Total energy. This is shown below FV Cells for RSTP

For vertex centered approach, the transport velocity at FV cell surface is taken as the mean value across the boundary. i.e

The upwind flux across the FV cell surfaces is defined as:

Discretized equations using Explicit Euler

Discretized equations using Implicit Euler

The paramater controls the implicit scheme. Value 1.0 implies Implicit Euler. Other useful values like 0.5 which imply Crank-Nicholson are for future use.

The 3 set of equations can be written as:

which when re-arranged gives a tridiagonal system of equations as follows:

, then

and , then

Key Data structures

  1. Parameters
  class RSTPExplicitParams(Params):
     def __init__(self,ncells,gamma=0,cfl=1.0):
         Params.__init__(self,"explicit") 
         self.gamma = gamma
         self.cfl = cfl
         self.ncells = ncells
         self.fv_boundary_strategy = None
   
  class RSTPImplicitParams(Params):
     def __init__(self,ncells,alpha,gamma=0,iter_count=1,cfl=0.50):
         Params.__init__(self,"implicit") 
         self.gamma = gamma
         self.ncells = ncells
         self.alpha = alpha
         self.fv_boundary_strategy = None        
         self.cfl = cfl #This is used to define time step size
         self.iter_count = iter_count

These are used to define parameters for Explicit Euler time integration and Implicit time integration.

gamma = 0 defines isothermal gas

Time limits are default [0,1] and spatial limits are default [0,1].

Spatial grid size is automatically chosen by dividing spatial limit by ncells.

Temporal grid size is automatically derived from spatial grid size by using CFL parameter. delta_t = self.params.cfl*delta_x

Example:

   eparams = RSTPExplicitParams(1000,0,0.25) #isothermal gas, CFL=0.25
   iparams = RSTPImplicitParams(1000,1.0,0.0,2,0.7) #isothermal gas, Implicit Euler solver, iter_count=2, cfl=0.7  
  1. Initial Values
    class RSTPIV(InitialValues):
     def __init__(self,Vx,Mx,D,Rho):
         self.Vx = Vx
         self.Mx = Mx
         self.D = D
         self.Rho = Rho
    

    Used to provide initial values. The initial values are provided as a list for the two discontinuous fluids.

Example:

   iv = RSTPIV(Vx=[0,0],Mx=[0,0],D=[1,10**-2],Rho=[1,10**-2])
 

Usage examples

###### Solve RSTP using Explicit Euler Number of FV cells = 1000, gamma = 4/3, CFL = 0.25

     eparams = RSTPExplicitParams(1000,4/3,0.25) 
     eparams.set_fig_path('./figs/')
     eparams.fv_boundary_strategy = FVTransverse #Default 
     eiv = RSTPIV(Vx=[0,0],Mx=[0,0],D=[1,10**-2],Rho=[1,10**-2])
     ebv = RSTPBV()
     test_explicit = RSTPTest(1,eparams,eiv,ebv,ode_strategy=ODEExplicit)
     test_explicit.solve()

###### Solve RSTP using Implicit Euler Number of FV cells = 1000, gamma = 4/3, CFL = 0.7, no of subiterations = 2

     iparams = RSTPImplicitParams(1000,1.0,4/3,2,0.7)
     iparams.set_fig_path('./figs/')
     iparams.fv_boundary_strategy = FVTransverse #Default 
     iiv = RSTPIV(Vx=[0,0],Mx=[0,0],D=[1,10**-2],Rho=[1,10**-2])
     ibv = RSTPBV()
     test_implicit = RSTPTest(2,iparams,iiv,ibv,ode_strategy=ODEImplicit)
     test_implicit.solve()

#### Output The output is generated as a set of 4 image files in the same directory as provided in set_fig_path() API.

The 4 image files correspond to plot of spatial variable x against Relativistic Density (D), Pressure(P), Lorentz factor () and Transport Velocity () respectively

An example is shown below: RSTP Relativistic Density RSTP Pressure RSTP Lorentz factor RSTP Transport Velocity