31 July 2008

Summer Vacation '09

Next year's vacation should be one interesting trip-- two weeks in Russia, floating from Moscow to Saint Petersburg.

26 July 2008

Impinging shock results for a 5 degree wedge at Mach 8.2

After a dead-end-full month of futzing with Gridgen, DPLR, and Tecplot 360, today I finally got a result worth showing:

This is a simulation of a hypersonic experiment performed by Kussoy and Horstman in 1991. A flat plate and an angled wedge are placed in a Mach 8.2 flowfield. Starting from the upstream tip of the flat plate (not shown), a turbulent boundary layer develops along the plate's length. An attached shock occurs at the wedge tip, and the shock interacts with the plate's turbulent boundary layer. Kussoy and Horstman looked at how surface pressure and heat flux at the plate varied with the wedge angle. Here I'm comparing their surface pressure data with my simulated numbers for the 5 degree wedge case. Agreement isn't that bad (eyeball norm), especially given the paper's experimental error bounds and how new I am to this whole process.

I was surprised to see the simulated pressure gradient is sharper than the experimentally obtained gradient. I suspect that

  • I goofed when specifying the turbulence transition point along the flat plate, or
  • perfect air assumptions weren't appropriate, or
  • Baldwin-Lomax wasn't the right turbulence model to use, or
  • I've not done any averaging and the flowfield has turbulence, or
  • any one of a number of other things.
I'm elated to be in the why-isn't-this-what-I-expect stage instead of playing the why-is-the-solver-blowing-up game.

22 July 2008

Using GNU screen with gnome-terminal's custom shell command

GNU screen is a nice tool. It becomes more valuable when it's omnipresent, but until today I've been too lazy to get configured the way I want it:

  1. I want screen started within every new gnome-terminal.
  2. When a new terminal starts, I want a fresh screen window with a fresh shell.
  3. When I close a terminal window, my screen session should persist.

The first ups screen's usefulness since its capabilities are now always a keystroke away. The second mimics my new-terminal-window-is-a-new-task mentality. The third keeps me from accidentally losing work when I close a terminal window.

First, I needed to add several options to my ~/.screenrc:

# Useful settings (among many others)
autodetach on
multiuser on
startup_message off
# Startup commands for a new session
screen -t local
select local

Next, because gnome-terminal's custom command facility doesn't allow anything too fancy (e.g. multiple commands, variable expansion), I had to create a small bash script called gnome-terminal-command.sh:

#!/bin/bash -i
# First, construct a new window identifier
WIN_ID=`date +%R:%S`
# Second, start a new window in the screen session using that identifier
screen -xRR -X screen -t "${WIN_ID}"
# Third, prevent existing terminals from switching to the new session
# Thanks to nassrat for this tip
screen -xRR -X other
# Now, use screen to connect to the new window within this process
exec screen -xRR -p "${WIN_ID}"

Lastly, I told gnome-terminal to use gnome-terminal-command.sh under Edit -> Current Profile -> Title and Command . Check "Run a custom command instead of my shell" and give gnome-terminal-command.sh in the Custom command input box. Older versions of gnome-terminal (e.g. version 2.18.1) allow the script to be somewhere in your path. Newer versions (e.g. 2.22.1) seem to require a full path to the script. This is puzzling.

Testing it out...

  1. Start gnome-terminal and you get a screen session with one window called 'local'.
  2. Open a second gnome-terminal and you get a new screen window whose title is the current time.
  3. Close the second window and you see two screen windows persisting in the first gnome-terminal.
  4. Open a third gnome-terminal and you get yet another new screen window.
  5. Hit Control-D three times in the third window to end each of the screen windows. All of your gnome-terminals will simultaneously close.

During testing, it'll help if you have an informative screen status line. Should you run into serious troubles, you can undo the changes by using gconf-editor to tweak use_custom_command and custom_command under apps/gnome-terminal/profiles/Default.

16 July 2008

I've been here for too long

I walked in this morning after a small breakfast, still hungry. While putting my lunch away, I noticed a large container of dill pickle spears. The type provided in bulk by BBQ joints when they cater. Exactly the type of food that lingers in the fridge near the grad student cubicles.

Ignoring the complete grossness of consuming pickles alongside cheap instant coffee, I immediately wondered how long they'd been there and if they'd be safe to eat. I snapped to the conclusion that, well, they are pickles and are therefore pickled after all.

I caught myself just as my hand lifted towards the container, shivered, collected my instant coffee, and moved on.

Subscribe Subscribe to The Return of Agent Zlerich