diff options
-rw-r--r-- | random_velocities.py | 23 | ||||
-rw-r--r-- | zero_velocities.py (renamed from gas.py) | 0 |
2 files changed, 23 insertions, 0 deletions
diff --git a/random_velocities.py b/random_velocities.py new file mode 100644 index 0000000..cf7a503 --- /dev/null +++ b/random_velocities.py @@ -0,0 +1,23 @@ +import boltzgas.visualizer + +from boltzgas import HardSphereSetup, HardSphereSimulation +from boltzgas.initial_condition import grid_of_random_velocity_particles +from boltzgas.visual import VelocityHistogram, ColoredBox, Tracer + +grid_width = 50 +radius = 0.002 +char_u = 1120 + +position, velocity = grid_of_random_velocity_particles(grid_width, radius, char_u) + +config = HardSphereSetup(radius, char_u, position, velocity) +gas = HardSphereSimulation(config, opengl = True) + +tracer = Tracer(gas, int((grid_width**2)/2+grid_width/2)) +histogram = VelocityHistogram(gas, [1.1,0], [1,1]) + +decorations = [ ColoredBox([0,0], [1,1], (0.2,0.2,0.2)), tracer ] +instruments = [ histogram, tracer ] +windows = [ histogram ] + +boltzgas.visualizer.simulate(config, gas, instruments, decorations, windows) diff --git a/gas.py b/zero_velocities.py index 135796a..135796a 100644 --- a/gas.py +++ b/zero_velocities.py |