Atomic Bomb Simulator 2D visualization

Atomic Bomb Simulator 2D visualization









Image description: Left image shows the fireball of the “Little Boy” atomic bomb detonating only seconds ago while the second image on the right shows conditions about 30 seconds later.

The atomic bomb simulator was created to demonstrate basic mechanics behind a Hiroshima style nuclear explosion. This simulator was created from the existing source code of the space-gun software game created in C++ and OpenGL API.

The yellow color fireball above is a 370m diameter fireball that has a temperature of 6,000 degrees C. The red circles are sound waves that ping every one second. The pyramid is a crude representation of Mt Everest and the white smaller pointy triangular object is a crude representation of the tallest building in the world that is roughly 800m tall. The ground is roughly the thickness of the Earth’s crust as is the blue surface representing the average depth of the ocean. On the left image the fireball is only a few seconds old and rising at a supersonic speed.

On the right image the fireball has matured and risen to 30,000 ft and has created a concentrated shock-wave because of the fact that the fireball has broken the sound barrier. At this point the fireball is roughly at Mach 1 (speed of sound) and the red sound waves have barely caught up with it rising up toward space. The yellow color of the fireball will gradually fade as it gradually cools to ambient temperature.

Scientific Accuracy:

The scientific community has discussed this software in: PhysicsForums .This software was created to simulate multiple scientific disciplines, namely:

  1. Atmospheric Pressure
  2. Pressure
  3. Ideal Gas Laws(Thermodynamics)
  4. Adiabatic Process(Thermodynamics)
  5. Temperature(Thermodynamics)
  6. Kinetic Theory of Gases
  7. Volume
  8. Avogadro’s Constant
  9. Buoyancy
  10. Air Drag
  11. Drag Coefficients
  12. Speed of Sound
  13. Mach Number

The above disciplines are linked to the related article in Wikipedia .

Source Code Samples

Formulas from each article were used in the software algorithm:

Gas Law code:

void InitExplosion()
Density = Fluid_Density;
Mass = Density * Volume;
Gravitationally_Effected = false;

static double P,V,R,T;
T = Fluid_Temperature_K;
P = Fluid_Pressure;
V = Volume;
n = (P*V)/(R*T);

//printf(“\n Fluid_Pressure = %f”,Fluid_Pressure);
//Change the Temperature here
Explosive_Pressure = n*R*Explosive_Temperature_K/Volume;

Explosive_Pressure_Initial = Explosive_Pressure;
Explosive_Temperature_K_Initial = Explosive_Temperature_K;
Explosive_Volume_Initial = Volume;

Kinetic Theory of Gas code:

B_Constant = 0.0000000000000000000000138;

Avogrado = 6.02*(10^23);

particle_speed = (3/2)*GAS_CONSTANT_R*Explosive_Temperature_K;
particle_speed /= (0.5)*(Mass/n);

mydeltaRadiusRate = particle_speed/1000;


deltaVolume = (4/3)*PI*pow(mydeltaRadiusRate*TimeInterval,3);
Volume += deltaVolume;

© 2017 A Theme