1. Introduction
Towards the end of an oil and gas reservoir’s productive life, natural lift forces due to fluid pressure gradually decay and diminish. Thus, it is common to use artificial lift methods to transfer the oil and gas from the underground formation to the surface [
1,
2,
3]. In practice, sucker rod pumping units, as illustrated in
Figure 1, are the most popular artificial lift means and are still widely utilized along with hydraulic and electric submersible pumping systems [
4,
5,
6,
7]. Teaming with such pumping systems, various four-bar linkage-based horse-head pump jacks have also been invented to support and drive the entire artificial lift system [
8]. As one of the earliest inventions for oil industries, these sucker rod-pump systems have been proven to be efficient and adaptable [
9,
10,
11,
12,
13]. Over
of the wells worldwide still depend on this traditional and most extensively used mechanism [
14,
15]. Nevertheless, contemporary computational tools have been introduced in recent research efforts on leakage, safety, and reliability and shed light on these popular artificial lift systems [
16,
17,
18,
19].
The fluid mechanics aspect of the sucker rod-pump unit, such as the leakage, has been discussed and presented in refs. [
20,
21]. The so-called relaxation time, which can be derived numerically based on the Bessel functions for cylindrical coordinates and Fourier series for Cartesian coordinates is calculated and confirmed to be less than a tenth of the typical sampling period, which corresponds to a sampling frequency, normally ranging from 30 to 60 samples per second, currently used in oil industries with comparable physical dimensions [
22,
23,
24]. The issues related to the leakage also exposed an imminent desire and need in engineering practice that sophisticated perturbation methods and analytical approaches continue to be essential to derive information from fully fledged computational simulations and, in some cases, to help the establishment of viable and more insightful simulation setups [
25,
26,
27,
28].
As the traveling unit, the plunger consists of a so-called traveling valve fixed at its bottom and is moving within a barrel or a chamber with a so-called standing valve fixed at the bottom [
29,
30]. Overall, the sucker rod pumping unit involves very complicated four strokes with respect to the open and closed positions of the traveling valve and the standing valve, as illustrated in
Figure 1. In fact, through the exercises of applying fully fledged computational fluid dynamics (CFD) and finite element method (FEM) to sucker rod-pump systems, it is becoming clear that even for a simple developing viscous fluid within sucker rod-pump systems, engineers must learn how to handle extreme aspect ratios. For example, the so-called clearance
C, namely the difference between the plunger outer diameter
and the barrel inner diameter
, or the gap between the plunger and the barrel
, namely
, is often measured in mills, one-thousandth of an inch, whereas, the plunger system length
is often measured in feet [
31,
32]. This extreme aspect ratio renders the fluid mechanics studies of sucker rod-pump systems very challenging. It is more so when we must consider the difference between concentric and eccentric situations [
33]. However, through our previous works [
34], we have identified the possibilities of using a simple viscoelastic model to represent the entire complicated pumping strokes. The measured data at the surface are the sucker rod displacement as well as the dynamometer force measurements. We are encouraged by the very first confirmation of the Inversed Optimization method. This success might be a new beginning in using measured data to help the construction of mathematical and physical models when the engineering fluid system is very complicated. The structural and mechanisms aspects of this work have already been published in refs. [
8,
32].
To follow up with the ideas reported in ref. [
34], the entire downhole sucker rod-pump systems are modeled with Kelvin or Maxwell viscoelastic systems, as illustrated in
Figure 2. In this paper, we focus more on the iterative procedure to identify the optimal choice of needed parameters in these models with a so-called Inverse Optimization Method. The preliminary results do confirm that the parameters derived with the Inverse Optimization Method yield virtually identical results in comparison with the dynamometer measurements of the polished rod load and the displacement in the field [
12]. In fact, the same inverse optimization procedure is also implemented to model the entire fluid delivery system of a very viscous non-Newtonian polymer as a mere first-order ordinary differential system. The convergent parameter matches very well with that identified with the fully fledged computational fluid dynamics model, with the required inlet and outlet pressure drop as the input and the flow rate as the output.
2. Theory and Modeling
Let us consider a lumped mass linked with either Maxwell or Kelvin models as illustrated in
Figure 2. A sudden displacement is applied to the Maxwell model, whereas a sudden load is introduced to the Kelvin model [
34]. Consequently, the Maxwell model will yield a stiffness function or relaxation function to relate the responding force with the sudden imposed displacement
as shown in
Figure 3. Likewise, the Kelvin model will produce a compliance function or creep function to relate the resulting displacement with the suddenly imposed force
, also shown in
Figure 3. For the Maxwell model, we also introduce the displacement
where
is the Heaviside function. The total force function
can be expressed as the combination of the location force
and
for the stiffness and dashpot couple
with the relaxation time
. Furthermore, using the same force or stress for the series component and the same displacement or strain for the parallel component, we obtain the following governing equations for the Maxwell model:
Hence, using the concepts we have been discussing for the first-order ODE, we obtain:
namely using integration by parts,
Finally, we have
and the total force
for the Maxwell model. Likewise, denote the sudden load as
where
is a Heaviside function, the total displacement function
can be expressed as the combination of the location displacement
and
for the stiffness and dashpot couple
with the relaxation time
. Using the same force or stress for the series component and the same displacement or strain for the parallel component, we obtain the following governing equations for the Kelvin model:
Thus, using the concepts we have been discussing for the first-order ODE, we obtain:
Finally, we have the local displacement
and the total displacement function can be expressed as
for the Kelvin model. To further the discussion with relaxation and creep functions, we can also introduce a general Kelvin viscoelastic model as elaborated in ref. [
35]. Similar approaches are also implemented for the viscoelastic vibration model with a mass
m and a concentrated load
. We first introduce the Kelvin viscoelastic model in a dynamic case as shown in
Figure 2, essentially a typical Kelvin viscoelastic setup for creep test combined in series with a spring with a stiffness
and a mass
m. The displacement of the parallel section of the stiffness
and the dashpot
share the same displacement
, whereas the displacement of the stiffness
is denoted as
. Since the mass
m is connected with the stiffness
in series, the total displacement of the mass
is a combination of the two displacements
and
. In general, the external load
is applied to the mass
m. We can imagine that in the creep test, we can add a dead weight
in addition to the weight of the mass
.
Using the same procedure and considering each section in series and the consequent continuity of axial forces, we have
Using the kinematic relationship
, we obtain the following third-order governing equation for
,
In this paper, for simplicity, in the implementation of the inverse optimization approaches, Equation (
9) is directly applied with adjusted parameters
,
m,
, and
. The measured force
is introduced to derive the closest
which matches with the measured displacement. As validated in ref. [
34], with no dashpot, namely
, Equation (
8) yields
hence
Finally, the governing Equation (
9) yields the familiar spring-mass vibration system
Notice the effective stiffness of two springs in series. Moreover, the infinitely stiff spring
, namely
, consequently,
and
. Finally, we recover the familiar spring-mass-dashpot vibration system
Finally, in order to facilitate the solution, introduce the state variable
, we can rewrite the third-order viscoelastic vibration system with a dynamical system format,
Consider the Maxwell viscoelastic model in a dynamic case as shown in
Figure 2, essentially a Maxwell viscoelastic setup for relaxation test in combination with a mass
m connecting in series with two parallel branches, one with a stiffness
and another one with a stiffness
and a dashpot
in series. The displacement of the parallel section shares the same displacement
, whereas the displacement of the stiffness
is denoted as
and the dashpot
as
. Please note that the displacement of the stiffness
is
. Thus, the total displacement of the mass
is a combination of the two displacements
and
within one of the parallel branches. In general, the external load
is applied to the mass
m. In a relaxation test, we can simply add a dead weight
in addition to the weight of the mass
. Similarly, assuming the force in the dashpot and stiffness series as
, and considering each section in series and the consequent continuity of axial forces, we have
Using the kinematic relationship
as well as
, we obtain the following third-order governing equation for
,
Again, with no dashpot, namely
. Equation (
8) yields
, hence the governing Equation (
12) yields the familiar spring-mass vibration system
Likewise, as the infinitely stiff spring
, namely
, consequently,
and
we recover the familiar spring-mass-dashpot vibration system
As presented in ref. [
34], in numerical solutions, we rewrite the third-order viscoelastic vibration system with a dynamical system format,
with the state variable
, and
As shown in
Figure 4 and
Figure 5, for such a viscoelastic model representing the downhole sucker rod system and starting from the reference position with no initial velocity and acceleration, we employ
,
,
,
, and
. The external force
is a deadweight
. Based on the Matlab simulation, the vibration eventually settles down to an equilibrium position due to the dashpot damping. Of course, the deadweight will be replaced with the actual dynamometer load measurements, and the actual polish rod displacements will be compared with the displacement solutions. As shown in
Figure 6, even with a very preliminary Kelvin model, we can still recreate the hysteresis loop of load and displacement for the sucker rod-pump system. In the simulation, the magnification factor is 85 for both Maxwell and Kelvin models to match the actual motion of the sucker rod with the viscoelastic model in the simulation. Notice that the load
used in the viscoelastic model is the exact load measurement recorded in TAM software 1.6 examples. In general, by reducing the parameter
m, the peak of the displacement will decrease and shift to the left, which corresponds to the increase of the natural frequency. In addition, the endpoint will also decrease accordingly. Moreover, by reducing the parameter
, the peak of the displacement will increase, and the endpoint will also be elevated accordingly. By increasing the parameter
, the viscous damping is increased, and both the displacement peak and the ending points will be increased. Finally, by increasing the stiffness parameter
, both the displacement peak and the end displacement tend to decrease. Notice that here, the magnification factor
C, along with the parameters
m,
, and
, are chosen with intuition through trial-and-error methods and human interventions, as reported in ref. [
34]. However, in this paper, with the initial guesses of these parameters, we will implement a so-called Inversed Optimization Method to identify the optimal set of parameters with iterations in the steepest descents. With this Newton–Raphson iteration-based approach, these parameters will be searched and improved automatically. A subsequent Kelvin viscoelastic vibration system with adjusted parameters
m,
, and
demonstrates a much closer displacement response with the measured force
as shown in
Figure 6, which confirms the potential of inverse optimization approaches with the Newton–Raphson iterations.
3. Inverse Optimization
In engineering practice, many complex systems are impossible to characterize with a simple physical and mathematical model; therefore, an implicit matrix-free iterative method is very useful in providing better guidance to the optimum operation conditions with only the availability of the input and output data [
36]. In operation research, to accomplish an optimal route or desired outcome, so-called inverse optimization approaches are introduced to identify provided key parameters [
37]. Similarly, in robotics, to reach a particular position, multiple joint angles can be identified with the same Newton–Raphson iterative schemes for the solution of nonlinear position equations governing the desirable positions of the robotic arm along with the unknown joint angles [
38]. The inverse optimization is based on the Newton–Raphson iterations, which can be used to search more strategically for the optimal system parameters. Since engineers function within an approximated reality, this inverse optimization approach can be used to search without knowing the true relationship between the optimal material compositions to achieve the best mechanical properties or any type of property. Of course, similar acceleration methods commonly employed in the Newton–Raphson iterations can also be available for the design of more efficient and purposeful search processes.
In the inverse optimization approaches introduced in this paper, in order to identify these intrinsic viscoelastic properties by considering different physical units, we also introduce a scaling factor
C. We set up an inverse engineering problem to minimize the difference measured by the following variational indicator
where
N represents the number of time stations,
is the displacement evaluated with the viscoelastic model with the stiffness
k,
m,
, and
, whereas
is the experimental measurement of the displacement in question at the same time intervals. For the minimized error, cost function, or variational indicator
E, we have
This estimate evaluated with finite difference schemes will be directly coupled with the system parameters, for example,
k,
m,
, and
,
We must introduce the Newton–Raphson iterative procedures to obtain the solution of the nonlinear and implicit set of equations. In general, the Newton–Raphson iterative method should be used for this type of nonlinear set of equations. The nonlinear and implicit governing equation about the unknown vector
, can be rewritten as
where the given right-hand side vector
.
It is very important to point out that the initial guess must be fairly close to the actual solution for the unknown
to ensure the convergence of the Newton–Raphson iteration scheme. In practice, we often start with a few tryouts and narrow down the true solution neighborhood. With an educated guess of the initial set of parameters
, not too far from the converged solution, the Jacobian matrix can be defined and evaluated. Assume we have all the information before the
kth iteration, namely
and the corresponding
as well as the so-called Jacobian matrix
with all entities
defined as
Furthermore, the off-diagonal terms for the Jacobian matrix with
can also be elaborated as
It is straightforward to confirm that the Jacobian matrix is indeed symmetric. After the solution of the following incremental linear system of equations for the unknown
with the following update,
The iteration identified in Equation (
20) will stop with the relative incremental error
smaller than prescribed small number
,
In the actual implementation, since we do not have the analytical expressions for
,
,
, and
, a central-difference-based numerical scheme is introduced. Assuming the increment
, we will complete the numerical integration of the dynamic response of the viscoelastic model for three sets of parameters, namely
,
,
, and obtain the numerically the approximations as follows
As the most complicated term, the second partial derivative with respect to
and
with
, namely
is evaluated as follows
In the implementation, we can always use a sufficiently small increment for the partial derivatives of as a function of .
4. Implementation and Improvement
To verify this proposed inverse optimization procedure, we start with a simple first-order differential equation with one parameter, a so-called relaxation time
, expressed as
where
is a time-dependent inhomogeneous term.
Instead of the actual experimental measurement, in the validation process, we employ the actual analytical solution
, expressed as
with the initial solution
and the convolution term with the so-called Green’s function for impulse
Please note that although we have the analytical solution as a continuous function, in engineering practice, the experimental measurements often exist in discrete form. Therefore, a proper number of time steps
N must be taken before we start the inverse optimization process for the search of the system parameter, which yields the solution
with
In the initial implementation, the maximum number of iterations is set to be 200, and the time station number is 2001. In addition, the finite difference approximation of some of the implicit terms of the Jacobian matrix is based on the
perturbation of the parameter
and the scaling factor
C. The analytical solution is based on the relaxation time
. As shown in
Table 1, the only system parameter, namely the relaxation time
, does converge to a value very close to 5 within approximately
range. Moreover, the scaling factor
C is also simultaneously converged to 1. The quadratic convergence rate towards the end of the iteration processes is evident in
Table 1.
It is well accepted that there is no guarantee for the Newton–Raphson iteration to converge, particularly when the initial guess is very far from the desired solution. Moreover, it is often possible that different initial solutions will lead to different branches of solutions [
35,
39]. Different acceleration procedures have been proposed to improve the convergence behaviors of these nonlinear iterative solution procedures, such as line search methods [
40]. In this paper, based on the understanding of the possible solution key features, we can also start the optimization procedure from the very beginning. For example, for the first-order ordinary differential equation (ODE) exponential solutions, rather than connecting with the solution itself, we can choose to connect with the logarithmic of the solution. In this way, the nonlinear system can be less challenging, which can fundamentally change the basin of convergence in the Newton–Raphson iterative procedures. Hence, we set up an inverse engineering problem to minimize the difference measured by the following variational indicator
where
N represents the number of time stations,
is the displacement evaluated with the system parameter, in this case, the relaxation time
,
is the experimental measurement of the displacement in question at the same time intervals, and
D stands for the new constant which is related to the initial scaling factor
C with
.
Similarly, to the minimized error, cost function, or variational indicator
E, we have
Please note that the scaling constant
D still has an explicit expression. The derivative with respect to
D will be evaluated directly, unlike the system parameter
, which must be evaluated with finite difference schemes. This estimate of the scaling factor
D will be directly coupled with the system parameter and form the unknown vector with
, with the nonlinear set of equations expressed as
To effectively carry out the Newton–Raphson iterative procedures for the nonlinear and implicit governing equation about the unknown vector
, the so-called Jacobian matrix
must be properly evaluated,
Furthermore, the off-diagonal terms for the Jacobian matrix can also be elaborated as
Again, it is straightforward to confirm that the Jacobian matrix is indeed symmetric. In the actual implementation, since we do not the analytical expressions for
,
, and
, central difference schemes similar to Equation (
22) will be employed by replacing
with
. It has been discovered that the range of the system parameter
is much wider for the Newton–Raphson iteration procedures with the logarithmic modification. In
Table 2, the converged solutions for the parameter
and the scaling factor
, which is equivalent to
are listed with a similar quadratic rate near the solution and
system error due to the finite difference approximations with the perturbation of about
of the system parameter.
The same implementation has also been extended to a more complicated second-order differential equation with three parameters, namely the mass
m, the damping
c, and the stiffness
k, expressed as
where
is again a time-dependent inhomogeneous term.
Denote the natural frequency
with
, the damping ratio
with
and the damped natural frequency
Instead of the actual experimental measurement, in the validation process, we employ the actual analytical solution
, expressed as
with the initial displacement
and the initial velocity
along with the convolution term with the so-called Green’s function for impulse
In the second implementation, the maximum number of iterations is again set to be 200, and the time station number is 2001. In addition, the finite difference approximation of some of the implicit terms of the Jacobian matrix is based on the
perturbation of the parameters
m,
c, and
k along with the scaling factor
C. The analytical solution is based on the set of parameters
,
, and
. As shown in
Table 3, the system parameters, namely
m,
c, and
k, do converge to the set of values very close to the true system parameters, again within approximately
range. Moreover, the scaling factor
C is also simultaneously converged to 1. The quadratic convergence rate towards the end of the iteration processes, when the solutions are very close to the targets, is again evident in
Table 3, which also indicates proper programming and implementation of the Newton–Raphson iteration procedures.
Finally, we use the experimentally measured data from V11, which is well documented in Echometer Co and utilized in ref. [
34] as the analytical solution of the equivalent viscoelastic vibration system modeled with the Kelvin model. With the same inverse optimization procedures, we obtain the system parameters with
,
·
,
·
, and
, and the scaling factor
. The displacement and force/displacement loop match very well with the experimental data documented by Echometer Co., as shown in
Figure 6,
Figure 7,
Figure 8 and
Figure 9.
To validate the inverse optimization approach further and to test our hypothesis that the entire downhole sucker rod-pump system can be approximated with the viscoelastic model, we employ the same procedures for another set of dynamometer measurements taken from the same V11 well at 7:14:19 a.m. on 7 August 2019 Stroke 17, the exact load measurement recorded in TAM software examples, and obtain a different but similar set of system parameters with , ·, ·, and , and the scaling factor .
The convergence information is listed in
Table 4. The viscoelastic model does not match exactly with the sucker rod-pump system. In addition, unlike the previous mathematical models from which the numerical or analytical solutions are derived, the data from the experiments are heuristic. Thus, the quadratic convergence properties of the Newton–Raphson iterative procedures are replaced with an oscillatory convergence with a rate much slower than the typical quadratic one observed for the Newton–Raphson iteration when the iterative solutions are within the neighborhood. Again, since the numerical evaluation of some of the Jacobian matrix entities has a truncation error around
the converged system parameters will hover around that relative error range.
Again, the displacement and force/displacement loop match very well with the experimental data documented by Echometer Co, as shown in
Figure 6. Interestingly, the same system parameters have been applied to Stroke 18 and demonstrate a remarkable match with the actual experimental measurement.