From 7a713b1e67a255c285eef45d172ba0a1286987c3 Mon Sep 17 00:00:00 2001 From: Christian Kolset Date: Mon, 17 Nov 2025 16:42:04 -0700 Subject: Started working on schlieren imaging example (CFD) --- tutorials/module_4/schlieren/schlieren.py | 44 +++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 tutorials/module_4/schlieren/schlieren.py (limited to 'tutorials/module_4/schlieren/schlieren.py') diff --git a/tutorials/module_4/schlieren/schlieren.py b/tutorials/module_4/schlieren/schlieren.py new file mode 100644 index 0000000..45eda4e --- /dev/null +++ b/tutorials/module_4/schlieren/schlieren.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +""" +Created on Mon Nov 17 11:56:51 2025 + +Title: Schlieren Imagery Animation +@author: christian +""" + + + +import numpy as np +import matplotlib.pyplot as plt +from matplotlib import colormaps + + +# Load data +frames = np.arange(1,11) +density = [] + +for f in frames: + file = f"data/density{f:04d}.txt" + data = np.loadtxt(file) + print("loaded:", file, np.shape(data)) + density.append(data) + +mdm = np.stack(density) + +print(mdm) + + +""" +frame = np.loadtxt("density*.txt") +print(frame.shape) + +for i in frame: + np.loadtxt( + +x = np.linspace(0,10*np.pi,1000) +y = np.sin(x) + +plt.pcolormesh(x,y) +plt.show() +""" -- cgit v1.2.3