Skip to content

Conversation

mahgadalla
Copy link
Collaborator

No description provided.

return xx_up, xx_down, yy_up, yy_down

def max_thickness(self, interpolate=False):
def get_chord_line(self, lin_spaced=False, num=500):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This get does not return anything. Rename in compute_chord_line for example.

self.chord_line = np.array([self.xup_coordinates,
cl_y_coordinates])

def get_camber_line(self, interpolate=False, n_interpolated_points=500):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This get does not return anything. Rename in compute_camber_line for example.

self.get_chord_line(lin_spaced=interpolate,
num=n_interpolated_points)

camber = self.chord_line[1] + self.camber_line[1]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you sum?

trailing edge, hence both the leading and the trailing edges are always
unique.
"""
assert(self.xup_coordinates[0] == self.xdown_coordinates[0],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid assert statements, they are removed from code when the compiled code (using optimization flag) is generated. Replace with if..raise.

correspond to the same vertical sections, since this would imply
inaccurate measurements for obtaining the camberline.
"""
if (interpolate == True) or \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use backslash for line continuation PEP 3125.

@ndem0
Copy link
Member

ndem0 commented Mar 22, 2018

Try to write well-formatted commit and do not exceed to 72 characters per line (here some guidelines). Please consider more meaningful description for the pull-request.

# required.
cl_x_coordinates, yy_up, yy_down = \
self.interpolate_coordinates(num=n_interpolated_points)[1:]
cl_x_coordinates, yy_up, yy_down = (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need this bracket

n_points = self.camber_line[0].size
camber = np.zeros(n_points)
for i in range(n_points):
camber[i] = np.linalg.norm(self.chord_line[:,i]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this way the camber is always positive, but there are foils with negative camber.

@mahgadalla mahgadalla changed the title Mod Adding methods to compute, camber line, chord line, deform foil wrt max camber Mar 23, 2018
@mahgadalla mahgadalla changed the title Adding methods to compute, camber line, chord line, deform foil wrt max camber Add methods to compute camber line, chord line, deform foil wrt max camber Mar 23, 2018
@mahgadalla mahgadalla force-pushed the mod branch 2 times, most recently from a371ad0 to 1740ad4 Compare March 23, 2018 17:49
Copy link
Contributor

@mtezzele mtezzele left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not wrap the code by hand, use the code_formatter script: ./code_formatter.sh bladex/profilebase.py.

Check please the codacy issues introduced.

self.compute_camber_line(interpolate=interpolate,
n_interpolated_points=n_interpolated_points)

self.compute_chord_line(lin_spaced=interpolate,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uniform the name of the arguments

self.compute_camber_line(interpolate=interpolate,
n_interpolated_points=n_interpolated_points)
scaling_factor = max_camber_change_percent / 100. + 1.
self.camber_line[1][1:-2] *= scaling_factor # except LE and TE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since you are assuming the foil in the reference position you don't need to exclude LE and TE

self.camber_line = np.array(
[self.xup_coordinates, cl_y_coordinates])

def deform_camber_line(self, max_camber_change_percent=None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of checking whether max_camber_change_percent is None or not, do not assign a default value. Moreover you can rename the argument to percent_change

@mahgadalla mahgadalla force-pushed the mod branch 4 times, most recently from 6566a6a to 1e182bc Compare March 25, 2018 12:06
@mtezzele mtezzele merged commit 09b4f10 into mathLab:master Mar 26, 2018
@mahgadalla mahgadalla deleted the mod branch March 26, 2018 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants