import pandas as pd
import numpy as np
import matplotlib as plt
from IPython.display import Image
This validation case consideres one-dimensional shock propagation. For validation purposes, the study compares the numerical results to an analytical solution.
It is assumed the fluid can be treated as an ideal gas for which the following material properties hold:
mP = pd.read_csv('./input/matProp.csv')
mP
The following initial conditions are specified:
iCI = pd.read_csv('./input/intialCond.csv')
iCI
For the purpose of the analysis a one-dimensional structured mesh is generated using the blockMesh utility. A tube length of 10 m is specified.
from IPython.display import Image, HTML, display
from glob import glob
imagesList=''.join( ["<img style='width: 600px; margin: 10px; float: left; border: 0px solid black;' src='%s' />" % str(s)
for s in sorted(glob('screenShot/mesh/mesh1Far.png')) ])
display(HTML(imagesList))
A script is provided to set up the case and run the simulation. The script ./runSim generates the mesh, initialises the two regions and runs the simulation.
Below, the convergence of the density, momentum and energy equations' residuals are shown as a function of the number of solver iterations:
from IPython.display import Image, HTML, display
from glob import glob
imagesList=''.join( ["<img style='width: 415px; margin: 10px; float: left; border: 0px solid black;' src='%s' />" % str(s)
for s in sorted(glob('screenShot/results/conv*.png')) ])
display(HTML(imagesList))
To validate the numerical results, they are plotted against the analytical solution. The pressure and velocity after 0.007 s are shown respectively:
from IPython.display import Image, HTML, display
from glob import glob
imagesList=''.join( ["<img style='width: 415px; margin: 10px; float: left; border: 0px solid black;' src='%s' />" % str(s)
for s in sorted(glob('screenShot/results/results*.png')) ])
display(HTML(imagesList))
from IPython.core.display import HTML
def css_styling():
styles = open("./styles/custom.css", "r").read()
return HTML(styles)
css_styling()