Exemplo n.º 1
0
def tangent(start_step, end_step, IC_init, inhomo):
    '''
    Solve the tangent equation starting from IC_init for
    end_step - start_step time steps, starting from the start_step time step.
    After this function call, IC_init stores the solution after
    nsteps time steps.
    '''
    assert IC_init.shape == (c_channel.c_Nz(), 2, c_channel.c_dimR(),
                             c_channel.c_Nx() / 2)
    assert 0 <= start_step <= end_step <= c_channel.c_nsteps()
    c_channel.c_tangent(int(start_step), int(end_step), IC_init, int(inhomo))
Exemplo n.º 2
0
def velAvg(start_step,end_step,T,profile=True):
    '''
    returns the time averaged velocity profile
    '''
    if profile:
        uavg = np.zeros(c_channel.c_qpts())
    else:
        uavg = 0.0
        y, w = quad()

    assert 0 <= start_step <= end_step <= c_channel.c_nsteps() 
    for i in range(start_step,end_step):
        u = vel(i)
        u = (u.mean(2)).mean(0)
        if not(profile): u = u[c_channel.c_qpts()/2 + 1]
        uavg = uavg + (dt/T) * u  

    return uavg
Exemplo n.º 3
0
def IvelAvg(start_step,end_step,T,profile=True):
    '''
    returns the time averaged mean velocity sensitivity profile
    '''
    if profile:
        vavg = np.zeros(c_channel.c_qpts())
    else:
        vavg = 0.0
        y, w = quad()


   
    assert 0 <= start_step <= end_step <= c_channel.c_nsteps()
    for i in range(start_step,end_step):
        v = Ivel(i,project = False)
        v = (v.mean(2)).mean(0)
        if not(profile): v = v[c_channel.c_qpts()/2 + 1]
        vavg = vavg + (dt/T) * v

    return vavg
Exemplo n.º 4
0
def adjoint(start_step, end_step, AC_init, inhomo, strength):
    assert AC_init.shape == (c_channel.c_Nz(), 2, c_channel.c_dimR(),
                             c_channel.c_Nx() / 2)
    assert 0 <= end_step <= start_step <= c_channel.c_nsteps()
    c_channel.c_adjoint(int(start_step), int(end_step), AC_init, int(inhomo),
                        float(strength))