diff options
author | Adrian Kummerlaender | 2020-03-23 16:01:56 +0100 |
---|---|---|
committer | Adrian Kummerlaender | 2020-03-23 16:01:56 +0100 |
commit | 908c1dfbd41a1bfe2210e3cfba0e41fda0940371 (patch) | |
tree | c90d614f3cb23cbe906e92b24107cd2234f32586 /gasplot.py | |
parent | 58678cfc3956ac5a1dbec91392b41b1b73a31463 (diff) | |
download | boltzgas-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.py | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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) |