aboutsummaryrefslogtreecommitdiff
path: root/gasplot.py
diff options
context:
space:
mode:
authorAdrian Kummerlaender2020-03-23 16:01:56 +0100
committerAdrian Kummerlaender2020-03-23 16:01:56 +0100
commit908c1dfbd41a1bfe2210e3cfba0e41fda0940371 (patch)
treec90d614f3cb23cbe906e92b24107cd2234f32586 /gasplot.py
parent58678cfc3956ac5a1dbec91392b41b1b73a31463 (diff)
downloadboltzgas-908c1dfbd41a1bfe2210e3cfba0e41fda0940371.tar
boltzgas-908c1dfbd41a1bfe2210e3cfba0e41fda0940371.tar.gz
boltzgas-908c1dfbd41a1bfe2210e3cfba0e41fda0940371.tar.bz2
boltzgas-908c1dfbd41a1bfe2210e3cfba0e41fda0940371.tar.lz
boltzgas-908c1dfbd41a1bfe2210e3cfba0e41fda0940371.tar.xz
boltzgas-908c1dfbd41a1bfe2210e3cfba0e41fda0940371.tar.zst
boltzgas-908c1dfbd41a1bfe2210e3cfba0e41fda0940371.zip
Add some structure to view implementation
Diffstat (limited to 'gasplot.py')
-rw-r--r--gasplot.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/gasplot.py b/gasplot.py
index 8adfe4d..44b0a53 100644
--- a/gasplot.py
+++ b/gasplot.py
@@ -12,7 +12,12 @@ grid_width = 30
radius = 0.002
char_u = 1120
-config = HardSphereSetup(radius, char_u, *grid_of_random_velocity_particles(grid_width, radius, char_u))
+position, velocity = grid_of_random_velocity_particles(grid_width, radius, char_u)
+velocity[:,:] = 0
+velocity[0,0] = 10.75*char_u
+velocity[0,1] = -.25*char_u
+config = HardSphereSetup(radius, char_u, position, velocity)
+#config = HardSphereSetup(radius, char_u, *grid_of_random_velocity_particles(grid_width, radius, char_u))
gas = GasFlow(config)
m_nitrogen = 0.028 / const.N_A
@@ -21,7 +26,7 @@ def plot(step, velocities):
velocities = np.array([np.linalg.norm(v) for v in velocities])
maxwellian = stats.maxwell.fit(velocities)
- print("T = %.0f K; u_mean = %.0f [m/s]; energy = %.05f" % ((maxwellian[1]**2 / const.k * m_nitrogen, stats.maxwell.mean(*maxwellian), np.sum([x*2 for x in velocities]))))
+ print("T = %.0f K; u_mean = %.0f [m/s]; energy = %.05f" % ((maxwellian[1]**2 / const.k * m_nitrogen, stats.maxwell.mean(*maxwellian), np.sum([x**2 for x in velocities]))))
plt.figure()
@@ -52,4 +57,4 @@ def simulate(n_steps, section):
plot(i, velocities)
-simulate(10000, 500)
+simulate(100000, 1000)