• While Stormtrack has discontinued its hosting of SpotterNetwork support on the forums, keep in mind that support for SpotterNetwork issues is available by emailing [email protected].

Basic Weather Simulation

Joined
Sep 2, 2008
Messages
86
Location
Newcastle, UK (the weather sucks here!)
I've been wanting to create a simple weather simulator for a while, but I'm not really sure on how to approach this.

I was thinking of having three 3d arrays, one would hold the temperature of each segment of air, one would hold humidity, and the last pressure. I have no idea how these elements would interact though. I was thinking about using the ideal gas equation, but I could only really use that to simulate how the volume of a parcel of air changes with temperature, pressure and humidity.

Has anyone attempted anything similar, or have any idea on how I could begin writing this program?

Cheers,
-Sam Kennedy
 
The task you are setting about is not easy. I would suggest starting with a 2d simulation first, for simplicity. Plan to take months, if not longer. You will also need the wind field in component form. For a 2d simulation thats 2 fields, for 3d, 3. Some simple models have a vorticity field directly stored instead of the wind. Eventually you will want cloud water and precip water too. Then, you use a number of equations to advect stuff about, and change it. The ideal gas law is certainly one equation you would use, but there are many others. I would start without humidity or precip. Get the basics working, then add humidity. Just getting a blob of hot air or vorticity center to advect across your grid is quite a challenge. Theres are all sorts of numerical stability concerns you will run into in addition to the physics. Get to know things like the CFL criteria and the different basic convection techniques (hint: use forward upstream differencing for convective scale models and leapfrog for synoptic scale models).

You could look at this book as well, but overall I am not a big fan of it.

http://www.amazon.com/Mesoscale-Meteorological-Modeling-International-Geophysics/dp/0125547668

I am on the road so I can't give detailed answers, but there are a couple other modellers here that I'm sure will post soon.
 
Here is the output of a simple simulation I made in QBASIC, with laws of physics which I completely made up:
2nbttmf.png


It sort of behaves how I would expect, as the temperature decreases the parcel of air moves more slowly, and the wind coming from the left has more of an effect on the direction the parcel moves.

The code pretty much works like this:
1) the "temperature" of the parcel is set (in this case 27 arbitrary units)
2) the position (x,y) is set
3) two random number generators work against each other, the difference between the two numbers generated determines whether the parcel begins moving to the right or the left, the "wind" biases one of the random number generators
4) the difference in temperature between the parcel and surrounding parcels determines how quickly it ascends
5) the temperature of the parcel decreases by a small (random) amount

Any way I can make this more realistic, without requiring a phd in mathematics?
 
Here is the output of a simple simulation I made in QBASIC, with laws of physics which I completely made up:
2nbttmf.png


It sort of behaves how I would expect, as the temperature decreases the parcel of air moves more slowly, and the wind coming from the left has more of an effect on the direction the parcel moves.

The code pretty much works like this:
1) the "temperature" of the parcel is set (in this case 27 arbitrary units)
2) the position (x,y) is set
3) two random number generators work against each other, the difference between the two numbers generated determines whether the parcel begins moving to the right or the left, the "wind" biases one of the random number generators
4) the difference in temperature between the parcel and surrounding parcels determines how quickly it ascends
5) the temperature of the parcel decreases by a small (random) amount

Any way I can make this more realistic, without requiring a phd in mathematics?

A phd in Math is hardly a requirement, but if I were to embark on this I would dive into OpenGL/Graphics, and make sure I understand the physics and equations behind whats going on through meteorology, fluid mechanics etc... Good luck.
 
A phd in Math is hardly a requirement, but if I were to embark on this I would dive into OpenGL/Graphics, and make sure I understand the physics and equations behind whats going on through meteorology, fluid mechanics etc... Good luck.

Any suggestions of where I can learn about the relevant physics/equations etc? I had a look inside that other book, it's way too complicated, I'm not going for something really accurate, just something I can play around with and see the results.
 
Any suggestions of where I can learn about the relevant physics/equations etc? I had a look inside that other book, it's way too complicated, I'm not going for something really accurate, just something I can play around with and see the results.

If you're actually serious about conducting simulations of the weather there really is no overlap between accuracy (to an extent) and something that is simple. The atmosphere is very complicated, and even the most fundamental governing equations are partial differential equations. One book I would suggest that provides these governing equations (although not all in the same location) is Dynamic Meteorology by Holton.
 
Holton is real heavy on the math too, so if you don't like Pielke for that reason you probably won't like Holton either. I'm not a big fan of the math only approach either. Some more intermediate level texts that contain a little bit less math are Meteorology for Scientists and Engineers by Stull, and Wallace and Hobbs.

http://www.amazon.com/Atmospheric-Science-Second-Edition-International/dp/012732951X
http://www.amazon.com/Meteorology-Scientists-Engineers-Roland-Stull/dp/0534372147

I don't believe these address all the numerical modelling and stability concerns, but they cover atmospheric physics in a less math-intense manner. Theres still a good bit of math in Stull, but not as much as Holton or Pielke.
 
My point in my post was that you won't get anything that realistically mimics the true atmosphere if you settle for simplicity. The atmosphere is far from simple.
 
"My point in my post was that you won't get anything that realistically mimics the true atmosphere if you settle for simplicity. The atmosphere is far from simple."

I certainly agree with that. Regardless of whether you start with a math background, physics, or CS, a realistic simulation will be a long and difficult project.
 
Back
Top