In Lessons 7 (method of images) and 8 (source sheet), the methods velocity and stream_function should return the 2D arrays of the velocity field and streamfunction, instead of storing them as attributes of the object.
The method should return the contribution of a source point on a given Cartesian mesh-grid; no need to store the velocity field and streamfunction.
For example:
Instead of
def stream_function(self, X, Y):
self.psi = (self.strength / (2 * math.pi) *
numpy.arctan2((Y - self.y), (X - self.x)))
write
def stream_function(self, X, Y):
psi = (self.strength / (2 * math.pi) *
numpy.arctan2((Y - self.y), (X - self.x)))
return psi
In Lessons 7 (method of images) and 8 (source sheet), the methods
velocityandstream_functionshould return the 2D arrays of the velocity field and streamfunction, instead of storing them as attributes of the object.The method should return the contribution of a source point on a given Cartesian mesh-grid; no need to store the velocity field and streamfunction.
For example:
Instead of
write