예제 #1
0
파일: plots.py 프로젝트: rorimac/turbine
def diff_blade_plot(shw=False):
    inputData = [
        51.5, 90 - 15.92, 8., 1.1817, 75.4075, 29.2, 1., .0555, .0220, 30., 2.0
    ]
    turbine1 = SuctionSide.functionOfLambda(inputData, ('affineangle', ),
                                            'param', ('affinechord', ),
                                            'average', False)
    turbine2 = PressureSide(inputData, 'param', ('chordlength', ), 'radius')
    leading, trailing = leadingEdge(inputData), trailingEdge(inputData)
    fig = plt.figure(facecolor='white')
    turbine1(3.2).plot2D(100, False, fig, False, 'k-.')
    turbine1(3.3).plot2D(100, False, fig, False, 'k:')
    turbine1(3.4).plot2D(100, False, fig, False, 'k--')
    turbine2.plot2D(100, False, fig, False)
    leading.plot2D(100, False)
    trailing.plot2D(100, False)
    ax = plt.gca()
    ax.axis([-0.01, 1.01, -0.1, 1.3])
    ax.set_frame_on(False)
    ax.axes.get_yaxis().set_visible(False)
    ax.axes.get_xaxis().set_visible(False)
    ax.set_aspect('equal')
    if not shw:
        plt.savefig('../../latex/img/diff_blade_curve.pdf',
                    format='pdf',
                    dpi=1200,
                    bbox_inches='tight',
                    pad_inches=0)
    if shw:
        plt.show()
예제 #2
0
파일: plots.py 프로젝트: rorimac/turbine
def new_der_plot(shw=False):
    inputData = [
        51.5, 90 - 15.92, 8., 1.1817, 75.4075, 29.2, 1., .0555, .0220, 30., 2.0
    ]
    lambd = 3.4
    turbine1 = SuctionSide.functionOfLambda(inputData, ('affineangle', ),
                                            'fastparam', ('uniform', ),
                                            'average', False)
    turbine2 = PressureSide(inputData, 'fastparam', ('uniform', ), 'radius')
    leading, trailing = leadingEdge(inputData), trailingEdge(inputData)
    fig = plt.figure(facecolor='white')
    turbine1(lambd).plot2D(100, True, fig)
    turbine2.plot2D(100, True, fig, False)
    leading.plot2D(100, False)
    trailing.plot2D(100, False)

    ax = plt.gca()
    ax.set_frame_on(False)
    ax.get_xaxis().tick_bottom()
    ax.get_yaxis().tick_left()
    ax.set_aspect('equal')

    xticks = ax.xaxis.get_major_ticks()
    xticks[1].label1.set_visible(False)
    xticks[2].label1.set_visible(False)
    xticks[3].label1.set_visible(False)
    xticks[4].label1.set_visible(False)
    yticks = ax.yaxis.get_major_ticks()
    yticks[0].label1.set_visible(False)
    yticks[2].label1.set_visible(False)
    yticks[3].label1.set_visible(False)
    yticks[4].label1.set_visible(False)
    yticks[5].label1.set_visible(False)
    yticks[7].label1.set_visible(False)
    yticks[8].label1.set_visible(False)

    xmin, xmax = ax.get_xaxis().get_view_interval()
    ymin, ymax = ax.get_yaxis().get_view_interval()
    ax.add_artist(
        Line2D((xmin, xmax), (ymin, ymin), color='black', linewidth=2))
    ax.add_artist(
        Line2D((xmin, xmin), (ymin, ymax), color='black', linewidth=2))

    if not shw:
        plt.savefig('../../latex/img/new_der_curve.pdf',
                    format='pdf',
                    dpi=1200,
                    bbox_inches='tight',
                    pad_inches=0)
    if shw:
        plt.show()