{
"metadata": {
"name": "",
"signature": "sha256:210e90da6bbfa354fed9659e620a3301cbb949f6a5dbf5a242d11344a4429c7b"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Investigation of the flow field from a serrated nozzle \n"
]
},
{
"cell_type": "raw",
"metadata": {},
"source": [
"#### According to measurements from NASA\n",
"\n",
"##### Dj = 0.0494 ------------ Jet Diameter\n",
"##### Uid = 300.0 ------------ Reference Velocity\n",
"##### Mjet = 0.9 ------------ Jet Mach Number \n",
"##### Setpoint = 007 ------------ According to Tanna (1987) \n",
"##### NozID = SMC006 ------------ According to NASA -------- \n",
"##### Pamb = 97000.0 ------------ Ambient pressure \n",
"##### Tamb = 280.2 ------------ Ambient temperature \n",
"##### NozzlePressureRatio =1.83\n",
"##### NozzleTemperatureRatio = 1.022\n",
"\n",
"## References\n",
"\n",
"##### Hao Xia, Paul G. Tucker and Simon Eastwood (2009). Large-eddy simulations of chevron jet flows with noise predictions. International Journal of Heat and Fluid Flow 30 (2009) 1067-1079. \n",
"\n",
"\n",
"###### Hao Xia and Paul G. Tucker (2011). Numerical Simulation of a Single-Stream Jets from a Serrated Nozzle . Flow Turbulence Combust 2011. \n",
"\n",
"\n",
"##### More to follow \n",
"\n",
"\n",
"\n",
" \n",
"\n",
" \n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Define case name\n",
"This is the solver case to be analysed"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"case_name = 'smc006'"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 1
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Define Data Location\n",
"For remote data the interaction will use ssh to securely interact with the data
\n",
"This uses the reverse connection capability in paraview so that the paraview server can be submitted to a job scheduler
\n",
"Note: The default paraview server connection will use port 11111"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"remote_data = True\n",
"\n",
"data_dir='/gpfs/cfms/workarea/projects/hyper_flux/serrated_nozzle/smc_zCFD/smc_jamil'\n",
"data_host='acimpoeru@vis03'\n",
"\n",
"remote_server_auto = True\n",
"\n",
"paraview_cmd='mpiexec /gpfs/cfms/apps/bin/pvserver'\n",
"if not remote_server_auto:\n",
" paraview_cmd=None\n",
"\n",
"if not remote_data:\n",
" data_host='localhost'\n",
" paraview_cmd=None"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 2
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Initialise Environment"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%pylab inline\n",
"from paraview.simple import *\n",
"paraview.simple._DisableFirstRenderCameraReset()\n",
"import pylab as pl\n",
"import math\n",
"import numpy as np"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Populating the interactive namespace from numpy and matplotlib\n",
"paraview version 4.2.0-75-gff3f889"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Data Connection\n",
"This starts paraview server on remote host and connects"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from zutil.post import pvserver_connect\n",
"if remote_data:\n",
" pvserver_connect(data_host=data_host,data_dir=data_dir,paraview_cmd=paraview_cmd)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"[acimpoeru@vis03] Executing task 'port_test'\n",
"Selected Port: 12000\n",
"[acimpoeru@vis03] Executing task 'pvserver'\n",
"[acimpoeru@vis03] run: /bin/bash -l -c \"cd /gpfs/cfms/workarea/projects/hyper_flux/serrated_nozzle/smc_zCFD/smc_jamil && sleep 2;mpiexec /gpfs/cfms/apps/bin/pvserver -rc --client-host=localhost -sp=12000\"\n",
"[acimpoeru@vis03] out: \n",
"[acimpoeru@vis03] out: \t\t _____ ______ __ __ _____ \n",
"[acimpoeru@vis03] out: \t\t / ____| ____| \\/ |/ ____|\n",
"[acimpoeru@vis03] out: \t\t | | | |__ | \\ / | (___ \n",
"[acimpoeru@vis03] out: \t\t | | | __| | |\\/| |\\___ \\ \n",
"[acimpoeru@vis03] out: \t\t | |____| | | | | |____) |\n",
"[acimpoeru@vis03] out: \t\t \\_____|_| |_| |_|_____/ \n",
"[acimpoeru@vis03] out: \n",
"[acimpoeru@vis03] out: ++++++++++++++++++++++++++++: System Data :++++++++++++++++++++++++++++\n",
"[acimpoeru@vis03] out: + Hostname = vis03\n",
"[acimpoeru@vis03] out: + Kernel = 2.6.32-358.el6.x86_64\n",
"[acimpoeru@vis03] out: + RHEL Release = Red Hat Enterprise Linux Server release 6.4 (Santiago)\n",
"[acimpoeru@vis03] out: + Uptime = 13:44:26 up 80 days, 3:29, 34 users,\n",
"[acimpoeru@vis03] out: ++++++++++++++++++++++++++++: User Data :++++++++++++++++++++++++++++++\n",
"[acimpoeru@vis03] out: + Username = acimpoeru\n",
"[acimpoeru@vis03] out: +++++++++++++++++++++++: Contact Information :+++++++++++++++++++++++++\n",
"[acimpoeru@vis03] out: + in case of any problems, contact: support@cfms.org.uk\n",
"[acimpoeru@vis03] out: + for feedback, contact: feedback@cfms.org.uk \n",
"[acimpoeru@vis03] out: +++++++++++++++++++++: Maintenance Information :+++++++++++++++++++++++\n",
"[acimpoeru@vis03] out: + There is no planned maintenance taking place this week\n",
"[acimpoeru@vis03] out: +++++: Group Home Directory Quota Usage (updated every 10 mins) +++++\n",
"[acimpoeru@vis03] out: + \n",
"[acimpoeru@vis03] out: +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n",
"[acimpoeru@vis03] out: Reported: 1 (out of 1) daemons - 1 (out of 1) procs\n",
"[acimpoeru@vis03] out: [acimpoeru@vis03] rtunnel: opened reverse tunnel: (u'127.0.0.1', 53355) -> ('172.20.1.25', 22) -> ('localhost', 11111)\n",
"Connecting to client (reverse connection requested)...\n",
"[acimpoeru@vis03] out: Connection URL: csrc://localhost:12000\n",
"[acimpoeru@vis03] out: Client connected.\n",
"[acimpoeru@vis03] out: "
]
}
],
"prompt_number": 4
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Get control dictionary"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from zutil.post import get_case_parameters,print_html_parameters\n",
"parameters=get_case_parameters(case_name,data_host=data_host,data_dir=data_dir)"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 5
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Get status file"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from zutil.post import get_status_dict\n",
"status=get_status_dict(case_name,data_host=data_host,data_dir=data_dir)\n",
"num_procs = str(status['num processor'])"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 6
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Define Jet Conditions"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# AMBIENT CONDITIONS\n",
"P_amb = 97000 # [Pa]\n",
"T_amb = 280.2 # [K]\n",
"gas_constant = 287.0\n",
"Rho_amb = P_amb/(gas_constant * T_amb) # [kg/m^3] - check\n",
"mu = 1.79e-5 # viscosity [Pa.s]\n",
"gamma = 1.4\n",
"speed_of_sound = math.sqrt(gamma*P_amb/Rho_amb) # [m/s]\n",
"\n",
"# JET CONDITIONS \n",
"NPR = 1.83 # nozzle pressure ratio P_jet/P_amb\n",
"NTR = 1.022 # nozzle temperature ratio T_jet/T_amb\n",
"Mjet = 0.9 # jet mach number \n",
"Djet = 49.4 # chevron tip to tip (exit diameter) [mm] \n",
"Ujet = 300.0 # reference velocity \n",
"Re = 1.03e6 # based on jet exit velocity , jet diameter and ambient conditions for mu and rho\n",
" \n",
"from IPython.display import HTML\n",
"HTML(print_html_parameters(parameters))"
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"
pressure | 97000.0 |
temperature | 280.2 |
Reynolds No | undefined |
Ref length | 0.001 |
Speed | 0.0 |
Mach No | 0.01 |