Exemple #1
0
def run_pullout_multi(*args, **kw):
    po = PullOutModel(name='t33_pullout_multilinear',
                      n_e_x=100,
                      k_max=1000,
                      u_f0_max=2.0)
    po.tline.step = 0.02
    po.geometry.L_x = 200.0
    po.loading_scenario.set(loading_type='monotonic')
    po.cross_section.set(A_f=16.67 / 9.0, P_b=1.0, A_m=1540.0)
    po.mats_eval.set(s_data='0, 0.1, 0.4, 4.0', tau_data='0, 70.0, 0, 0')
    po.mats_eval.update_bs_law = True
    po.run()

    w = BMCSWindow(model=po)
    #     po.add_viz2d('load function', 'load-time')
    po.add_viz2d('F-w', 'load-displacement')
    po.add_viz2d('field', 'u_C', plot_fn='u_C')
    #     po.add_viz2d('dissipation', 'dissipation')
    po.add_viz2d('field', 'eps_C', plot_fn='eps_C')
    po.add_viz2d('field', 's', plot_fn='s')
    po.add_viz2d('field', 'sig_C', plot_fn='sig_C')
    po.add_viz2d('field', 'sf', plot_fn='sf')
    #     po.add_viz2d('dissipation rate', 'dissipation rate')

    w.offline = False
    w.finish_event = True
    w.configure_traits(*args, **kw)
Exemple #2
0
def run_pullout_multilinear(*args, **kw):
    po = PullOutModel(name='t33_pullout_multilinear',
                      title='Multi-linear bond slip law',
                      n_e_x=20,
                      k_max=1000,
                      w_max=1.5)
    po.tline.step = 0.05
    po.geometry.L_x = 200.0
    po.loading_scenario.set(loading_type='monotonic')
    po.cross_section.set(A_f=16.67 / 9.0, P_b=1.0, A_m=1540.0)
    po.mats_eval.set(s_data='0, 0.1, 0.4, 1.7', tau_data='0, 70, 0, 0')
    po.mats_eval.update_bs_law = True

    w = BMCSWindow(model=po)
    po.add_viz2d('load function', 'load-time')
    po.add_viz2d('F-w', 'load-displacement')
    po.add_viz2d('field', 'u_C', plot_fn='u_C')
    po.add_viz2d('dissipation', 'dissipation')
    po.add_viz2d('field', 'eps_C', plot_fn='eps_C')
    po.add_viz2d('field', 's', plot_fn='s')
    po.add_viz2d('field', 'sig_C', plot_fn='sig_C')
    po.add_viz2d('field', 'sf', plot_fn='sf')
    po.add_viz2d('dissipation rate', 'dissipation rate')

    w.viz_sheet.viz2d_dict['u_C'].visible = False
    w.viz_sheet.viz2d_dict['load-time'].visible = False
    w.viz_sheet.viz2d_dict['dissipation rate'].visible = False
    w.viz_sheet.monitor_chunk_size = 10
    w.viz_sheet.reference_viz2d_name = 'load-displacement'

    w.run()
    w.offline = True
    w.configure_traits(*args, **kw)
Exemple #3
0
def run_pullout_dp(*args, **kw):
    po = PullOutModel(n_e_x=100, k_max=500, w_max=1.5)
    po.tline.step = 0.01
    po.geometry.L_x = 200.0
    po.loading_scenario.trait_set(loading_type='monotonic')
    po.cross_section.trait_set(A_f=16.67, P_b=1.0, A_m=1540.0)
    po.trait_set(mats_eval_type='damage-plasticity')
    po.mats_eval.trait_set(gamma=0.0, K=15.0, tau_bar=45.0)
    po.mats_eval.trait_set(omega_fn_type='li')
    po.mats_eval.omega_fn.trait_set(alpha_2=1.0, plot_max=10.0)

    w = BMCSWindow(model=po)
    po.add_viz2d('load function', 'load-time')
    po.add_viz2d('F-w', 'load-displacement')
    po.add_viz2d('field', 'u_C', plot_fn='u_C')
    po.add_viz2d('field', 'omega', plot_fn='omega')
    po.add_viz2d('field', 'eps_C', plot_fn='eps_C')
    po.add_viz2d('field', 's', plot_fn='s')
    po.add_viz2d('field', 'sig_C', plot_fn='sig_C')
    po.add_viz2d('field', 'sf', plot_fn='sf')
    po.add_viz2d('dissipation', 'dissipation')
    po.add_viz2d('dissipation rate', 'dissipation rate')

    w.viz_sheet.viz2d_dict['u_C'].visible = False
    w.viz_sheet.viz2d_dict['load-time'].visible = False
    w.viz_sheet.viz2d_dict['load-displacement'].visible = False
    w.viz_sheet.viz2d_dict['dissipation rate'].visible = False
    w.viz_sheet.monitor_chunk_size = 10
    w.viz_sheet.reference_viz2d_name = 'load-displacement'

    w.run()
    w.offline = False
    w.finish_event = True
    w.configure_traits(*args, **kw)
Exemple #4
0
def run_uniaxial_elastic():

    bt = UniaxialTestModel(
        n_e_x=2,
        n_e_y=1,
        k_max=300,
        #mats_eval_type='scalar damage'
        #mats_eval_type='microplane damage (eeq)'
        mats_eval_type='microplane CSD (eeq)'
        #mats_eval_type='microplane CSD (odf)'
    )
    L = 2.
    L_c = L / 10.0
    E = 20000.0
    #f_t = 2.4
    #G_f = 0.09
    bt.mats_eval.trait_set(
        # stiffness='algorithmic',
        E=E,
        nu=0.2)
    #     f_t_Em = np.ones_like(bt.dots_grid.state_arrays['omega']) * 10.0
    #     l_f_t_Em = len(f_t_Em)
    #     f_t_Em[0, ...] = 1.0
    #     bt.mats_eval.omega_fn.trait_set(
    #         E=E,
    #         f_t=f_t,
    #         f_t_Em=f_t_Em,
    #         G_f=G_f,
    #         L_s=L_c
    #     )

    bt.w_max = 0.001
    bt.tline.step = 0.01
    bt.cross_section.b = 1
    bt.geometry.trait_set(L=L, H=1, L_c=L_c)
    bt.loading_scenario.trait_set(loading_type='monotonic')
    w = BMCSWindow(model=bt)
    #bt.add_viz2d('load function', 'load-time')
    bt.add_viz2d('F-w', 'load-displacement')

    vis2d_energy = Vis2DEnergy(model=bt)
    viz2d_energy = Viz2DEnergy(name='dissipation', vis2d=vis2d_energy)
    viz2d_energy_rates = Viz2DEnergyRatesPlot(name='dissipation rate',
                                              vis2d=vis2d_energy)
    vis2d_crack_band = Vis2DCrackBand(model=bt)
    w.viz_sheet.viz2d_list.append(viz2d_energy)
    w.viz_sheet.viz2d_list.append(viz2d_energy_rates)

    vis3d = Vis3DStressField()
    bt.tloop.response_traces.append(vis3d)
    bt.tloop.response_traces.append(vis2d_energy)
    # bt.tloop.response_traces.append(vis2d_crack_band)
    viz3d = Viz3DStressField(vis3d=vis3d)
    w.viz_sheet.add_viz3d(viz3d)
    w.viz_sheet.monitor_chunk_size = 1

    w.run()
    w.offline = True
    #    w.finish_event = True
    w.configure_traits()
Exemple #5
0
def run_bending3pt_mic_odf(*args, **kw):

    bt = BendingTestSimulator(n_e_x=2,
                              n_e_y=10,
                              n_e_z=1,
                              k_max=500,
                              mats_eval_type='scalar damage'
                              #mats_eval_type='microplane damage (odf)'
                              )
    bt.mats_eval.trait_set(
        # stiffness='algorithmic',
        epsilon_0=59e-6,
        epsilon_f=600e-6)

    bt.w_max = 0.02
    bt.tline.step = 0.05
    bt.cross_section.h = 100
    bt.cross_section.b = 50
    bt.geometry.L = 20
    bt.loading_scenario.trait_set(loading_type='monotonic')
    w = BMCSWindow(model=bt)
    bt.add_viz2d('load function', 'load-time')
    bt.add_viz2d('F-w', 'load-displacement')

    vis3d = Vis3DSDamage()
    bt.tloop.response_traces.append(vis3d)
    viz3d = Viz3DSDamage(vis3d=vis3d)
    w.viz_sheet.add_viz3d(viz3d)
    w.viz_sheet.monitor_chunk_size = 1

    #    w.run()
    w.offline = False
    #    w.finish_event = True
    w.configure_traits()
def run_ctt(*args, **kw):

    reinf1 = ContinuousFibers(r=3.5e-3,
                              tau=RV(
                                  'gamma', loc=0.0126, scale=1.440, shape=0.0539),
                              V_f=0.01,
                              E_f=180e3,
                              #xi=fibers_MC(m=6.7, sV0=0.0076),
                              xi=fibers_MC(m=30, sV0=0.02),
                              label='carbon',
                              n_int=500)

    cb = BMCSRandomBondCB(E_m=25e3,
                          reinforcement_lst=[reinf1],
                          n_BC=10,
                          L_max=200.)

    #cb = ConstantBondCB()

    random_field = RandomField(seed=False,
                               lacor=1.,
                               length=500,
                               nx=1000,
                               nsim=1,
                               loc=.0,
                               shape=60.,
                               scale=3.1,
                               distr_type='Weibull')

    ctt = CompositeTensileTest(n_x=1000,
                               L=500,
                               V_f=0.01,
                               E_f=180e3,
                               cb=cb,
                               sig_mu_x=random_field.random_field)

    print(('STRENGH', ctt.strength))
    print((ctt.BC_x))
    viz2d_sig_eps = Viz2DSigEps(name='stress-strain',
                                vis2d=ctt)
    viz2d_state_field = Viz2DStateVarField(name='matrix stress',
                                           vis2d=ctt)
    viz2d_cb_field = Viz2DCBFieldVar(name='crack bridge field',
                                     vis2d=cb, visible=False)

    w = BMCSWindow(model=ctt)

    w.viz_sheet.viz2d_list.append(viz2d_sig_eps)
    w.viz_sheet.viz2d_list.append(viz2d_state_field)
    w.viz_sheet.viz2d_list.append(viz2d_cb_field)
    w.viz_sheet.n_cols = 1
    w.viz_sheet.monitor_chunk_size = 1

    # w.run()
    w.offline = False
    w.configure_traits(*args, **kw)
def run_bending3pt_mic_odf(*args, **kw):

    bt = BendingTestModel(
        n_e_x=1,
        n_e_y=1,
        n_e_z=1,
        k_max=500,
        mats_eval_type='microplane damage (eeq)'
        #mats_eval_type='microplane damage (eeq)'
        #mats_eval_type='microplane damage (odf)'
        # mats_eval_type='elastic'
    )
    E_c = 28000  # MPa
    f_ct = 3.0  # MPa
    epsilon_0 = f_ct / E_c  # [-]

    print(bt.mats_eval_type)
    bt.mats_eval.trait_set(
        # stiffness='algorithmic',
        epsilon_0=epsilon_0,
        epsilon_f=epsilon_0 * 10)

    bt.w_max = 0.001
    bt.tline.step = 0.005
    bt.cross_section.h = 1
    bt.geometry.L = 1
    bt.loading_scenario.trait_set(loading_type='monotonic')

    bt.record = {
        #       'Pw': Vis2DFW(bc_right=right_x_s, bc_left=left_x_s),
        #       'slip': Vis2DField(var='slip'),
        'strain': Vis3DTensorField(var='eps_ab'),
        'stress': Vis3DTensorField(var='sig_ab'),
        'damage': Vis3DTensorField(var='phi_ab'),
    }

    w = BMCSWindow(sim=bt)
    #    bt.add_viz2d('load function', 'load-time')
    #    bt.add_viz2d('F-w', 'load-displacement')

    viz_stress = Viz3DTensorField(vis3d=bt.hist['strain'])
    viz_strain = Viz3DTensorField(vis3d=bt.hist['stress'])
    viz_damage = Viz3DTensorField(vis3d=bt.hist['damage'])

    w.viz_sheet.add_viz3d(viz_stress)
    w.viz_sheet.add_viz3d(viz_strain)
    w.viz_sheet.add_viz3d(viz_damage)
    w.viz_sheet.monitor_chunk_size = 1

    w.run()
    time.sleep(10)
    w.offline = False
    #    w.finish_event = True
    w.configure_traits()
Exemple #8
0
def run_po_paper2_4layers(*args, **kw):

    A_roving = 0.49
    h_section = 20.0
    b_section = 100.0
    n_roving = 11.0
    tt4_n_layers = 6
    A_f4 = n_roving * tt4_n_layers * A_roving
    A_c4 = h_section * b_section
    A_m4 = A_c4 - A_f4
    P_b4 = tt4_n_layers
    E_f = 180000.0
    E_m = 30000.0
    s_arr = np.array([
        0., 0.004, 0.0063, 0.0165, 0.0266, 0.0367, 0.0468, 0.057, 0.0671, 0.3,
        1.0
    ],
                     dtype=np.float_)
    tau_arr = 0.7 * np.array([
        0., 40, 62.763, 79.7754, 63.3328, 53.0229, 42.1918, 28.6376, 17, 3, 1
    ],
                             dtype=np.float)
    po = PullOutModel(name='t33_pullout_multilinear',
                      n_e_x=100,
                      k_max=1000,
                      w_max=2.0)
    po.fixed_boundary = 'clamped left'
    po.loading_scenario.set(loading_type='monotonic')
    po.mats_eval.trait_set(E_f=E_f, E_m=E_m)
    po.mats_eval.s_tau_table = [s_arr, tau_arr]
    po.cross_section.trait_set(A_f=A_f4, A_m=A_m4, P_b=P_b4)
    po.geometry.trait_set(L_x=500)
    po.trait_set(w_max=0.95, n_e_x=100)
    po.tline.trait_set(step=0.005)

    po.run()

    w = BMCSWindow(model=po)
    po.add_viz2d('load function', 'load-time')
    po.add_viz2d('F-w', 'load-displacement')
    po.add_viz2d('field', 'u_C', plot_fn='u_C')
    po.add_viz2d('dissipation', 'dissipation')
    po.add_viz2d('field', 'eps_C', plot_fn='eps_C')
    po.add_viz2d('field', 's', plot_fn='s')
    po.add_viz2d('field', 'sig_C', plot_fn='sig_C')
    po.add_viz2d('field', 'sf', plot_fn='sf')
    po.add_viz2d('dissipation rate', 'dissipation rate')

    w.offline = False
    w.finish_event = True
    w.configure_traits(*args, **kw)
Exemple #9
0
def run_uniaxial_test():

    ut = UniaxialTestModel(
        n_e_x=1,
        n_e_y=1,
        n_e_z=1,
        k_max=50,
        #mats_eval_type='microplane damage (eeq)'
        #mats_eval_type='microplane damage (odf)'
        mats_eval_type='microplane CSD (eeq)'
        #mats_eval_type='microplane CSD (odf)'
    )
    ut.mats_eval.set(
        # stiffness='algorithmic',
        # epsilon_0=0.001,
        # epsilon_f=0.005
    )

    ut.loading_scenario.set(loading_type='monotonic')
    ut.loading_scenario.set(number_of_cycles=1)
    ut.loading_scenario.set(maximum_loading=-0.0075)
    ut.loading_scenario.set(unloading_ratio=0.1)
    ut.loading_scenario.set(amplitude_type="constant")
    ut.loading_scenario.set(loading_range="non-symmetric")

    # ut.loading_scenario.set(loading_type='monotonic')
    # ut.loading_scenario.set(maximum_loading=-0.01)
    #ut.w_max = -0.00001
    ut.tline.step = 0.005
    ut.cross_section.h = 1
    ut.geometry.L = 1

    # ut.get_PW()

    # print(ut.get_PW())

    w = BMCSWindow(model=ut)
    ut.add_viz2d('load function', 'load-time')
    ut.add_viz2d('F-w', 'load-displacement')

    vis3d = Vis3DPoll()
    ut.tloop.response_traces.append(vis3d)
    viz3d = Viz3DPoll(vis3d=vis3d)
    w.viz_sheet.add_viz3d(viz3d)
    w.viz_sheet.monitor_chunk_size = 1

    #    w.run()
    w.offline = False
    #    w.finish_event = True
    w.configure_traits()
Exemple #10
0
def run_pullout_const_shear(*args, **kw):
    po = PullOutModel(name='t32_analytical_pullout')
    po.geometry.trait_set(L_x=800)
    #     po.cross_section.trait_set(A_f=4.5, P_b=1.0)
    #     po.material.trait_set(E_f=9 * 180000.0, tau_pi_bar=2.77 * 9)
    po.tline.step = 0.01

    w = BMCSWindow(sim=po)
    # po.add_viz2d('load function')
    po.add_viz2d('F-w', 'load-displacement')
    po.add_viz2d('field', 'shear flow', plot_fn='sf')
    po.add_viz2d('field', 'displacement', plot_fn='u')
    po.add_viz2d('field', 'strain', plot_fn='eps')
    #    po.add_viz2d('field', 'sig', plot_fn='sig')
    w.viz_sheet.monitor_chunk_size = 2

    w.run()
    w.offline = False
    w.configure_traits(*args, **kw)
Exemple #11
0
def run_pullout_multilinear():
    po = PullOutModel(n_e_x=8, k_max=500)
    po.w_max = 20.0
    A_f = 16.44
    po.cross_section.A_f = A_f
    r = np.sqrt(A_f / np.pi)
    po.cross_section.P_b = 2 * r * np.pi
    po.mats_eval_type = 'multilinear'
    po.tline.step = 0.01
    po.geometry.L_x = 1.0
    po.loading_scenario.set(loading_type='monotonic')

    # todo
    po.material.set(s_data='0, 1.0, 5.0, 10.0, 20.0',
                    tau_data='0, 14.0, 16.5, 15.0, 7.0')
    po.material.update_bs_law = True
    Pu = po.rt_Pu
    w = BMCSWindow(model=po)
    Pu.add_viz2d('diagram')
    po.add_viz2d('field', 'u_C', plot_fn='u_C')
    w.offline = False
    w.finish_event = True
    w.configure_traits()
Exemple #12
0
    ll, lr = 0, 0

    cbcb = ConstantBondCB(n_z=1000)
    cbcb1 = ConstantBondCB(n_z=1000)

    viz2d_sig_eps = Viz2DFieldVar(name='stress-strain',
                                  vis2d=cbcb)

    w = BMCSWindow(model=cbcb)

    w.viz_sheet.viz2d_list.append(viz2d_sig_eps)
    w.viz_sheet.n_cols = 1
    w.viz_sheet.monitor_chunk_size = 1

    w.run()
    w.offline = False
    w.configure_traits()

    if False:
        #     cbcb.configure_traits()
        x = np.linspace(0, 1000, 10001)
        sig = cbcb.get_sig_m_z(x, ll, lr, cbcb.sig_cu / 4)
        eps = cbcb.get_eps_f_z(x, ll, lr, cbcb.sig_cu / 4)

        sig1 = cbcb1.get_sig_m_z(x, ll, lr, cbcb.sig_cu / 4)
        eps1 = cbcb1.get_eps_f_z(x, ll, lr, cbcb.sig_cu / 4)

        print((sig == sig1))

        plt.plot(x, sig - sig1)
    #     plt.plot(x, sig1)
Exemple #13
0
    w.viz_sheet.viz2d_list.append(viz2d_energy_rates)
    w.viz_sheet.monitor_chunk_size = 1

    L_c_list = [0.1]
    G_f_list = [0.1, 0.2]
    n_e_x_li = [15, 20, 25]
    colors = ['blue', 'green', 'orange', 'yellow', 'black']
    bt.mats_eval.omega_fn.trait_set(L_s=L_c_list[0])
    ax1 = plt.subplot(211)
    ax2 = plt.subplot(212)
    for L_c in L_c_list:
        for G_f_i in G_f_list:
            c = colors.pop()
            #    for n_e_x, c in zip(n_e_x_li, colors):
            bt.trait_set(n_e_x=20)
            bt.geometry.trait_set(L_c=L_c)
            bt.mats_eval.omega_fn.trait_set(G_f=G_f_i, L_s=L_c)
            w.run()
            w.offline = True
            w.finish_event = True
            w.join()
            viz2d_Fw.plot(ax1,
                          1,
                          color=c,
                          label='L_c_x=%g, G_f=%g' % (L_c, G_f_i))
            viz2d_energy_rates.plot(ax2,
                                    1,
                                    color=c,
                                    label='L_c_x=%g, G_f=%g' % (L_c, G_f_i))
    plt.show()
Exemple #14
0
        return XDomainSinglePoint()

    traits_view = View(
        resizable=True,
        width=1.0,
        height=1.0,
        scrollable=True,
    )

    tree_view = traits_view


if __name__ == '__main__':
    from ibvpy.mats.mats3D import MATS3DMplCSDEEQ
    from ibvpy.mats.mats3D.mats3D_plastic.vmats3D_desmorat import \
        MATS3DDesmorat
    from ibvpy.rtrace.record_vars import RecordVars
    import time
    e = MATSExplore(record={'vars': RecordVars()})
    e.tline.step = 0.01
    viz2d_sig_eps = Viz2DSigEps(name='stress-strain', vis2d=e.hist['vars'])

    w = BMCSWindow(model=e)
    w.viz_sheet.viz2d_list.append(viz2d_sig_eps)
    w.viz_sheet.n_cols = 1
    w.viz_sheet.monitor_chunk_size = 10
    w.offline = False
    #     w.run()
    #     time.sleep(2)
    w.configure_traits()