aerosandbox.geometry.airfoil.airfoil_families ============================================= .. py:module:: aerosandbox.geometry.airfoil.airfoil_families Attributes ---------- .. autoapisummary:: aerosandbox.geometry.airfoil.airfoil_families._default_n_points_per_side aerosandbox.geometry.airfoil.airfoil_families.af Functions --------- .. autoapisummary:: aerosandbox.geometry.airfoil.airfoil_families.get_NACA_coordinates aerosandbox.geometry.airfoil.airfoil_families.get_kulfan_coordinates aerosandbox.geometry.airfoil.airfoil_families.get_kulfan_parameters aerosandbox.geometry.airfoil.airfoil_families.get_coordinates_from_raw_dat aerosandbox.geometry.airfoil.airfoil_families.get_file_coordinates aerosandbox.geometry.airfoil.airfoil_families.get_UIUC_coordinates Module Contents --------------- .. py:data:: _default_n_points_per_side :value: 200 .. py:function:: get_NACA_coordinates(name = None, n_points_per_side = _default_n_points_per_side, max_camber = None, camber_loc = None, thickness = None) Returns the coordinates of a 4-series NACA airfoil. Can EITHER specify `name`, or all three of `max_camber`, `camber_loc`, and `thickness` - not both. :param Either: * name: Name of the NACA airfoil, as a string (e.g., "naca2412") :param Or: * All three of: max_camber: Maximum camber of the airfoil, as a fraction of chord (e.g., 0.02) camber_loc: The location of maximum camber, as a fraction of chord (e.g., 0.40) thickness: The maximum thickness of the airfoil, as a fraction of chord (e.g., 0.12) :param n_points_per_side: Number of points per side of the airfoil (top/bottom). Returns: The coordinates of the airfoil as a Nx2 ndarray [x, y] .. py:function:: get_kulfan_coordinates(lower_weights = -0.2 * np.ones(8), upper_weights = 0.2 * np.ones(8), leading_edge_weight = 0.0, TE_thickness = 0.0, n_points_per_side = _default_n_points_per_side, N1 = 0.5, N2 = 1.0, **deprecated_kwargs) Given a set of Kulfan parameters, computes the coordinates of the resulting airfoil. This function is the inverse of `get_kulfan_parameters()`. Kulfan parameters are a highly-efficient and flexible way to parameterize the shape of an airfoil. The particular flavor of Kulfan parameterization used in AeroSandbox is the "CST with LEM" method, which is described in various papers linked below. In total, the Kulfan parameterization consists of: * A vector of weights corresponding to the lower surface of the airfoil * A vector of weights corresponding to the upper surface of the airfoil * A scalar weight corresponding to the strength of a leading-edge camber mode shape of the airfoil (optional) * The trailing-edge (TE) thickness of the airfoil (optional) These Kulfan parameters are also referred to as CST (Class/Shape Transformation) parameters. References on Kulfan (CST) airfoils: * Kulfan, Brenda "Universal Parametric Geometry Representation Method" (2008). AIAA Journal of Aircraft. Describes the basic Kulfan (CST) airfoil parameterization. Mirrors: * https://arc.aiaa.org/doi/10.2514/1.29958 * https://www.brendakulfan.com/_files/ugd/169bff_6738e0f8d9074610942c53dfaea8e30c.pdf * https://www.researchgate.net/publication/245430684_Universal_Parametric_Geometry_Representation_Method * Kulfan, Brenda "Modification of CST Airfoil Representation Methodology" (2020). Unpublished note: Describes the optional "Leading-Edge Modification" (LEM) addition to the Kulfan (CST) airfoil parameterization. Mirrors: * https://www.brendakulfan.com/_files/ugd/169bff_16a868ad06af4fea946d299c6028fb13.pdf * https://www.researchgate.net/publication/343615711_Modification_of_CST_Airfoil_Representation_Methodology * Masters, D.A. "Geometric Comparison of Aerofoil Shape Parameterization Methods" (2017). AIAA Journal. Compares the Kulfan (CST) airfoil parameterization to other airfoil parameterizations. Also has further notes on the LEM addition. Mirrors: * https://arc.aiaa.org/doi/10.2514/1.J054943 * https://research-information.bris.ac.uk/ws/portalfiles/portal/91793513/SP_Journal_RED.pdf Notes on N1, N2 (shape factor) combinations: * 0.5, 1: Conventional airfoil * 0.5, 0.5: Elliptic airfoil * 1, 1: Biconvex airfoil * 0.75, 0.75: Sears-Haack body (radius distribution) * 0.75, 0.25: Low-drag projectile * 1, 0.001: Cone or wedge airfoil * 0.001, 0.001: Rectangle, circular duct, or circular rod. To make a Kulfan (CST) airfoil, use the following syntax: >>> import aerosandbox as asb >>> asb.Airfoil("My Airfoil Name", coordinates=asb.get_kulfan_coordinates(*args)) :param lower_weights: The Kulfan weights to use for the lower surface. :type lower_weights: iterable :param upper_weights: The Kulfan weights to use for the upper surface. :type upper_weights: iterable :param TE_thickness: The trailing-edge thickness to add, in terms of y/c. :type TE_thickness: float :param n_points_per_side: The number of points to discretize with, when generating the coordinates. :type n_points_per_side: int :param N1: The shape factor corresponding to the leading edge of the airfoil. See above for examples. :type N1: float :param N2: The shape factor corresponding to the trailing edge of the airfoil. See above for examples. :type N2: float :returns: The coordinates of the airfoil as a Nx2 array. :rtype: np.ndarray .. py:function:: get_kulfan_parameters(coordinates, n_weights_per_side = 8, N1 = 0.5, N2 = 1.0, n_points_per_side = _default_n_points_per_side, normalize_coordinates = True, use_leading_edge_modification = True, method = 'least_squares') Given a set of airfoil coordinates, reconstructs the Kulfan parameters that would recreate that airfoil. Uses a curve fitting (optimization) process. This function is the inverse of `get_kulfan_coordinates()`. Kulfan parameters are a highly-efficient and flexible way to parameterize the shape of an airfoil. The particular flavor of Kulfan parameterization used in AeroSandbox is the "CST with LEM" method, which is described in various papers linked below. In total, the Kulfan parameterization consists of: * A vector of weights corresponding to the lower surface of the airfoil * A vector of weights corresponding to the upper surface of the airfoil * A scalar weight corresponding to the strength of a leading-edge camber mode shape of the airfoil (optional) * The trailing-edge (TE) thickness of the airfoil (optional) These Kulfan parameters are also referred to as CST (Class/Shape Transformation) parameters. References on Kulfan (CST) airfoils: * Kulfan, Brenda "Universal Parametric Geometry Representation Method" (2008). AIAA Journal of Aircraft. Describes the basic Kulfan (CST) airfoil parameterization. Mirrors: * https://arc.aiaa.org/doi/10.2514/1.29958 * https://www.brendakulfan.com/_files/ugd/169bff_6738e0f8d9074610942c53dfaea8e30c.pdf * https://www.researchgate.net/publication/245430684_Universal_Parametric_Geometry_Representation_Method * Kulfan, Brenda "Modification of CST Airfoil Representation Methodology" (2020). Unpublished note: Describes the optional "Leading-Edge Modification" (LEM) addition to the Kulfan (CST) airfoil parameterization. Mirrors: * https://www.brendakulfan.com/_files/ugd/169bff_16a868ad06af4fea946d299c6028fb13.pdf * https://www.researchgate.net/publication/343615711_Modification_of_CST_Airfoil_Representation_Methodology * Masters, D.A. "Geometric Comparison of Aerofoil Shape Parameterization Methods" (2017). AIAA Journal. Compares the Kulfan (CST) airfoil parameterization to other airfoil parameterizations. Also has further notes on the LEM addition. Mirrors: * https://arc.aiaa.org/doi/10.2514/1.J054943 * https://research-information.bris.ac.uk/ws/portalfiles/portal/91793513/SP_Journal_RED.pdf Notes on N1, N2 (shape factor) combinations: * 0.5, 1: Conventional airfoil * 0.5, 0.5: Elliptic airfoil * 1, 1: Biconvex airfoil * 0.75, 0.75: Sears-Haack body (radius distribution) * 0.75, 0.25: Low-drag projectile * 1, 0.001: Cone or wedge airfoil * 0.001, 0.001: Rectangle, circular duct, or circular rod. The following demonstrates the reversibility of this function: >>> import aerosandbox as asb >>> from aerosandbox.geometry.airfoil.airfoil_families import get_kulfan_parameters >>> >>> af = asb.Airfoil("dae11") # A conventional airfoil >>> params = get_kulfan_parameters( >>> coordinates=af.coordinates, >>> ) >>> af_reconstructed = asb.Airfoil( >>> name="Reconstructed Airfoil", >>> coordinates=get_kulfan_coordinates( >>> **params >>> ) :param coordinates: The coordinates of the airfoil as a Nx2 array. :type coordinates: np.ndarray :param n_weights_per_side: The number of Kulfan weights to use per side of the airfoil. :type n_weights_per_side: int :param N1: The shape factor corresponding to the leading edge of the airfoil. See above for examples. :type N1: float :param N2: The shape factor corresponding to the trailing edge of the airfoil. See above for examples. :type N2: float :param n_points_per_side: The number of points to discretize with, when formulating the curve-fitting optimization problem. :type n_points_per_side: int :returns: * "lower_weights" (np.ndarray): The weights corresponding to the lower surface of the airfoil. * "upper_weights" (np.ndarray): The weights corresponding to the upper surface of the airfoil. * "TE_thickness" (float): The trailing-edge thickness of the airfoil. * "leading_edge_weight" (float): The strength of the leading-edge camber mode shape of the airfoil. These can be passed directly into `get_kulfan_coordinates()` to reconstruct the airfoil. :rtype: A dictionary containing the Kulfan parameters. The keys are .. py:function:: get_coordinates_from_raw_dat(raw_text) Returns a Nx2 ndarray of airfoil coordinates from the raw text of a airfoil *.dat file. :param raw_text: A list of strings, where each string is one line of the *.dat file. One good way to get this input is to read the file via the `with open(file, "r") as file:`, `file.readlines()` interface. Returns: A Nx2 ndarray of airfoil coordinates [x, y]. .. py:function:: get_file_coordinates(filepath) .. py:function:: get_UIUC_coordinates(name = 'dae11') Returns the coordinates of a specified airfoil in the UIUC airfoil database. :param name: Name of the airfoil to retrieve from the UIUC database. Returns: The coordinates of the airfoil as a Nx2 ndarray [x, y] .. py:data:: af