예제 #1
0
        gamma_dot_vec = xvec[K + K_star:2 * K + K_star]

        return gamma_vec, gamma_star_vec, gamma_dot_vec


################################################################################

if __name__ == '__main__':

    import timeit
    import read
    import matplotlib.pyplot as plt

    # # # select test case
    fname = '../test/h5input/goland_mod_Nsurf02_M003_N004_a040.aero_state.h5'
    haero = read.h5file(fname)
    tsdata = haero.ts00000

    # Static solver
    Sta = Static(tsdata)
    Sta.assemble_profiling()
    Sta.assemble()
    Sta.get_total_forces_gain()

    # random input
    Sta.u_ext = 1.0 + 0.30 * np.random.rand(3 * Sta.Kzeta)
    Sta.zeta_dot = 0.2 + 0.10 * np.random.rand(3 * Sta.Kzeta)
    Sta.zeta = 0.05 * (np.random.rand(3 * Sta.Kzeta) - 1.0)

    Sta.solve()
    Sta.reshape()
예제 #2
0
#savefold='./figs_plunge/k05/'
#
#filename='./res_plunge/k01/M16wk20cyc10'
#savefold='./figs_plunge/k01/'
#
#ktarget=0.1*np.float(filename[14:16])

##### Lift comparison
#filename='./res_plunge/k02/M16wk20cyc10'
#ktarget=0.25
filename = './res_plunge/k05/M40wk20cyc12'  #### HF
ktarget = 0.5
#filename='./res_plunge/k07/M16wk20cyc10'  ####<----- HF launched
#ktarget=0.75

S = read.h5file(filename).solver

################################################################################
#
### Analytical solution
#
#####
w0 = ktarget * S.Uabs / S.b
H = .5 * np.max(S.THZeta[:, :, 1])

# Garrik - induced drag
Cdv_an = an.garrick_drag_plunge(w0, H, S.chord, S.rho, S.Uabs, S.time)
hv_an = -H * np.cos(w0 * S.time)
dhv = w0 * H * np.sin(w0 * S.time)
aeffv_an = np.arctan(-dhv / S.Uabs)
예제 #3
0
        # stiffening factors
        self.Kss = Kss
        self.Krs = Krs
        self.Csr = Csr
        self.Crs = Crs
        self.Crr = Crr


if __name__ == '__main__':
    import read
    import configobj

    # select test case
    fname = '/home/sm6110/git/uvlm3d/test/h5input/smith_Nsurf01M04N12wk10_a040.state.h5'
    fname = '/home/sm6110/git/uvlm3d/test/h5input/smith_Nsurf02M04N12wk10_a040.state.h5'
    hd = read.h5file(fname)

    # read some setting
    file_settings = fname[:-8] + 'solver.txt'
    dict_config = configobj.ConfigObj(file_settings)

    # add settings for linear solver
    M, cref = 4., 1.
    Uinf = 25.
    dict_config['LinearUvlm'] = {
        'dt': cref / M / Uinf,
        'integr_order': 2,
        'Uref': 1.
    }

    Sol = AeroElaDyn(tsaero=hd.tsaero00000,
예제 #4
0
        string='something',
        complex=2. + 3.j,
        array_real=np.random.rand(3, 2, 4),
        array_complex=np.random.rand(2, 3, 4) + 1.j * np.random.rand(2, 3, 4),
        liststr=['a', 'list', 'of', 'strings'],
        listnums=[1, 2, 3, 4.],
        listcomplex=[1., 3, 2. + 3.j],
        listmix=[2., 4, 'lala', 3. + 1.j],
        listmix_sub=[2., 3, ['lala', 2], 3.j],
        listmat=[[1, 200], [1.j, 3]],
        listnotmat=[1, [1, 3]]  # not supported
    )

    Set.Sub.drop(float=3.4,
                 integer=1,
                 string='something',
                 complex=2. + 3.j,
                 liststr=['a', 'list', 'of', 'strings'],
                 ndarray=np.random.rand(3, 2, 4))

    print('saving...')
    h5file('.', 'testfile.h5', *(Set, ))

    # adding to h5 file
    Set = Output('mainset')
    Set.drop(newitem=3, newitem2=[2, 4, 6])
    h5file('.', 'testfile.h5', *(Set, ))

    import read
    h = read.h5file('./testfile.h5')
    embed()