#! /bin/bash # Define what output to post-process: (0/1)=(N/Y) post_flowfield = 1 post_exit_profiles = 1 post_bl_profiles = 1 # Define variables for grid, solution, and chemistry file grid=run.cgd sol=run.cfl chm=h2-air-9sp-3287.chm #################################### # flowfield #################################### if [ $post_flowfield == 1 ]; then # Create a CFPOST input script echo " clear all grid $grid sol $sol chem file $chm units english subset i 1 last j 1 last k 1 last zone 1 to 10 variable x in variable y in variable z in variable M variable p lbf in variable T r variable rho slug ft variable u ft sec variable v ft sec variable w ft sec variable X-H2O variable X-H2 variable X-O2 plot3d function flowfield.fun names flowfield.nam unformatted plot3d xyz flowfield.g unformatted exit " > flowfield.jou # Run CFPOST and supply the input script cfpost_prod.exe < flowfield.jou # Cleanup rm flowfield.jou mv flowfield* ./results/ fi #################################### # exit profiles #################################### if [ $post_exit_profiles == 1 ]; then # Create a CFPOST input script echo " clear all grid $grid sol $sol chem file $chm subset i last j all k 1 zone 8 var x cm var y cm var T0 K var M var X-H2 var X-O2 var X-H2O list output molefrac.lis raw lines 55555 exit " > molefrac.jou # Run CFPOST and supply the input script cfpost_prod.exe < molefrac.jou # Strip header from CFPOST output file grep -v -e 'Subset' -e '-x-' -e 'cm' molefrac.lis > molefrac.dat # Add new header for use with Tecplot sed -e '1i\ TITLE = "Str. Mole Frac." 1i\ VARIABLES = "x [cm]" 1i\ "y [cm]" 1i\ "T0 [K]" 1i\ "Mach" 1i\ "X-H2" 1i\ "X-O2" 1i\ "X-H2O" 1i\ ZONE T="Str. ", F=POINT' molefrac.dat > mf.dat # Cleanup mv mf.dat ./results/mf.dat rm mole*.lis mole*.jou mole*.dat cfpost.jou fi #################################### # bl zone profiles #################################### if [ $post_bl_profiles == 1 ]; then # Create a CFPOST input script echo " clear all grid $grid sol $sol chem file $chm subset i last j all k 1 zone 10 var x cm var y cm var T0 K var M var u ft sec var v ft sec var X-H2 var X-O2 var X-H2O list output temp.lis raw lines 55555 exit " > temp.jou # Run CFPOST and supply the input script cfpost_prod.exe < temp.jou # Strip header from CFPOST output file grep -v -e 'Subset' -e '-x-' -e 'cm' temp.lis > temp.dat # Add new header for use with Tecplot sed -e '1i\ TITLE = "bl zone" 1i\ VARIABLES = "x [cm]" 1i\ "y [cm]" 1i\ "T0 [K]" 1i\ "Mach" 1i\ "u [ft/sec]" 1i\ "v [ft/sec]" 1i\ "X-H2" 1i\ "X-O2" 1i\ "X-H2O" 1i\ ZONE T="Str. ", F=POINT' temp.dat > bl.dat # Cleanup mv bl.dat ./results/bl.dat rm temp.lis temp.jou temp.dat cfpost.jou fi