0% found this document useful (0 votes)
51 views8 pages

Form 1

This document contains code for 5 forms that allow users to input well production data and parameters. The forms then perform decline curve analysis using different decline curve models (exponential, hyperbolic, harmonic) and display outputs like predicted production over time, decline rate, and net present value. Users can switch between forms to select the appropriate decline curve model and view results like production charts and calculated decline curve parameters.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views8 pages

Form 1

This document contains code for 5 forms that allow users to input well production data and parameters. The forms then perform decline curve analysis using different decline curve models (exponential, hyperbolic, harmonic) and display outputs like predicted production over time, decline rate, and net present value. Users can switch between forms to select the appropriate decline curve model and view results like production charts and calculated decline curve parameters.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

FORM 1

Public Class Form1


Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Me.Hide()
Form2.Show()

End Sub
End Class

FORM 2
Public Class Form2
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
If RadioButton1.Checked = False And RadioButton2.Checked = False And
RadioButton3.Checked = False Then
MsgBox("seleccione una opcion en TIPOS DE DECLINACION",
MsgBoxStyle.Exclamation, "seleccione")
End If
If RadioButton1.Checked = True Then
Me.Hide()
Form3.Show()
ElseIf RadioButton2.Checked = True Then
Me.Hide()
Form4.Show()
ElseIf RadioButton3.Checked = True Then
Me.Hide()
Form5.Show()
End If
End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click


End
End Sub
End Class

FORM3
Public Class Form3
Dim costooperacion, preciooil, montoregalias, declinacion, np, q, t, qi, tiempoutil,
le, dq, dt As Single
Dim N, I As Integer
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
costooperacion = TextBox1.Text
preciooil = TextBox2.Text
montoregalias = TextBox3.Text
le = costooperacion / (preciooil - montoregalias)
grafica_Q_T() 'metodo general
grafica_logQo_vs_T() 'metodo general
For I = 0 To N
declinacion = -((DataGridView1.Item(1, 0).Value - DataGridView1.Item(1,
N).Value) / (DataGridView1.Item(0, 0).Value - DataGridView1.Item(0, N).Value)) /
DataGridView1.Item(1, N).Value
q = DataGridView1.Item(1, 0).Value * Math.Exp(-declinacion *
DataGridView1.Item(0, I).Value)
np = (DataGridView1.Item(1, 0).Value - DataGridView1.Item(1, I).Value) /
declinacion
tiempoutil = ((2.3 / declinacion) * (Math.Log10(le) -
Math.Log10(DataGridView1.Item(1, 0).Value)) / declinacion)
Next
Label10.Text = q
DataGridView1.Columns.Add(q, np)
Label12.Text = declinacion
Label13.Text = tiempoutil
Label9.Text = le
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click


Me.Hide()
Form2.Show()
End Sub
Sub grafica_Q_T()
N = TextBox4.Text
For i = 0 To N
t = Val(DataGridView1.Item(0, i).Value)
q = Val(DataGridView1.Item(1, i).Value)
Chart2.Series("Q_vs_T").Points.AddXY(t, q)
Next
End Sub
Sub grafica_logQo_vs_T()
N = TextBox4.Text
For i = 0 To N
t = Val(DataGridView1.Item(0, i).Value)
q = Val(DataGridView1.Item(1, i).Value)
Chart1.Series("logQo_vs_T").Points.AddXY(t, q)
Next
End Sub

End Class

FORM 4
Public Class Form4
Dim q, qi, d, np, t, co, po, reg, le As Single
Dim N As Integer
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Me.Hide()
Form2.Show()
End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click


co = Val(TextBox1.Text)
po = Val(TextBox2.Text)
reg = Val(TextBox3.Text)
le = co / (po - reg)
t = (1 / d) * (((qi / le) ^ 2) - 1)
grafica_q_vs_t()
grafica_logq_vs_t()
calulo_np_d()
Label5.Text = t
Label15.Text = le
End Sub
Sub grafica_q_vs_t()
n = TextBox5.Text
For i = 0 To n
q = DataGridView1.Item(1, i).Value
t = DataGridView1.Item(0, i).Value
Me.Chart1.Series("Q_VS_T").Points.AddXY(t, q)
Next
End Sub
Sub grafica_logq_vs_t()
n = TextBox5.Text
For i = 0 To n
q = DataGridView1.Item(1, i).Value
t = DataGridView1.Item(0, i).Value
Me.Chart2.Series("logQ_VS_T").Points.AddXY(t, q)
Next
End Sub
Sub calulo_np_d()
N = TextBox5.Text
d = (DataGridView1.Item(1, 0).Value / DataGridView1.Item(1, N).Value) - 1
np = (DataGridView1.Item(1, 0).Value / d) * (Math.Log10(DataGridView1.Item(1,
0).Value) - Math.Log10(DataGridView1.Item(1, N).Value))
Label7.Text = np
Label6.Text = d
End Sub
End Class

FORM 5
Public Class Form5
Dim CO, CP, REG, T, D, Q, Qi, Qo, B, LE, NP As Single
Dim I, N As Integer
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Me.Hide()
Form2.Show()

End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click


CO = TextBox1.Text
CP = TextBox2.Text
REG = TextBox3.Text
LE = CO / (CP - REG)
Qi = DataGridView1.Item(1, 0).Value
grafica_qvst()
grafica_LOGqvst()
For I = 0 To N
N = TextBox11.Text
Qo = DataGridView1.Item(1, N).Value
B = (Qo / ((Qi - Qo) / (DataGridView1.Item(0, 0).Value - DataGridView1.Item(0,
N).Value)) / DataGridView1.Item(0, 1).Value)
Q = Qi * (1 + D * B * DataGridView1.Item(0, I).Value) ^ (-1 / B)
D = (((Q / Qi) ^ B) - 1) / (B * DataGridView1.Item(0, N).Value)
Next
NP = (Qi / (D * (1 - B))) * ((Qi ^ (1 - B)) - (Q ^ (1 - B)))
T = (((Qi / Q) ^ B) - 1) / (D * B)
DataGridView1.Columns.Add(Q, D)
Label3.Text = LE
Label18.Text = B
Label4.Text = Qi
Label5.Text = Qo
Label6.Text = D
Label7.Text = NP
Label8.Text = T

End Sub
Sub grafica_qvst()
N = TextBox11.Text
For I = 0 To N
T = DataGridView1.Item(0, I).Value
Q = DataGridView1.Item(1, I).Value
Me.Chart1.Series("Q_VS_T").Points.AddXY(T, Q)
Next
End Sub
Sub grafica_LOGqvst()
N = TextBox11.Text
For I = 0 To N
T = DataGridView1.Item(0, I).Value
Q = DataGridView1.Item(1, I).Value
Chart2.Series("logQ_VS_T").Points.AddXY(T, Q)
Next
End Sub
End Class

You might also like