Ejemplo n.º 1
0
def test_time_average_vel(depth, expected):
    """Test time averaged shear-wave velocity."""
    st = site.SoilType(unit_wt=17)
    p = site.Profile([
        site.Layer(st, 10, 300),
        site.Layer(st, 10, 600),
        site.Layer(st, None, 900),
    ])
    assert_allclose(p.time_average_vel(depth), expected, atol=0.001)
Ejemplo n.º 2
0
def test_iter_variations():
    m = motion.SourceTheoryRvtMotion(6.0, 30, 'wna')
    m.calc_fourier_amps()

    profile = site.Profile([
        site.Layer(
            site.DarendeliSoilType(18., plas_index=0, ocr=1, stress_mean=200),
            10, 400),
        site.Layer(
            site.DarendeliSoilType(18., plas_index=0, ocr=1, stress_mean=200),
            20, 600),
        site.Layer(site.SoilType('Rock', 24., None, 0.01), 0, 1200),
    ])

    calc = propagation.EquivalentLinearCalculator()
    var_thickness = variation.ToroThicknessVariation()
    var_velocity = variation.ToroVelocityVariation.generic_model('USGS C')
    var_soiltypes = variation.SpidVariation(-0.5,
                                            std_mod_reduc=0.15,
                                            std_damping=0.0030)

    freqs = np.logspace(-1, 2, num=500)

    outputs = output.OutputCollection(
        output.ResponseSpectrumOutput(
            # Frequency
            freqs,
            # Location of the output
            output.OutputLocation('outcrop', index=0),
            # Damping
            0.05),
        output.ResponseSpectrumRatioOutput(
            # Frequency
            freqs,
            # Location in (denominator),
            output.OutputLocation('outcrop', index=-1),
            # Location out (numerator)
            output.OutputLocation('outcrop', index=0),
            # Damping
            0.05),
    )

    for profile in variation.iter_varied_profiles(profile,
                                                  3,
                                                  var_thickness=var_thickness,
                                                  var_velocity=var_velocity,
                                                  var_soiltypes=var_soiltypes):
        calc(m, profile, profile.location('outcrop', index=-1))
        outputs(calc)
Ejemplo n.º 3
0
def test_simplified_rayleigh_vel():
    """Test simplified Rayleigh wave velocity."""
    # Example from Urzua et al. (2017). Table 1 in Appendix A
    layers = [
        (8, 828, 105),
        (5, 726, 133),
        (7, 1039, 120),
        (8, 825, 120),
        (5, 951, 137),
        (65, 1270, 125),
        (24, 1065, 127),
        (16, 1205, 119),
        (9, 1071, 138),
        (7, 1633, 135),
        (21, 1223, 138),
        (25, 2777, 140),
    ]
    p = site.Profile([
        site.Layer(site.SoilType(unit_wt=unit_wt), thick, vs)
        for thick, vs, unit_wt in layers
    ])

    assert_allclose(
        p.simplified_rayliegh_vel(),
        1349.076,
        atol=0.001,
    )
Ejemplo n.º 4
0
def test_soil_type_linear():
    """Test the soil type update process on a linear material."""
    damping = 1.0
    l = site.Layer(site.SoilType('', 18.0, None, damping), 2., 500.)
    l.strain = 0.1

    assert_approx_equal(l.shear_mod.value, l.initial_shear_mod)
    assert_approx_equal(l.damping.value, damping)
Ejemplo n.º 5
0
def test_soil_type_linear():
    """Test the soil type update process on a linear material."""
    damping = 1.0
    layer = site.Layer(site.SoilType('', 18.0, None, damping), 2., 500.)
    layer.strain = 0.1

    assert_allclose(layer.shear_mod, layer.initial_shear_mod)
    assert_allclose(layer.damping, damping)
Ejemplo n.º 6
0
def test_soil_type_iterative():
    """Test the soil type update process on a nonlinear property."""
    mod_reduc = site.NonlinearProperty('', [0.01, 1.], [1, 0])
    damping = site.NonlinearProperty('', [0.01, 1.], [0, 10])

    st = site.SoilType('', 18.0, mod_reduc, damping)
    l = site.Layer(st, 2., 500.)

    strain = 0.1
    l.strain = strain

    assert_approx_equal(l.strain.value, strain)
    assert_approx_equal(l.shear_mod.value, 0.5 * l.initial_shear_mod)
    assert_approx_equal(l.damping.value, 5.0)
Ejemplo n.º 7
0
def test_soil_type_iterative():
    """Test the soil type update process on a nonlinear property."""
    mod_reduc = site.NonlinearProperty('', [0.0001, 0.01], [1, 0])
    damping = site.NonlinearProperty('', [0.0001, 0.01], [0, 0.10])

    st = site.SoilType('', 18.0, mod_reduc, damping)
    layer = site.Layer(st, 2., 500.)

    strain = 0.001
    layer.strain = strain

    assert_allclose(layer.strain, strain)
    assert_allclose(layer.shear_mod, 0.5 * layer.initial_shear_mod)
    assert_allclose(layer.damping, 0.05)