In [1]:
case_name = 'v2'
In [2]:
remote_data = True
data_dir='/gpfs/cfms/workarea/projects/hyper_flux/darpa/suboff_simplified'
data_host='acimpoeru@vis03'
remote_server_auto = True
#paraview_cmd='mpiexec -n 1 ~/apps/Paraview/bin/pvserver --use-offscreen-rendering -rc --client-host=localhost -sp=11113'
paraview_cmd='mpiexec /gpfs/cfms/apps/bin/pvserver'
if not remote_server_auto:
paraview_cmd=None
if not remote_data:
data_host='localhost'
paraview_cmd=None
In [3]:
%pylab inline
from paraview.simple import *
paraview.simple._DisableFirstRenderCameraReset()
import pylab as pl
import math
import numpy as np
In [4]:
from zutil.post import pvserver_connect
if remote_data:
pvserver_connect(data_host=data_host,data_dir=data_dir,paraview_cmd=paraview_cmd)
In [5]:
from zutil.post import get_case_parameters,print_html_parameters
parameters=get_case_parameters(case_name,data_host=data_host,data_dir=data_dir)
In [6]:
from zutil.post import get_status_dict
status=get_status_dict(case_name,data_host=data_host,data_dir=data_dir)
num_procs = str(status['num processor'])
In [7]:
alpha = 0.0 # degrees
reference_area = 0.0 # inches^2
reference_length = 1429.1667 # inches, mean chord.
reference_span = 0.0 # inches
from IPython.display import HTML
HTML(print_html_parameters(parameters))
Out[7]:
In [20]:
from zutil.post import cp_profile_wall_from_file
def plot_cp_profile(ax,file_root,section_loc):
force_data = cp_profile_wall_from_file(file_root,
[0.0,0.0,1.0],
section_loc,
func=plot_array,
axis=ax,
#section_data=section_data,
alpha=0.0)
def plot_array(data_array,pts_array,**kwargs):
global loop_counter, loop_data
ax = kwargs['axis']
cp_array = data_array.GetPointData()['cp']
chord_array = data_array.GetPointData()['chord']
ax.plot(chord_array, cp_array , 'b.',color='k',label='zCFD SST (14M cells)',markersize=10)
ax.plot(pts_array.GetPoints()[:,0]/1429.17,pts_array.GetPoints()[:,1]/160.0,'_',color='k',markersize=3.0)
In [10]:
import zutil
import zutil.post as post
reload(zutil)
reload(post)
from zutil.post import get_csv_data
import os
import glob
from collections import OrderedDict
aff_8_hu= zutil.post.get_csv_data("/gpfs/cfms/workarea/projects/hyper_flux/darpa/suboff_simplified/results/aff8_symmtry.csv",
header=True,remote=True,delim=',')
aff_8_hu_ls= zutil.post.get_csv_data("/gpfs/cfms/workarea/projects/hyper_flux/darpa/suboff_simplified/results/aff8_symmetry_ls.csv",
header=True,remote=True,delim=',')
suboff_fine_solution = zutil.post.get_csv_data("/gpfs/cfms/workarea/projects/hyper_flux/darpa/suboff_simplified/results/suboff_fine_solution.csv",
header=True,remote=True,delim=',')
print suboff_fine_solution.keys()
In [21]:
from zutil.post import get_case_root
from zutil.post import calc_force_wall
from matplotlib.backends.backend_pdf import PdfPages
section_normal = [0,0,1]
section_loc = [0,0,0]
fig = pl.figure(figsize=(15, 8),dpi=600, facecolor='w', edgecolor='k')
ax = fig.add_subplot(1,1,1)
ax.set_title('Cp in the symmetry plane', fontsize=20, fontweight='bold',style = 'italic')
ax.grid(True)
ax.set_xlabel('x/L',fontsize=20,style='italic')
ax.set_ylabel('$C_p$',fontsize=20)
ax.axis([0.0,1.0,-1.0,1.2])
plot_cp_profile(ax,get_case_root(case_name,num_procs),section_loc)
ax.plot(suboff_fine_solution[0],suboff_fine_solution[1],'b.',color='b',label='zCFD SST (30M cells)', markersize=10)
ax.plot(aff_8_hu[0],aff_8_hu[1],'b.',color='r',label='Experiment', markersize=15)
ax.legend(loc='upper right', shadow=True, scatterpoints=1, numpoints=1, fontsize=15,)
pp = PdfPages('suboff.pdf')
pp.savefig()
pp.close()
fig.savefig("suboff.png")
show()
from IPython.display import FileLink, display
display(FileLink('suboff.png'))
print
In [39]:
from zutil.post import residual_plot, get_case_report
residual_plot(get_case_report(case_name))
show()
In [22]:
if remote_data:
#print 'Disconnecting from remote paraview server connection'
Disconnect()
In [ ]: