Пример #1
0
    def __init__(self,
                 num_x=1,
                 num_z=1,
                 left_closed=False,
                 right_closed=False,
                 blunt_te=False):
        """
        Parameters
        ----------
        num_x : ``float``
           Number of surfaces in the chord-wise direction
        num_z : ``float``
           Number of surfaces in the span-wise direction
        left_closed, right_closed : ``bool``
           ``True`` if closed and 
           ``False`` if attached to another component
        """
        super(PGMwing, self).__init__()

        self._num_surf['x'] = num_x
        self._num_surf['z'] = num_z

        self._left_closed = left_closed
        self._right_closed = right_closed
        self._blunt_te = blunt_te

        self._ax1 = 3
        self._ax2 = 2

        self.faces['upp'] = PGMface(num_x, num_z)
        self.faces['low'] = PGMface(num_x, num_z)
Пример #2
0
    def __init__(self, num_x=1, num_y=1, num_z=1):
        """
        Parameters
        ----------
        num_x : ``float``
           Number of surfaces in the stream-wise direction
        num_z : ``float``
           Number of surfaces over the height
        num_z : ``float``
           Number of surfaces across the width
        """
        super(PGMshell, self).__init__()

        self._num_surf['x'] = num_x
        self._num_surf['y'] = num_y
        self._num_surf['z'] = num_z

        self._ax1 = 3
        self._ax2 = 1

        self.faces['rt0'] = PGMface(num_y, num_x)
        self.faces['tp0'] = PGMface(num_z, num_x)
        self.faces['lt0'] = PGMface(num_y, num_x)
        self.faces['bt0'] = PGMface(num_z, num_x)

        self.faces['rt1'] = PGMface(num_y, num_x)
        self.faces['tp1'] = PGMface(num_z, num_x)
        self.faces['lt1'] = PGMface(num_y, num_x)
        self.faces['bt1'] = PGMface(num_z, num_x)
Пример #3
0
    def __init__(self, config, comp, side, weight=0.1):
        """
        Parameters
        ----------
        config : ``PGMconfiguration``
           Pointer to the configuration containing this component
        comp : ``str``
           Name of the wing component
        side : ``str``
           The side of the wing being closed off by this tip:
           'right' for the v=0 side,
           'left' for the v=1 side
        weight : ``float``
           The weight given to the tangent vectors
           of the tip of the wing when interpolating
        """
        super(PGMtip, self).__init__()

        self._comp = config.comps[comp]
        self._side = side
        self._weight = weight

        self._num_surf_wing = self._comp.faces['upp']._num_surf['u']

        self.faces[''] = PGMface(2, self._num_surf_wing)
Пример #4
0
    def __init__(self, config, comp, side, weight=1):
        """
        Parameters
        ----------
        config : ``PGMconfiguration``
           Pointer to the configuration containing this component
        comp : ``str``
           Name of the body component
        side : ``str``
           The side of the body being closed off:
           'front' for the v=0 side,
           'rear' for the v=1 side
        weight : ``float``
           The weight given to the tangent vectors
           of the tip of the body when interpolating
        """
        super(PGMcone, self).__init__()

        self._comp = config.comps[comp]
        self._side = side
        self._weight = weight

        ny = self._comp.faces['rgt']._num_surf['u']
        nz = self._comp.faces['top']._num_surf['u']

        self._num_surf['y'] = ny
        self._num_surf['z'] = nz

        self.faces[''] = PGMface(ny, nz)
Пример #5
0
    def __init__(self,
                 config,
                 fcomp,
                 face,
                 vdir,
                 loc,
                 mcomp,
                 side,
                 fweight=0,
                 mweight=0):
        """
        Parameters
        ----------
        config : ``PGMconfiguration``
           Pointer to the configuration containing this component
        fcomp : ``str``
           Name of the 'female' component
           (the one to which the wing is attached)
        face : ``str``
           Name of the face on the female component
           to which the wing is attached
        vdir : ``str``
           Direction the v axis (of the face of the female component)
           is pointing: 'E', 'N', 'W', or 'S'
        loc : ``list`` of 2 ``int``s
           The 'i' and 'j' indices of the northwest-most face
           of the junction when viewed
           with the wing's upper surface facing up
        mcomp : ``str``
           Name of the 'male' component
           (the one being attached to the female component)
        side : ``str``
           The side of wing being attached:
           'right' for the v=0 side,
           'left' for the v=1 side
        fweight : ``float``
           The weight applied to the tangent vectors
           of the female component when interpolating
        mweight : ``float``
           The weight given to the tangent vectors
           of the male component when interpolating
        """
        super(PGMjunction, self).__init__()

        self._fcomp = config.comps[fcomp].faces[face]

        #####################################################
        self._fcomp_other = None
        if face == 'lft':
            self._fcomp_other = config.comps[fcomp].faces['bot']
        elif face == 'rgt':
            self._fcomp_other = config.comps[fcomp].faces['bot']
        #####################################################

        self._loc = {'u': loc[0], 'v': loc[1]}
        self._mcomp = config.comps[mcomp]
        self._side = side

        #Check if the user gave a single weight for all the edges or if he specified one weight for each edge
        self._fweight = numpy.zeros(6)
        self._mweight = numpy.zeros(6)
        self._fweight[:] = fweight
        self._mweight[:] = mweight

        self._num_surf_wing = self._mcomp.faces['upp']._num_surf['u']

        self.faces[''] = PGMface(3, 2 + self._num_surf_wing)
        self.faces['']._surf_indices[1, :] = -1

        if vdir == 'E':
            self._rotate = lambda P: P
            self._flip = lambda nu, nv: [nu, nv]
        elif vdir == 'N':
            self._rotate = lambda P: numpy.swapaxes(P, 0, 1)[::-1, :]
            self._flip = lambda nu, nv: [nv[::-1], nu]
        elif vdir == 'W':
            self._rotate = lambda P: P[::-1, ::-1]
            self._flip = lambda nu, nv: [nu[::-1], nv[::-1]]
        elif vdir == 'S':
            self._rotate = lambda P: numpy.swapaxes(P, 0, 1)[:, ::-1]
            self._flip = lambda nu, nv: [nv, nu[::-1]]