コード例 #1
0
def postprocess(solver, time, suffix=''):
    mesh = solver.mesh

    point = np.array([0.052641, -0.1, 0.005])
    normal = np.array([1., 0., 0.])
    patches = ['pressure', 'suction']

    pprint('postprocessing', time)
    rho, rhoU, rhoE = solver.initFields(solver.readFields(time, suffix=suffix))
    U, T, p = solver.primitive(rho, rhoU, rhoE)
    T0 = 420.
    p0 = solver.p.phi.BC['inlet'].patch['_pt'][0, 0]
    #p0 = 177000.
    print p0

    htc = getHTC(T, T0, patches)
    Ma = getIsentropicMa(p, p0, patches)
    print Ma
    wakeCells, pl = getPressureLoss(p, T, U, p0, point, normal)
    uplus, yplus, ustar, yplus1 = getYPlus(U, T, rho, patches)

    #for patchID in patches:
    #    startFace = mesh.boundary[patchID]['startFace']
    #    endFace = startFace + mesh.boundary[patchID]['nFaces']
    #    index = 0
    #    mult = np.logspace(0, 2, 100)
    #    points = mesh.faceCentres[startFace + index] \
    #           - mesh.normals[startFace + index]*yplus1[patchID][index]*mult.reshape(-1,1)
    #    field = U.interpolate(points)/ustar[patchID][index]
    #    field = ((field**2).sum(axis=1))**0.5
    #    plt.plot(mult, field)
    #    plt.show()

    htc = IOField.boundaryField('htc' + suffix, htc, (1, ))
    Ma = IOField.boundaryField('Ma' + suffix, Ma, (1, ))
    uplus = IOField.boundaryField('uplus' + suffix, uplus, (3, ))
    yplus = IOField.boundaryField('yplus' + suffix, yplus, (1, ))
    with IOField.handle(time):
        htc.write()
        Ma.write()
        uplus.write()
        yplus.write()
コード例 #2
0
def postprocess(solver, time, suffix=''):

    #T0 = 365.
    #p0 = 122300.
    #point = np.array([0.081 + 0.023*0.03973,-0.06,0.005])
    #normal = np.array([1.,0.,0.])

    T0 = 409.
    p0 = 184900.
    # valid?
    point = np.array([0.052641, -0.1, 0.005])
    normal = np.array([1., 0., 0.])

    #patches = [surface + '_pressure', surface + '_suction']
    patches = [
        'blade_pressure', 'blade_suction', 'blade0_pressure', 'blade0_suction',
        'nozzle_pressure', 'nozzle_suction'
    ]

    pprint('postprocessing', time)
    rho, rhoU, rhoE = solver.initFields(time, suffix=suffix)
    U, T, p = solver.U, solver.T, solver.p

    htc = getHTC(T, T0, patches)
    Ma = getIsentropicMa(p, p0, patches)
    wakeCells, pl = getPressureLoss(p, T, U, p0, point, normal)
    uplus, yplus, _, _ = getYPlus(U, T, rho, patches)

    htc = IOField.boundaryField('htc' + suffix, htc, (1, ))
    Ma = IOField.boundaryField('Ma' + suffix, Ma, (1, ))
    uplus = IOField.boundaryField('uplus' + suffix, uplus, (3, ))
    yplus = IOField.boundaryField('yplus' + suffix, yplus, (1, ))
    with IOField.handle(time):
        #htc.write()
        #Ma.write()
        uplus.write()
        yplus.write()