DARPA SUBOFF

SUBOFF_config8

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='[email protected]'

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)
[[email protected]] Executing task 'port_test'
Selected Port: 12000
[[email protected]] Executing task 'pvserver'
[[email protected]] 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"
[[email protected]] out: 
[[email protected]] out: 		   _____ ______ __  __  _____ 
[[email protected]] out: 		  / ____|  ____|  \/  |/ ____|
[[email protected]] out: 		 | |    | |__  | \  / | (___  
[[email protected]] out: 		 | |    |  __| | |\/| |\___ \ 
[[email protected]] out: 		 | |____| |    | |  | |____) |
[[email protected]] out: 		  \_____|_|    |_|  |_|_____/ 
[[email protected]] out: 
[[email protected]] out: ++++++++++++++++++++++++++++: System Data :++++++++++++++++++++++++++++
[[email protected]] out: + Hostname = vis03
[[email protected]] out: + Kernel = 2.6.32-358.el6.x86_64
[[email protected]] out: + RHEL Release = Red Hat Enterprise Linux Server release 6.4 (Santiago)
[[email protected]] out: + Uptime = 09:28:41 up 23 days, 23:13, 12 users,
[[email protected]] out: ++++++++++++++++++++++++++++: User Data :++++++++++++++++++++++++++++++
[[email protected]] out: + Username = acimpoeru
[[email protected]] out: +++++++++++++++++++++++: Contact Information :+++++++++++++++++++++++++
[[email protected]] out: + in case of any problems, contact: [email protected]
[[email protected]] out: + for feedback, contact: [email protected] 
[[email protected]] out: +++++++++++++++++++++: Maintenance Information :+++++++++++++++++++++++
[[email protected]] out: + There is no planned maintenance taking place this week
[[email protected]] out: +++++: Group Home Directory Quota Usage (updated every 10 mins)   +++++
[[email protected]] out: + 
[[email protected]] out: +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[[email protected]] out: [[email protected]] rtunnel: opened reverse tunnel: (u'127.0.0.1', 48202) -> ('172.20.1.25', 22) -> ('localhost', 11111)
Connecting to client (reverse connection requested)...
[[email protected]] out: Connection URL: csrc://localhost:12000
[[email protected]] out: Client connected.
[[email protected]] 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...
[[email protected]] out: