Skip to content

Instantly share code, notes, and snippets.

View thebarbariccrayon's full-sized avatar

David Lewellyn thebarbariccrayon

View GitHub Profile
@gauravsdeshmukh
gauravsdeshmukh / FlowPy_FD_functions.py
Last active December 24, 2023 10:25
This gist contains three functions for the implementation of the predictor-corrector finite difference scheme for the solution of the incompressible Navier-Stokes equations.
#The first function is used to get starred velocities from u and v at timestep t
def GetStarredVelocities(space,fluid):
#Save object attributes as local variable with explicity typing for improved readability
rows=int(space.rowpts)
cols=int(space.colpts)
u=space.u.astype(float,copy=False)
v=space.v.astype(float,copy=False)
dx=float(space.dx)
dy=float(space.dy)
dt=float(space.dt)