def test_uniax_kt3(self): """Test the tangential stress at r=a, theta=90: this is Kt=3""" a = 1234.6 r = a theta = math.radians(90) sx = 123 expect = np.array([0, 3, 0]) * sx result = openhole.stress_hole_isotropic_x(a, r, theta, sx) print(result / sx) assert_allclose(result, expect)
def test_uniax_tau_0(self): """sigma_r at 0°. ref. peterson (2nd), 4.8 test this from r=a to r=4*a, 40 points """ a = 5 r = np.linspace(a, 4 * a, 40) sx = 1 expect = np.zeros_like(r) theta = 0 result1 = [ openhole.stress_hole_isotropic_x(a, ri, theta, sx) for ri in r ] # get tau_r_theta components result = [x[2] for x in result1] assert_allclose(result, expect, atol=1e-15)
def test_uniax_stheta_0(self): """sigma_theta at 0°. ref. peterson (2nd), 4.8 test this from r=a to r=4*a, 40 points """ a = 5 r = np.linspace(a, 4 * a, 40) sx = 1 expect = 0.5 * ((a / r)**2 - 3 * (a / r)**4) theta = 0 result1 = [ openhole.stress_hole_isotropic_x(a, ri, theta, sx) for ri in r ] # get s_theta components result = [x[1] for x in result1] assert_allclose(result, expect)
def test_uniax_sr_90(self): """sigma_r at 90°. ref. peterson (2nd), 4.7 test this from r=a to r=4*a, 40 points """ a = 5 r = np.linspace(a, 4 * a, 40) sx = 1 expect = 1.5 * ((a / r)**2 - (a / r)**4) theta = math.radians(90) result1 = [ openhole.stress_hole_isotropic_x(a, ri, theta, sx) for ri in r ] # get s_r components result = [x[0] for x in result1] assert_allclose(result, expect)