Skip to content
Snippets Groups Projects
Commit 10abdebc authored by Amaury Bilocq's avatar Amaury Bilocq
Browse files

Remove print

parent 8dd6eb5d
No related branches found
No related tags found
No related merge requests found
Pipeline #53044 passed
File moved
File moved
......@@ -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.
......
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment