Pages
Sunday, March 20, 2011
Optical Illusion in Visualization
This test was done using Athena and the visualization was done in Paraview. The 2D surface is colored according to the log10 of the density and the vector arrows show velocity and are colored according to the magnitude of the magnetic field.
One thing that came up with this visualization is that at the very beginning there is an optical illusion. Even though the gas is initially spinning in a counter-clock-wise direction because it is slowing down and begins to change direction, it appears as if it is spinning in the opposite direction. Because of the way the velocity vectors change length and direction at the beginning it gives the impression that the gas is spinning in the clock-wise direction. This is an excellent instance of an optical illusion in a visualization. Sometimes when scientists are trying to visualize their data they run the risk of having it create an optical illusion that will mess up their interpretation of the data. The way to fix this is to use a different visualizing method, in this case I could use particle tracers or stream line tracers to fix the problem.
But this is just one of the hazards of trying to use visualization to tell us something about our data. Still, visualization is better than just about any other method in giving a complete picture of what it going on. We just have to be mindful that sometimes our minds will play tricks on us.
| Tweet |
|
|
Tuesday, February 16, 2010
A quick shot of my galaxy simulation
I mentioned previously that I have been working on a galaxy simulation with a star forming region in the center. Things have been progressing, I think I can go to running 3D simulations sometime in the next two months. I will share more information when I have it, but I just wanted to share a cool picture that I made from my simulation.
This is a density map of the r and z directions (x and y, on this image) of a galaxy, or a slice in the x-z plane at y=0 if you prefer. So top and bottom of the image correspond to above and below the galaxy. We are looking at the galactic disk edge on.There are a few cool things about this image that made me excited, mostly the long filaments coming out of the galaxy. I was excited about this because that is almost exactly what we see in real galaxies, and is exactly what we are trying to find through simulations. The one problem I had here is I messed up with a certain parameter which made the galaxy not be in hydro-static equilibrium to start out, which means it kind of collapsed in on itself. That explains why the disk is so narrow and so dense.
[Update]
I failed to mention that this image was rendered in ParaView. I also have a few movies that I made relating to this simulation (again rendered in ParaView). A movie showing density can be found here (Note: It is large, 27 MB). Another showing speed (magnitude of velocity) can be found here (also large, 33 MB).
| Tweet |
|
|
Friday, September 18, 2009
Athena Magnetohydrodynamics (MHD) Code
Some of you (one of you) requested a little more information about the hydrodynamics code that I mentioned in a previous post. The code written in C is called Athena after the Greek goddess. The best basic overview of the code comes from the authors themselves:"Athena is a grid-based code for astrophysical gas dynamics, based on higher-order Godunov methods, with nested and adaptive mesh capabilities. The original development efforts were supported by the NSF Information Technology Research (ITR) program. As part of the project, Athena will be made freely available to the astrophysics community, along with complete documentation and web-based training material.
The current version of the code (v3.1) implements algorithms for:
- compressible hydrodynamics and ideal MHD in one-, two-, or three-spatial dimensions,
- ideal gas equation of state with arbitrary γ (including γ = 1, an isothermal EOS).
- first-, second- or third-order characteristic interpolation in the primitive variables,
- numerical fluxes computed using a variety of approximate and/or linearized Riemann solvers,
- source terms due to a static gravitational potential,
- self-gravity computed using FFTs,
- an arbitrary number of passive scalars advected with the flow,
- parallelization using domain decomposition with MPI.
The primary motivations for developing Athena are to (1) adapt higher-order Godunov schemes for astrophysical MHD, (2) use a single-step Eulerian update so the solver can be used with adaptive mesh refinement, (3) optimize and parallelize the implementation on modern, distributed memory processors, and (4) distribute the code to the astrophysics community with documentation and web-based training tools. The first three motivations are driven by our own research needs, the last is done in the hope the community will find the resulting code useful for their own research."
So that is how the authors of the code describe the it and now onto my opinion of the code. I found it very easy to pick up and learn how to use. For those who download the code it comes with several preworked examples that demonstrate different aspects of the code. The examples include several standard test problems (spherical blast wave, linear waves and others with more obscure names, usually after the people who first published a paper on that problem). The code comes with a user's guide which contains most of what is needed to get the code up and running. I think that it took me less than a week from when I downloaded the code to when I got the first examples running. Keep in mind that I had also just bought a laptop two days before I downloaded the code and I was in the process of making a Linux partition and making sure that I also had all of the necessary libraries and compilers necessary to run the code. So I was not just dealing with getting the code up and running but also getting my computer up and running for that first week. After that it was a matter of working through some of the examples, changing the inputs and figuring out how it all worked.
On a basic level the code is very simple to run. It only takes three commands to make it run and in some cases it only takes one. For example if I wanted to run my particular problem that I wrote, which I named Starburst, from the command line I would type:
configure --with-problem=starburst --with-gas=hydro
make all
./athena -i ../tst/2D-hydro/starburst.c
The first line sets up the problem and in general has the form: "configure [--enable-feature] [--disable-feature] [--with-package=choice]". The second compiles the code (and does a few more things). The last line actually runs the code and calls the input file "starburst.c". The individual problem files include all of the code needed to make the initial conditions (density, pressure etc.) as well as functions to include a gravitational potential, and functions to update certain cells every cycle (to be used, for example, to inject matter and energy into the center of a galaxy), along with several more useful functions designed for other specific purposes to control output etc.
The code is very versatile and can run on many processors (or just one like my laptop). The individual features available which are used with the configure command are given in the user's manual (snapshot shown below, the bold options are the defaults, click to see a larger and easier to read version):
As you may notice it includes an MHD option which is what makes Athena so powerful, and well known. Most people I have talked to about Athena view it a primarily an MHD code though it is also used for normal hydro stuff. Right now I am using it as a hydro code, but the plan is to eventually use it with MHD.
So overall the code is very easy to learn how to use and to get working. It is another matter (haha) to make it do something different, new and useful (preferably all three), and above all publishable. I would recommend using this code if you are looking into using a standard, ready to run out of the box code for hydrodynamics or MHD. I will now take questions.
Thursday, August 13, 2009
What I have been doing this summer
We are focusing on two galaxies to get a good idea of what is happening in their cores in order to understand AGN and galactic blowout. What is galactic blowout? That can best be explained with a picture. This picture was taken using Hubble Space Telescope by my advisor Gerald Cecil a while back. It is an image of central region of NGC 3079.
You can see the expanding bubble of gas in the middle. It is this expanding bubble that we are interested in. Notability the curvature of the filaments the source of the bubble and the circumstances that made it form. My job is to figure out a way to model this as realistically as possible.For that I have been learning how to use a hydrodynamics code called Athena. There were other codes I could have used (like VH-1 for example) but my other advisor Fabian Heitsch recommended Athena for this type of project. So I downloaded Athena and went to work figuring out how to use it. I would say that it is a very well written code (of the little that I have used it) and that it is very intuitive and easy to learn (it's written in C). Right now I have been making up some toy models to get a good sense of how it works and what I can do with it. Recently (this week) I have been working on getting the data out and into an interesting format (one that I can show people and wow them with). On that note I have a short video for you guys.
What I have here is an extremely simple (emphasis on extremely, and simple) model of the disk of a galaxy (a constant density disk with exponential fall off to halo densities, not very realistic but for now it works). I have insterted a "starburst" in the center with an over-pressure region (luminosity/supernova) along with some wind (i.e. kinetic energy, matter outflow). The computation is only doing 2D, and is small enough that I am running it on my laptop.
Here the x-y plane represents the computaion grid (250 grid points in the x, 500 in the y). The z axis is density. I took the output from Athena and fed it into MATLAB and turned it into a movie that I am posting here. I hope you enjoy. When I have real stuff (with good physical interpretation) I will post about that.
| Tweet |
|
|