ParamFileΒΆ

Module to read and write a parameter file which can be used for parameters deformations.

ParamFile._check_params Private method that is called while writing a parameter file.
ParamFile.__str__ This method prints all the parameters on the screen.
ParamFile.read_parameters Reads in the parameters file and fill the self structure.
ParamFile.write_parameters This method writes a parameters file (.prm) called filename and fills it with all the parameters class members.
class ParamFile[source]

Bases: object

Read and Write a parameter file

Variables:
  • radii (array_like) – contains radii values of the blade sectional profiles, starting from the hub. Default value is None
  • parameters (dict) – dictionary that contains the radial distribution of parameters chord, pitch, rake, skew, camber at specific blade sections. Each element of the dictionary is an array_like of length equals to that of the array radii. Both parameters chord and camber descibes the chord length and the camber of the 2D foil representing the blade section. Possible dictionary keys are chord, pitch, rake, skew, camber. Default values are None
  • nbasis (dict) – dictionary that contains number of control points for each parameter. Possible dictionary keys are: chord, pitch, rake, skew, camber
  • degree (dict) – dictionary that contains degree of the BSpline to be constructed according to the parameter radial distribution. Possible dictionary keys are: chord, pitch, rake, skew, camber
  • npoints (dict) – dictionary that contains number of points to be evaluated using the BSpline interpolation, for each of the parameter curves. Possible dictionary keys for the parameters are: chord, pitch, rake, skew, camber
  • deformations (dict) – dictionary that contains the control points Y-deformations of the parameter BSpline curve. Possible dictionary keys are: chord, pitch, rake, skew, camber
_check_params()[source]

Private method that is called while writing a parameter file.

1. The method checks if the user specifies a radii array, otherwise it raises exception.

2. In case no values assigned to any of the remaining parameter arrays then an array of zeros is assigned, in which its length is equal to the radii array.

3. Any array that is not numpy is converted to be one. Finally, in case the user specifies the parameter array values but not with same length, then an exception is raised.

read_parameters(filename='parameters.prm')[source]

Reads in the parameters file and fill the self structure.

Parameters:filename (str) – parameters file to be read in. Default value is parameters.prm
write_parameters(filename='parameters.prm')[source]

This method writes a parameters file (.prm) called filename and fills it with all the parameters class members. Default value is parameters.prm.

Parameters:
  • filename (str) – parameters file to be written out.
  • param_pptc (bool) – if True, then the parameter arrays are replaced with that of the benchmark PPTC propeller.