Ejemplo n.º 1
0
    def test_calculate_ramp_flow(self):
        # Errors considered: k>1, k<0
        type_curve = SyntheticTypeCurve(0, 100, 5, 6, 0, 1, 1)

        # k = 0 (full linear ramp), expect ramp_flow to return ramp_to_peak_flow
        type_curve.t = 0
        q = type_curve.calculate_ramp_flow()
        self.assertEqual(q, type_curve.calculate_ramp_to_peak_flow())

        # k = 1 (full sinusodal ramp), expect ramp_flow to return sin_ramp_flow
        type_curve = SyntheticTypeCurve(0, 100, 5, 6, 1, 1, 1)
        q = type_curve.calculate_ramp_flow()
        self.assertEqual(q, type_curve.calculate_sine_ramp_flow())
Ejemplo n.º 2
0
    def test_calculate_decline_flow(self):
        # Errors considered: t_plat < 0, t_peak < 0, a<0, b>1, b<0, (t - t_peak - t_plat) < 0
        type_curve = SyntheticTypeCurve(0, 100, 5, 6, 0, 1, 1)

        # q_peak = 100, b = 1, a = 1, t = 20, t_peak = 5, t_plat = 6, expect decline flow to return 10
        type_curve.t = 20
        q = type_curve.calculate_decline_flow()
        self.assertEqual(q, 10)

        type_curve = SyntheticTypeCurve(0, 10000000, 5, 6, 0, 0, 1)

        # q_peak = 10000000, b = 0, a = 1, t = 30, t_peak = 5, t_plat = 6, expect decline flow to return 0.05602796437537268
        type_curve.t = 30
        q = type_curve.calculate_decline_flow()
        self.assertEqual(q, 0.05602796437537268)
Ejemplo n.º 3
0
    def test_calculate_synthetic_type_curve(self):
        type_curve = SyntheticTypeCurve(32, 100, 5, 6, 0.1, 1, 1)

        type_curve.t = 3
        q = type_curve.calculate_synthetic_type_curve()
        self.assertEqual(q, 72.06508497187474)

        type_curve.t = 7
        q = type_curve.calculate_synthetic_type_curve()
        self.assertEqual(q, 100)
Ejemplo n.º 4
0
    def test_calculate_ramp_to_peak_flow(self):
        # Errors considered: q_zero>q_peak, t_peak==0
        type_curve = SyntheticTypeCurve(0, 100, 5, 6, 0, 1, 1)
        # q_zero, q_peak, t_peak, t_plat, k, b, a

        # t = 0, q_zero = 0, k = 0 (full linear ramp), expect ramp_to_peak_flow to return 0
        q = type_curve.calculate_ramp_to_peak_flow()
        self.assertEqual(q, 0)

        # t = 1, q_zero = 0, k = 0 (full linear ramp), expect ramp_to_peak_flow to return linear_ramp_slope
        type_curve.t = 1
        q = type_curve.calculate_ramp_to_peak_flow()
        self.assertEqual(q, type_curve.calculate_linear_ramp_slope())
Ejemplo n.º 5
0
    def test_calculate_sine_ramp_flow(self):
        # Errors considered: q_zero>q_peak, t_peak==0
        type_curve = SyntheticTypeCurve(0, 100, 5, 6, 0, 1, 1)

        # q_peak = 100, t_peak = 5, t=0, expect sine_ramp_flow to return 0
        type_curve.t = 0
        q = type_curve.calculate_sine_ramp_flow()
        self.assertEqual(q, 0)

        # q_peak = 100, t_peak = 5, t=1, expect sine_ramp_flow to return 9.54915028125263
        type_curve.t = 1
        q = type_curve.calculate_sine_ramp_flow()
        self.assertEqual(q, 9.54915028125263)
Ejemplo n.º 6
0
# ts=ref_series["ts"]
# fig2 = plt.plot(ts, qs_ref, 'r', label = 'referral curve')
# print (qs_ref)  # in MMSCFD

# plt.ylabel('gas flow (MMSCFD)')
# plt.xlabel('time (months)')

# plt.show()

q_zero = 0 # MMSCFD
q_zero = engunits.convert_value('svf', q_zero, 'MMSCFD')

q_peak = 10 # MMSCFD
q_peak = engunits.convert_value('svf', q_peak, 'MMSCFD')

type_curve = SyntheticTypeCurve(360, q_zero, q_peak, 5, 6, 0, 1, 1)
ts = list(range(type_curve.months))

qs = type_curve.build_q_c()
qs_conv = [0] * len(qs)

ps = type_curve.find_p()
ps_conv = [0] * len(ps)

for i in range(len(qs)):
    qs_conv[i] = engunits.convert_value('svf', qs[i], 'MMSCFD')
    ps_conv[i] = engunits.convert_value('Pa', ps[i], 'kPag')
print (qs_conv)
print (ps_conv)

fig1 = plt.plot(qs_conv, ps_conv)
Ejemplo n.º 7
0
    def test_calculate_peak_flow_plateau(self):
        type_curve = SyntheticTypeCurve(0, 100, 5, 6, 0, 1, 1)

        # q_peak = 100, expect peak_flow_plateau to return 100
        q = type_curve.calculate_peak_flow_plateau()
        self.assertEqual(q, 100)
Ejemplo n.º 8
0
    def test_calculate_synthetic_type_curve_noise(self):
        type_curve = SyntheticTypeCurve(32, 100, 5, 6, 0.1, 1, 1)

        type_curve.months = 7
        # q_zero = 32, q_peak = 100, t_peak = 5, t_plat = 6, k = 0.1, b = 1, a = 1, t = 7, expect calculate_synthetic_type_curve to return 100

        type_curve.c1 = 0
        type_curve.c2 = 0
        type_curve.c3 = 0
        type_curve.c4 = 0
        type_curve.c5 = 0
        type_curve.p_dist = 0
        type_curve.p_shut = 0
        # expect calculate_synthetic_type_curve_noise to return 100
        q=type_curve.calculate_synthetic_type_curve_noise()
        self.assertEqual(q, 100)