diff options
author | eug-vs <eugene@eug-vs.xyz> | 2022-05-25 11:22:16 +0400 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2022-05-25 11:22:38 +0400 |
commit | cdb1ea09b5173576d795b99debc30219072a095d (patch) | |
tree | 0da884741dfa839d904493aedc178e459d04c232 | |
parent | d7c9c3dfed2d30f8a9a30cf8d15fff402adf0006 (diff) | |
download | CFD-SIMPLE-cdb1ea09b5173576d795b99debc30219072a095d.tar.gz |
feat: improve plotting
-rw-r--r-- | src/plotter.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/plotter.py b/src/plotter.py index d19d344..c803f3f 100644 --- a/src/plotter.py +++ b/src/plotter.py @@ -22,7 +22,6 @@ class Plotter: def plot(self, model, normalize=True, density=False, save_path=''): self.clear() - self.patch = axes.add_patch(Rectangle((0, 0), *reversed(model.bfs_size), color='gray')) axes.set_title('Velocity field (normalized)') plt.suptitle(f'Avg mass source per grid point = {model.avg_error()}') plt.xlabel('X') @@ -41,14 +40,14 @@ class Plotter: density = density or int((max(model.domain_size) / model.step) / 40) + plt.contourf(x, y, model.p) + # self.patch = axes.add_patch(Rectangle((0, 0), *reversed(model.bfs_size), color='gray')) + # TODO: allow using streamplot self.plt = plt.quiver( x[::density, ::density], y[::density, ::density], u[::density, ::density], v[::density, ::density], - model.p[::density, ::density], - scale=30, - cmap='inferno' ) self.colorbar = plt.colorbar(label='Pressure') |