Skip to content

[Lessons 7 and 8] Methods should returns the velocity/streamfunction #41

@mesnardo

Description

@mesnardo

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions