DARPA SUBOFF

Parameters

Alpha = 0

Mach = 0.0107

Reynolds number = 1.2e07

References

www.dtic.mil/dtic/tr/fulltext/u2/a210642.pdf/

Define case name

This is the solver case to be analysed


In [1]:
case_name = 'v2'

Define Data Location

For remote data the interaction will use ssh to securely interact with the data
This uses the reverse connection capability in paraview so that the paraview server can be submitted to a job scheduler
Note: The default paraview server connection will use port 11111


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

Initialise Environment


In [3]:
%pylab inline
from paraview.simple import *
paraview.simple._DisableFirstRenderCameraReset()
import pylab as pl
import math
import numpy as np


Populating the interactive namespace from numpy and matplotlib
paraview version 4.2.0-75-gff3f889

Data Connection

This starts paraview server on remote host and connects


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)


[acimpoeru@vis03] Executing task 'port_test'
Selected Port: 12000
[acimpoeru@vis03] Executing task 'pvserver'
[acimpoeru@vis03] run: /bin/bash -l -c "cd /gpfs/cfms/workarea/projects/hyper_flux/darpa/suboff_simplified && sleep 2;mpiexec /gpfs/cfms/apps/bin/pvserver -rc --client-host=localhost -sp=12000"
[acimpoeru@vis03] out: 
[acimpoeru@vis03] out: 		   _____ ______ __  __  _____ 
[acimpoeru@vis03] out: 		  / ____|  ____|  \/  |/ ____|
[acimpoeru@vis03] out: 		 | |    | |__  | \  / | (___  
[acimpoeru@vis03] out: 		 | |    |  __| | |\/| |\___ \ 
[acimpoeru@vis03] out: 		 | |____| |    | |  | |____) |
[acimpoeru@vis03] out: 		  \_____|_|    |_|  |_|_____/ 
[acimpoeru@vis03] out: 
[acimpoeru@vis03] out: ++++++++++++++++++++++++++++: System Data :++++++++++++++++++++++++++++
[acimpoeru@vis03] out: + Hostname = vis03
[acimpoeru@vis03] out: + Kernel = 2.6.32-358.el6.x86_64
[acimpoeru@vis03] out: + RHEL Release = Red Hat Enterprise Linux Server release 6.4 (Santiago)
[acimpoeru@vis03] out: + Uptime = 09:28:41 up 23 days, 23:13, 12 users,
[acimpoeru@vis03] out: ++++++++++++++++++++++++++++: User Data :++++++++++++++++++++++++++++++
[acimpoeru@vis03] out: + Username = acimpoeru
[acimpoeru@vis03] out: +++++++++++++++++++++++: Contact Information :+++++++++++++++++++++++++
[acimpoeru@vis03] out: + in case of any problems, contact: support@cfms.org.uk
[acimpoeru@vis03] out: + for feedback, contact: feedback@cfms.org.uk 
[acimpoeru@vis03] out: +++++++++++++++++++++: Maintenance Information :+++++++++++++++++++++++
[acimpoeru@vis03] out: + There is no planned maintenance taking place this week
[acimpoeru@vis03] out: +++++: Group Home Directory Quota Usage (updated every 10 mins)   +++++
[acimpoeru@vis03] out: + 
[acimpoeru@vis03] out: +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[acimpoeru@vis03] out: [acimpoeru@vis03] rtunnel: opened reverse tunnel: (u'127.0.0.1', 48202) -> ('172.20.1.25', 22) -> ('localhost', 11111)
Connecting to client (reverse connection requested)...
[acimpoeru@vis03] out: Connection URL: csrc://localhost:12000
[acimpoeru@vis03] out: Client connected.
[acimpoeru@vis03] out: 

Get control dictionary


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)

Get status file


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'])

Define test conditions


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]:
pressure101715.44
temperature304.2611
Reynolds No12000000.0
Ref length1429.1667
Speed0.0
Mach No0.0179

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)

Experimental DATA


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()


['x/c', ' Cp']

Cp Profile


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




## Convergence


In [39]:
from zutil.post import residual_plot, get_case_report
residual_plot(get_case_report(case_name))
show()


Cleaning up


In [22]:
if remote_data:
    #print 'Disconnecting from remote paraview server connection'
    Disconnect()


Exiting...
[acimpoeru@vis03] out: 

In [ ]: