Example #1
0
def test_create_sample_field():
    data = io.create_sample_field(frame=3)
    assert data["t"] == 3
    data = io.create_sample_field(rows=3, cols=7)
    assert data.x.shape[0] == 7
    assert data.y.shape[0] == 3
    assert data["t"] == 0
Example #2
0
def test_strain():
    """ tests shear estimate """

    data = io.create_sample_field()
    data.piv.strain()
    # this is homogeneous case in which the only derivative is
    # vy so both shear and vorticity are equal
    assert np.allclose(
        np.unique(data.w.values.flatten().round(decimals=6)),
        np.array([0.001998, 0.002063, 0.002211, 0.002629, 0.00268]))
Example #3
0
def test_vec2scal():
    """ tests vec2scal """

    data = io.create_sample_field()
    data.piv.vec2scal(property='curl')
    data.piv.vec2scal(property='ken')
    data.piv.vec2scal(property='tke')
    assert len(data.attrs['variables']) == 5
    assert data.attrs['variables'][-1] == 'tke'

    _a.piv.vec2scal(property='curl')
Example #4
0
def test_vec2scal():
    """ tests vec2scal """
    
    data = io.create_sample_field()
    data.piv.vec2scal(property='curl')
    data.piv.vec2scal(property='ken')
    data.piv.vec2scal(property='tke')
    assert len(data.attrs['variables']) == 5
    assert data.attrs['variables'][-1] == 'tke'
    
    _a.piv.vec2scal(property='curl')
    
Example #5
0
def test_shear():
    """ tests shear estimate """
    
    data = io.create_sample_field()
    data.piv.shear()
    assert data['w'][0,0] == 0.0 
    
    data = io.create_sample_dataset()
    data.piv.vec2scal(property='ke')
    data.piv.vec2scal(property='tke') # now defined
    assert data.attrs['variables'][-1] == 'tke'

    
    _a.piv.vec2scal(property='curl')
Example #6
0
def test_shear():
    """ tests shear estimate """
    
    data = io.create_sample_field()
    data.piv.shear()
    assert data['w'][0,0] == 0.0 
Example #7
0
def test_vorticity():
    """ tests vorticity estimate """
    
    data = io.create_sample_field()
    data.piv.vorticity()
    assert data['w'][0,0] == 0.0
Example #8
0
def test_shear():
    """ tests shear estimate """

    data = io.create_sample_field()
    data.piv.shear()
    assert data['w'][0, 0] == 0.0
Example #9
0
def test_vorticity():
    """ tests vorticity estimate """

    data = io.create_sample_field()
    data.piv.vorticity()
    assert data['w'][0, 0] == 0.0
Example #10
0
def test_vorticity():
    """ tests vorticity estimate """
    data = io.create_sample_field()
    data.piv.vorticity()
    print(data['w'][0, 0])
    assert np.allclose(data["w"][0, 0], -0.09266766)
Example #11
0
def test_reynolds_stress():
    data = io.create_sample_field()
    tmp = data.piv.reynolds_stress()
    assert np.allclose(tmp['w'], 0.0)
Example #12
0
def test_fluctuations():
    data = io.create_sample_field()
    data.piv.fluct()
    assert np.allclose(data['u'], 0.0)
Example #13
0
def test_create_sample_field():
    data = io.create_sample_field(frame=3)
    assert data['t'] == 3