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
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]))
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')
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')
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')
def test_shear(): """ tests shear estimate """ data = io.create_sample_field() data.piv.shear() assert data['w'][0,0] == 0.0
def test_vorticity(): """ tests vorticity estimate """ data = io.create_sample_field() data.piv.vorticity() assert data['w'][0,0] == 0.0
def test_shear(): """ tests shear estimate """ data = io.create_sample_field() data.piv.shear() assert data['w'][0, 0] == 0.0
def test_vorticity(): """ tests vorticity estimate """ data = io.create_sample_field() data.piv.vorticity() assert data['w'][0, 0] == 0.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)
def test_reynolds_stress(): data = io.create_sample_field() tmp = data.piv.reynolds_stress() assert np.allclose(tmp['w'], 0.0)
def test_fluctuations(): data = io.create_sample_field() data.piv.fluct() assert np.allclose(data['u'], 0.0)
def test_create_sample_field(): data = io.create_sample_field(frame=3) assert data['t'] == 3