From 10abdebc0b129a9efd7656cb5895ed29d6a3c09d Mon Sep 17 00:00:00 2001 From: Amaury Bilocq <amaurybilocq@mbp-de-amaury-3.user.uliege.priv> Date: Fri, 28 Feb 2025 11:54:13 +0100 Subject: [PATCH] Remove print --- {doc => docs}/spectrum.png | Bin {doc => docs}/u.png | Bin pyTurbulence/poissonSolver.py | 6 ++++-- pyTurbulence/syntheticTurbulence.py | 5 ----- 4 files changed, 4 insertions(+), 7 deletions(-) rename {doc => docs}/spectrum.png (100%) rename {doc => docs}/u.png (100%) diff --git a/doc/spectrum.png b/docs/spectrum.png similarity index 100% rename from doc/spectrum.png rename to docs/spectrum.png diff --git a/doc/u.png b/docs/u.png similarity index 100% rename from doc/u.png rename to docs/u.png diff --git a/pyTurbulence/poissonSolver.py b/pyTurbulence/poissonSolver.py index f249b06..e16dbff 100644 --- a/pyTurbulence/poissonSolver.py +++ b/pyTurbulence/poissonSolver.py @@ -48,7 +48,8 @@ def poisson_2d(f, nx, ny, hx, hy)->np.ndarray: res[:, ny-1] = res[:, 0] return res -def poisson_3d(f, nx, ny, nz, hx, hy, hz)->np.ndarray: +def poisson_3d(f : np.ndarray, nx : int, ny : int, nz : int, + hx : float, hy : float, hz : float)->np.ndarray: """ Solve a 3D Poisson equation with periodic boundary conditions. @@ -102,7 +103,8 @@ def poisson_3d(f, nx, ny, nz, hx, hy, hz)->np.ndarray: res[:, :, nz-1] = res[:, :, 0] return res -def dilatational_velocities(theta, nx, ny, nz, hx, hy, hz)->np.ndarray: +def dilatational_velocities(theta : np.ndarray, nx : int, ny : int, nz : int, + hx : float, hy : float, hz : float)->np.ndarray: """ Compute the dilatational velocity field using Fourier space projection. diff --git a/pyTurbulence/syntheticTurbulence.py b/pyTurbulence/syntheticTurbulence.py index e2b7dfe..ee09627 100644 --- a/pyTurbulence/syntheticTurbulence.py +++ b/pyTurbulence/syntheticTurbulence.py @@ -280,17 +280,12 @@ def compute_dilatational_velocities(u: np.ndarray,v: np.ndarray,w: np.ndarray,p: hessian_rhs = np.array([np.gradient(grad, hx, hy, hz, edge_order=2) for grad in grad_rhs]) rhs_ij = np.einsum('ij...->...', hessian_rhs) rhs_ij *= 2.0 - - print(f"mean rhs_ij = {np.mean(rhs_ij)}") - ddt_p = poisson_3d(rhs_ij, nx, ny, nz, hx, hy, hz) # Compute dilatation from Eq.7 # -gamma*dilatation = ddt_p+v_k*dpdxk dilatation = -overGamma*(np.sum(velocity * gradPressure, axis=0) + ddt_p) - print(f"mean dilatation = {np.mean(dilatation)}") - # Compute dilatational velocity from Eq.12 vd_x, vd_y, vd_z = dilatational_velocities(dilatation, nx, ny, nz, hx, hy, hz) return vd_x, vd_y, vd_z -- GitLab