PDA

View Full Version : Bi-spherical grid results (no content; pretty pictures)


Borodog
11-16-2006, 05:11 PM
A while back I was asking for help with some mathematics related to rotated spherical grids. The purpose of the inquiry was some work that I'm writing to adapt the numerical hydrodynamics code I use for my research to use the dual spherical coordinate grid "baseball" geometry described in the other post:

http://i27.photobucket.com/albums/c153/Borodog/yinyang.png

I eventually solved the problem myself (although the current implementation of the code is simpler; I simply dispense with conservation in the boundary zones and just do linear interpolation of the nearest zone averaged values; oh well).

Anyway, I got the bi-spherical hydro code up and running:

http://i27.photobucket.com/albums/c153/Borodog/Bispherical_test.gif

This is is a 2d run (polar and azimutal coordinates; constant radius) on the surface of a sphere, initialized with zero velocity, and an ambient density and pressure over the surface of the sphere except for a spherical region of 4 times the ambient values in the center of the red grid. This creates a shock wave that travels out and around the sphere. You can see shock has crossed onto the other (blue) grid.

FortunaMaximus
11-16-2006, 05:16 PM
Gorgeous.

However, I want to keepie-uppie the ball in the first pic. Heh.

hmkpoker
11-16-2006, 05:21 PM
Cliff notes: I'm smarter than you, nyah nyah.

vhawk01
11-16-2006, 05:21 PM
[ QUOTE ]
Cliff notes: I'm smarter than you, nyah nyah WITH PICTURES!!!!

[/ QUOTE ]

FYP, and it makes all the difference.

lastcardcharlie
11-16-2006, 07:14 PM
Have a good trip.

John21
11-16-2006, 09:54 PM
The ancient Greek mathematician Pythagoras died being pursued into a bean field. He felt unable to trample on any of the beans believing that the souls of man transformed into beans after death.

Lestat
11-16-2006, 10:00 PM
I often wonder what it would be like to understand this much about math. Would another world open up to me?

At least I can appreciate the pretty pictures. Just not like some of you guys can I guess.

FortunaMaximus
11-16-2006, 10:11 PM
[ QUOTE ]
The ancient Greek mathematician Pythagoras died being pursued into a bean field. He felt unable to trample on any of the beans believing that the souls of man transformed into beans after death.

[/ QUOTE ]

See, Pyth didn't tiptap. He no got that joga.

<rolls the ball left, rolls it right, fakes right, fades left, rolls around to the right, throws torso to the left, tip nutmegs defender, moonwalks carryin' the ball on a walk the dog, snaps it up, spins it up and backwards>

All about the hips, baby. Play on. /images/graemlins/grin.gif

Props, 'boro. That's OTT, man. Very nice.

Borodog
11-17-2006, 12:32 AM
I've already rewritten the whole scheme after realizing there was a subtle flaw in the implementation.

The way the hydro code works is via a method called operator splitting. The hydro solver is actually a one-dimensional solver. The code solves the equations of fluid dynamics in bundles of 1D strips in alternating orthogonal directions, for example x, then y, and finally z. To avoid a coordinate bias, each step alternates the ordering xyz, zyx. The mathematics is complex, but this removes a coordinate bias that would exist if it was always xyz, xyz, xyz, . . .

The problem with the scheme as I originally wrote it was that the two grids were being constantly updated in the normal manner of the operator splitting. This meant that essentially boundary conditions were being set with zones that had already been advanced along one coordinate, but not the other, and these two different time-step conditions are "mixed" by the way the two grids cross at odd angles.

There is still one last subtle problem that I have to fix tomorrow, that has to do with the interpolation. I realized that I assumed that the interpolation was always over the target zone a boundary zone falls in and the zones immediately to the "right" and "up" of it, i.e. by advancing both indeces by one. But on half the grid the boundary zones map in the opposite direction, and you have to decrement the indices on the target grid. Esentially, half the boundary conditions are slightly wrong; interpolated in the wrong direction.

Once I get some pretty pictures from the final code, I'll post them.

ShakeZula06
11-17-2006, 12:33 AM
[ QUOTE ]
I often wonder what it would be like to understand this much about math. Would another world open up to me?

At least I can appreciate the pretty pictures. Just not like some of you guys can I guess.

[/ QUOTE ]
Heh, same here

Borodog
11-18-2006, 10:20 AM
http://i27.photobucket.com/albums/c153/Borodog/baseball-test.png

hmkpoker
11-18-2006, 12:46 PM
Boro-

Incorporate time as a dimension, and make videos of the graphs. We'll all take a bong hit and enjoy the fruits of your hypocrisy /images/graemlins/wink.gif

Borodog
11-18-2006, 12:48 PM
I'm not being paid a dime to do this. This is all on my own time. So the joke's on . . . well, me.

Borodog
06-13-2007, 08:30 PM
Could possibly be a rickroll (http://www.youtube.com/watch?v=sbuOiyRVOiE).

Neuge
06-13-2007, 09:38 PM
I'm still not sure what the point of the bi-spherical grid is; i.e. couldn't you just use a spherical one? The way you implemented the bi-spherical grid is just begging boundary condition issues (though you realize that).

Also, what specific operator splitting method are you using? What code? Are these Euler or full Navier-Stokes?

Borodog
06-14-2007, 10:09 AM
[ QUOTE ]
Could possibly be a rickroll (http://www.youtube.com/watch?v=sbuOiyRVOiE).

[/ QUOTE ]

You Tube sucks; I replaced this video with this one:

http://www.youtube.com/watch?v=WcAC9FS1po8

(Still might be a rickroll, though).

Borodog
06-14-2007, 10:20 AM
[ QUOTE ]
I'm still not sure what the point of the bi-spherical grid is; i.e. couldn't you just use a spherical one?

[/ QUOTE ]

Because of the coordinate crash at the poles. The time step of the simulation depends on the time it takes the fluid or a sound wave to cross a zone; the smaller the zones, the smaller the timsteps. At the poles the azimuthal width of the zones goes to zero.

[ QUOTE ]
The way you implemented the bi-spherical grid is just begging boundary condition issues (though you realize that).

[/ QUOTE ]

Not really; conservation is not exact across the grid boundaries, and there is some overlap where the same fluid gets simulated twice, but if you cut off the corners of the two grids you can minimize the overlap, and the conservation is still better than many codes people use that can't even conserve on a single grid.

[ QUOTE ]
Also, what specific operator splitting method are you using?

[/ QUOTE ]

It's based on the PPMLR (piecewise-parabolic method, lagrangian remap) method of Woodward and Colella. The operators are split along orthogonal coordinates and then 1d hydro is done along every column. XYZ, ZYX to remove the coordinate bias.

[ QUOTE ]
What code?

[/ QUOTE ]

Virginia Hydrodynamics 1, AKA VH-1.

[ QUOTE ]
Are these Euler or full Navier-Stokes?

[/ QUOTE ]

Euler. We do astrophysics, where the viscosities are totally negligable.

Nielsio
06-14-2007, 12:19 PM
[ QUOTE ]
[ QUOTE ]
Could possibly be a rickroll (http://www.youtube.com/watch?v=sbuOiyRVOiE).

[/ QUOTE ]

You Tube sucks; I replaced this video with this one:

http://www.youtube.com/watch?v=WcAC9FS1po8

(Still might be a rickroll, though).

[/ QUOTE ]


I have no idea what happens here, but can you tell me if it's useful?

Borodog
06-14-2007, 04:24 PM
[ QUOTE ]
[ QUOTE ]
[ QUOTE ]
Could possibly be a rickroll (http://www.youtube.com/watch?v=sbuOiyRVOiE).

[/ QUOTE ]

You Tube sucks; I replaced this video with this one:

http://www.youtube.com/watch?v=WcAC9FS1po8

(Still might be a rickroll, though).

[/ QUOTE ]


I have no idea what happens here, but can you tell me if it's useful?

[/ QUOTE ]

It is totally useless. However, it is very cool.

Nielsio
06-14-2007, 05:13 PM
[ QUOTE ]
[ QUOTE ]
[ QUOTE ]
[ QUOTE ]
Could possibly be a rickroll (http://www.youtube.com/watch?v=sbuOiyRVOiE).

[/ QUOTE ]

You Tube sucks; I replaced this video with this one:

http://www.youtube.com/watch?v=WcAC9FS1po8

(Still might be a rickroll, though).

[/ QUOTE ]


I have no idea what happens here, but can you tell me if it's useful?

[/ QUOTE ]

It is totally useless. However, it is very cool.

[/ QUOTE ]


Gold star for liberty /images/graemlins/wink.gif

Neuge
06-14-2007, 05:40 PM
[ QUOTE ]
Because of the coordinate crash at the poles. The time step of the simulation depends on the time it takes the fluid or a sound wave to cross a zone; the smaller the zones, the smaller the timsteps. At the poles the azimuthal width of the zones goes to zero.

It's based on the PPMLR (piecewise-parabolic method, lagrangian remap) method of Woodward and Colella. The operators are split along orthogonal coordinates and then 1d hydro is done along every column. XYZ, ZYX to remove the coordinate bias.

[/ QUOTE ]
So the need for a bi-spherical grid is a consequence of the operator splitting?

[ QUOTE ]
Euler. We do astrophysics, where the viscosities are totally negligable.

[/ QUOTE ]
I'm not too knowledgeable about hyperbolic equations, just the basic Lax-Wendroff and (w)eno methods. I work in CFD with full N-S.

Borodog
06-14-2007, 07:18 PM
[ QUOTE ]
[ QUOTE ]
Because of the coordinate crash at the poles. The time step of the simulation depends on the time it takes the fluid or a sound wave to cross a zone; the smaller the zones, the smaller the timsteps. At the poles the azimuthal width of the zones goes to zero.

It's based on the PPMLR (piecewise-parabolic method, lagrangian remap) method of Woodward and Colella. The operators are split along orthogonal coordinates and then 1d hydro is done along every column. XYZ, ZYX to remove the coordinate bias.

[/ QUOTE ]
So the need for a bi-spherical grid is a consequence of the operator splitting?

[/ QUOTE ]

I doubt I would put it that way. It's a result of the fact that a spherical coordinate grid is used, which means that the azimuthal width of a zone goes to zero at the pole, meaning the time step goes to zero. Hard to get much simulation time with a zero time step.

The other problem is that you cannot calculate fluxes across the poles, since the area of the zone face touching the pole is zero. Hard to pass fluid through zero area.

[ QUOTE ]
[ QUOTE ]
Euler. We do astrophysics, where the viscosities are totally negligable.

[/ QUOTE ]
I'm not too knowledgeable about hyperbolic equations, just the basic Lax-Wendroff and (w)eno methods. I work in CFD with full N-S.

[/ QUOTE ]

PPM-LR is a fairly advanced technique compared to those. We use a 5 zone stencil to reconstruct parabolic interpolations of the fluid states to the left and right of each zone interface in a 1D column. Then we integrate under those parabolae to get a left and right states as input to the Riemann problem for every interface; essentially we treat each zone interface like a shock. We iteratively solve the Riemann problem to find the velocity of the zone interface (basically the velocity of the contact discontinuity of the mini shock). Using the velocity of the zone interface and the timestep, we can calculate how far each zone interface has moved, and given the density and the area of the zone interface, we can calculate how much fluid has crossed the original zone face. I.e. we calculate the fluxes across all the zone interfaces, and then conservatively shuffle the fluid back into the original grid. So the grid coordinates drift with the flow for one time step (hence a lagrangian method), but then we remap back onto the eulerian grid (hence lagrangian-remap).

Do that in the x direction, the y, then the z, and then reverse the order, zyx. This removes a coordinate bias that airses if you just try to do xyz, xyz, xyz.

Nielsio
06-14-2007, 07:26 PM
Boro and other lovers of physics animations:

http://gameplanets.blogspot.com/2007/06/physics-simulations.html

theblackkeys
06-16-2007, 03:15 AM
[ QUOTE ]
[ QUOTE ]
Could possibly be a rickroll (http://www.youtube.com/watch?v=sbuOiyRVOiE).

[/ QUOTE ]

You Tube sucks; I replaced this video with this one:

http://www.youtube.com/watch?v=WcAC9FS1po8

(Still might be a rickroll, though).

[/ QUOTE ]
Now this is trippy.
http://www.youtube.com/watch?v=sBQNnhfZ6CY&mode=related&search=

Also, I have no idea what this means?? /images/graemlins/confused.gif /images/graemlins/confused.gif /images/graemlins/confused.gif /images/graemlins/confused.gif /images/graemlins/confused.gif

Neuge
06-16-2007, 04:30 AM
[ QUOTE ]
[ QUOTE ]
So the need for a bi-spherical grid is a consequence of the operator splitting?

[/ QUOTE ]

I doubt I would put it that way. It's a result of the fact that a spherical coordinate grid is used, which means that the azimuthal width of a zone goes to zero at the pole, meaning the time step goes to zero. Hard to get much simulation time with a zero time step.

The other problem is that you cannot calculate fluxes across the poles, since the area of the zone face touching the pole is zero. Hard to pass fluid through zero area.

[/ QUOTE ]
I realize the azimuthal width going to zero constricts your CFL condition, but it seems to me that if you didn't split the operator it wouldn't be (as big of) a consideration. i.e. the azimuthal width going to zero obviously only affects one dimension, so when you split the operator your timestep is the minimum satisfying CFL in each respective direction. If you don't split the operator that condition may not necessarily be the case.

I'm probably wrong, but I'd like to see why.

Anyway, I suppose I'll post some of my pretty pictures. All are 3D spectral element simulations.

The first is a backwards step problem with a Reynolds number of 1000. The second is an Eulerian (diffusion dominated) particle concentration in a bifurcating domain at a Reynolds number of 3000, particle diameter of 3 nm and diffusion coefficient of 10e-2.

http://members.cox.net/bmerchant8/adv.gif

http://members.cox.net/bmerchant8/passbif.gif

Neuge
06-16-2007, 04:37 AM
[ QUOTE ]
Boro and other lovers of physics animations:

http://gameplanets.blogspot.com/2007/06/physics-simulations.html

[/ QUOTE ]
I've before been curious about what methods game designers use to model fluid systems. They obviously have to be computationally efficient, but don't have the constrictions that research codes do. The game codes have to look pretty and be fast, so obviously the first thing they'd throw out is conservation, which is usually a limiting factor on research code. Next they'd obviously attempt to parameterize turbulence models into empirical models instead of direct numerical simulations.

I'm just curious as to how far away from research codes they are.

Borodog
06-16-2007, 11:47 AM
I believe the fire simulations are based on Maya. The liquid stuff could be a number of incompressible finite element codes.

Maya is based on a similar scheme to the one used in Plasma Pong (http://www.plasmapong.com/).

Borodog
06-16-2007, 12:02 PM
Neuge,

If we didn't split the operators we'd have to use much higher resolution to get the same quality of simulation. Other methods all basically suck compared to PPM-LR at shock capturing, which is paramount in what we do. Also, for many applications conservation of angular momentum is trivially met is our code, since you are simulating around annuli of constant radius; just replace the transverse azimuthal momentum with the angular momentum in the radial advection step and voila, perfectly conserved angular momentum (well, to within machine round-off).

Plus, our method is conceptually and algorithmically very simple and easy to implement.

Borodog
06-16-2007, 12:24 PM
[ QUOTE ]
[ QUOTE ]
[ QUOTE ]
Could possibly be a rickroll (http://www.youtube.com/watch?v=sbuOiyRVOiE).

[/ QUOTE ]

You Tube sucks; I replaced this video with this one:

http://www.youtube.com/watch?v=WcAC9FS1po8

(Still might be a rickroll, though).

[/ QUOTE ]
Now this is trippy.
http://www.youtube.com/watch?v=sBQNnhfZ6CY&mode=related&search=

Also, I have no idea what this means?? /images/graemlins/confused.gif /images/graemlins/confused.gif /images/graemlins/confused.gif /images/graemlins/confused.gif /images/graemlins/confused.gif

[/ QUOTE ]

I made this simulation 3 or 4 years ago. I was working at a small college, and they had asked about implementing some sort of undergraduate research program, since they had no graduate physics program. I took my normal code, which is not built to simulate the flow around rigid objects, and modified it to do just that. Here's an image from another, similar simulation, of the flow around a wedge, not in a pipe (i.e. no reflecting upper and lower boundary conditions):

http://i27.photobucket.com/albums/c153/Borodog/Wedg2_jpg.jpg

Alas, this code was lost. I could recreate it if I wanted to. It took about an hour to write.