def test_set_well_drilling(self): # with casings from pwptemp.drilling import input casings = [{ 'od': 9.5, 'id': 8.5, 'depth': 25.0 }, { 'od': 20.0, 'id': 18.0, 'depth': 10.0 }] tdata = input.data(casings) well = input.set_well(tdata, trajectory) self.assertEqual(len(well.casings[0]), len(well.casings[1])) self.assertEqual(len(well.md), well.zstep) del tdata['casings'] for x, value in tdata.items(): self.assertEqual(value - value, 0) # without casings tdata = input.data() well = input.set_well(tdata, trajectory) self.assertEqual(len(well.md), well.zstep) del tdata['casings'] for x, value in tdata.items(): self.assertEqual(value - value, 0)
def test_set_well_injection(self): from pwptemp.injection import input # with casings casings = [{ 'od': 9.5, 'id': 8.5, 'depth': 25.0 }, { 'od': 20.0, 'id': 18.0, 'depth': 10.0 }] tdata = input.data(casings) depths = wellpath.get(100, 10) well = input.set_well(tdata, depths) self.assertEqual(len(well.casings[0]), len(well.casings[1])) self.assertEqual(len(well.md), well.zstep) del tdata['casings'] for x, value in tdata.items(): self.assertEqual(value - value, 0) # without casings tdata = input.data() depths = wellpath.get(100, 10) well = input.set_well(tdata, depths) self.assertEqual(len(well.md), well.zstep) del tdata['casings'] for x, value in tdata.items(): self.assertEqual(value - value, 0)
def test_set_well(self): # with casings casings = [{ 'od': 9.5, 'id': 8.5, 'depth': 25.0 }, { 'od': 20.0, 'id': 18.0, 'depth': 10.0 }] tdata = input.data(casings) depths = wellpath.get(100, 10) well = input.set_well(tdata, depths) self.assertEqual(len(well.casings[0]), len(well.casings[1])) self.assertEqual(len(well.md), well.zstep) del tdata['casings'] for x, value in tdata.items(): self.assertIsInstance(value, float) # without casings tdata = input.data() depths = wellpath.get(100, 10) well = input.set_well(tdata, depths) self.assertEqual(len(well.md), well.zstep) del tdata['casings'] for x, value in tdata.items(): self.assertIsInstance(value, float)
def test_heat_coef_injection(self): from pwptemp.injection import input, heatcoefficients, initcond depths = wellpath.get(100, 50) well = input.set_well(input.data(), depths) ic = initcond.init_cond(well) well = well.define_density(ic) tt = ic.tto t3 = ic.tco hc = heatcoefficients.heat_coef(well, 1, tt, t3) self.assertEqual(len(hc), 8) self.assertEqual(len(hc[0]), 4) # len of hc_1 self.assertEqual(len(hc[0][0]), depths.zstep) # len of c1z self.assertEqual(len(hc[0][1]), depths.zstep) # len of c1e self.assertEqual(len(hc[0][2]), depths.zstep) # len of c1 self.assertEqual(len(hc[0][3]), depths.zstep) # len of c1t self.assertEqual(len(hc[1]), 4) # len of hc_2 self.assertEqual(len(hc[1][0]), depths.zstep) # len of c2z self.assertEqual(len(hc[1][1]), depths.zstep) # len of c2e self.assertEqual(len(hc[1][2]), depths.zstep) # len of c2w self.assertEqual(len(hc[1][3]), depths.zstep) # len of c2t self.assertEqual(len(hc[2]), 4) # len of hc_3 self.assertEqual(len(hc[2][0]), depths.zstep) # len of c3z self.assertEqual(len(hc[2][1]), depths.zstep) # len of c3e self.assertEqual(len(hc[2][2]), depths.zstep) # len of c3w self.assertEqual(len(hc[2][3]), depths.zstep) # len of c3t self.assertEqual(len(hc[3]), 4) # len of hc_4 self.assertEqual(len(hc[3][0]), depths.zstep) # len of c4z self.assertEqual(len(hc[3][1]), depths.zstep) # len of c4e self.assertEqual(len(hc[3][2]), depths.zstep) # len of c4w self.assertEqual(len(hc[3][3]), depths.zstep) # len of c4t self.assertEqual(len(hc[4]), 4) # len of hc_5 self.assertEqual(len(hc[4][0]), depths.zstep) # len of c5z self.assertEqual(len(hc[4][1]), depths.zstep) # len of c5e self.assertEqual(len(hc[4][2]), depths.zstep) # len of c5w self.assertEqual(len(hc[4][3]), depths.zstep) # len of c5t
def test_heat_coef_drilling(self): from pwptemp.drilling import input, heatcoefficients, initcond depths = wellpath.get(100, 50) well = input.set_well(input.data(), depths) ic = initcond.init_cond(well) well = well.define_viscosity(ic) well = well.define_density(ic) hc = heatcoefficients.heat_coef(well, 1) self.assertEqual(len(hc), 9) self.assertEqual(len(hc[0]), 4) # len of hc_1 self.assertEqual(len(hc[0][0]), depths.zstep) # len of c1z self.assertEqual(len(hc[0][1]), depths.zstep) # len of c1e self.assertEqual(len(hc[0][2]), depths.zstep) # len of c1 self.assertEqual(len(hc[0][3]), depths.zstep) # len of c1t self.assertEqual(len(hc[1]), 4) # len of hc_2 self.assertEqual(len(hc[1][0]), depths.zstep) # len of c2z self.assertEqual(len(hc[1][1]), depths.zstep) # len of c2e self.assertEqual(len(hc[1][2]), depths.zstep) # len of c2w self.assertEqual(len(hc[1][3]), depths.zstep) # len of c2t self.assertEqual(len(hc[2]), 5) # len of hc_3 self.assertEqual(len(hc[2][0]), depths.zstep) # len of c3z self.assertEqual(len(hc[2][1]), depths.zstep) # len of c3e self.assertEqual(len(hc[2][2]), depths.zstep) # len of c3w self.assertEqual(len(hc[2][3]), depths.zstep) # len of c3 self.assertEqual(len(hc[2][4]), depths.zstep) # len of c3t self.assertEqual(len(hc[3]), 4) # len of hc_4 self.assertEqual(len(hc[3][0]), depths.zstep) # len of c4z self.assertEqual(len(hc[3][1]), depths.zstep) # len of c4e self.assertEqual(len(hc[3][2]), depths.zstep) # len of c4w self.assertEqual(len(hc[3][3]), depths.zstep) # len of c4t self.assertEqual(len(hc[4]), 4) # len of hc_5 self.assertEqual(len(hc[4][0]), depths.zstep) # len of c5z self.assertEqual(len(hc[4][1]), depths.zstep) # len of c5e self.assertEqual(len(hc[4][2]), depths.zstep) # len of c5w self.assertEqual(len(hc[4][3]), depths.zstep) # len of c5t
def test_wellpath(self): depths = wellpath.get(100, 50) well = input.set_well(input.data(), depths) hc = heatcoefficients.heat_coef(well, 1)[0] for i in range(len(hc)): for j in range(len(hc[0])): for k in range(len(hc[0, 0])): self.assertNotEqual(hc[i, j][k], 0)
def test_temp_calc(self): tdata = input.data() depths = wellpath.get(3000, 50) well = input.set_well(tdata, depths) ic = initcond.init_cond(well) hc = heatcoefficients.heat_coef(well, 1) tdist = linearsystem.temp_calc(well, ic, hc) self.assertEqual(len(tdist.tdsi), len(tdist.ta), len(tdist.tr)) self.assertEqual(len(tdist.tr), len(tdist.tcsg), len(tdist.tsr))
def test_stab_time(self): tdata = input.data() depths = wellpath.get(3000, 50) well = input.set_well(tdata, depths) st = main.stab_time(well) self.assertEqual(st.finaltime, len(st.tbot), len(st.tout)) self.assertIsInstance(st.finaltime, int) self.assertIsInstance(st.tbot, list) self.assertIsInstance(st.tout, list)
def test_temp_time(self): tdata = input.data() depths = wellpath.get(3000, 50) well = input.set_well(tdata, depths) eff = analysis.hs_effect(well) self.assertIsInstance(eff.ds_rot1, float) self.assertIsInstance(eff.fric1, float) self.assertIsInstance(eff.ds_rot2, float) self.assertIsInstance(eff.fric2, float) self.assertIsInstance(eff.hsr, float)
def test_temp_time(self): tdata = input.data() depths = wellpath.get(3000, 50) well = input.set_well(tdata, depths) td = main.temp_time(24, well) eff = analysis.param_effect(td, well) final = round(eff.cc + eff.hs + eff.t1, 1) self.assertEqual(final, round(eff.t2, 1)) self.assertIsInstance(eff.cc, float) self.assertIsInstance(eff.hs, float)
def test_temp_calc_drilling(self): from pwptemp.drilling import input, initcond, heatcoefficients, linearsystem tdata = input.data() depths = wellpath.get(3000, 50) well = input.set_well(tdata, depths) ic = initcond.init_cond(well) well = well.define_viscosity(ic) well = well.define_density(ic, cond=0) hc = heatcoefficients.heat_coef(well, 1) tdist = linearsystem.temp_calc(well, ic, hc) self.assertEqual(len(tdist.tdsi), len(tdist.ta), len(tdist.tr)) self.assertEqual(len(tdist.tr), len(tdist.tcsg), len(tdist.tsr))
def test_temp_calc_injection(self): from pwptemp.injection import input, initcond, heatcoefficients, linearsystem tdata = input.data() depths = wellpath.get(3000, 50) well = input.set_well(tdata, depths) ic = initcond.init_cond(well) tt = ic.tto tc = ic.tco well = well.define_density(ic, cond=0) hc = heatcoefficients.heat_coef(well, 1, tt, tc) tdist = linearsystem.temp_calc(well, ic, hc) self.assertEqual(len(tdist.tft), len(tdist.ta), len(tdist.tr)) self.assertEqual(len(tdist.tr), len(tdist.tc), len(tdist.tsr))
def test_temp_time_injection(self): from pwptemp.injection import input, main tdata = input.data() well = input.set_well(tdata, trajectory) td = main.temp_time(2, well) self.assertEqual(len(td.tft), len(td.ta), len(td.tr)) self.assertEqual(len(td.tc), len(td.tsr), len(td.tfm)) self.assertEqual(td.time, 2) self.assertIsInstance(td.tft, list) self.assertIsInstance(td.ta, list) self.assertIsInstance(td.tr, list) self.assertIsInstance(td.tc, list) self.assertIsInstance(td.tsr, list) self.assertIsInstance(td.tfm, list)
def test_temp_time_drilling(self): from pwptemp.drilling import input, main tdata = input.data() well = input.set_well(tdata, trajectory) td = main.temp_time(2, well) self.assertEqual(len(td.tdsi), len(td.ta), len(td.tr)) self.assertEqual(len(td.tcsg), len(td.tsr), len(td.tfm)) self.assertEqual(td.time, 2) self.assertIsInstance(td.tdsi, list) self.assertIsInstance(td.ta, list) self.assertIsInstance(td.tr, list) self.assertIsInstance(td.tcsg, list) self.assertIsInstance(td.tsr, list) self.assertIsInstance(td.tfm, list)
def test_temp_time(self): tdata = input.data() depths = wellpath.get(3000, 50) well = input.set_well(tdata, depths) td = main.temp_time(24, well) self.assertEqual(len(td.tdsi), len(td.ta), len(td.tr)) self.assertEqual(len(td.tcsg), len(td.tsr), len(td.tfm)) self.assertEqual(td.time, 24) self.assertIsInstance(td.tdsi, list) self.assertIsInstance(td.ta, list) self.assertIsInstance(td.tr, list) self.assertIsInstance(td.tcsg, list) self.assertIsInstance(td.tsr, list) self.assertIsInstance(td.tfm, list)
def test_init_cond(self): tdata = input.data() depths = wellpath.get(100, 10) well = input.set_well(tdata, depths) ic = initcond.init_cond(well) a = ic.tdsio b = ic.tdso c = ic.tao d = ic.tcsgo e = ic.tsro f = ic.tfm self.assertIsInstance(a, list) self.assertIsInstance(b, list) self.assertIsInstance(c, list) self.assertIsInstance(d, list) self.assertIsInstance(e, list) self.assertIsInstance(f, list)
def test_init_cond_injection(self): from pwptemp.injection import input, initcond tdata = input.data() depths = wellpath.get(100, 10) well = input.set_well(tdata, depths) ic = initcond.init_cond(well) a = ic.tfto b = ic.tto c = ic.tao d = ic.tco e = ic.tsro f = ic.tfm self.assertIsInstance(a, list) self.assertIsInstance(b, list) self.assertIsInstance(c, list) self.assertIsInstance(d, list) self.assertIsInstance(e, list) self.assertIsInstance(f, list)