# Control Valve Simulation in the Age of the Black Box

## The Black Box: All It Takes to Gain Answers to Complex Questions Is to Push Buttons on a Box, and the Canned Software Will Provide the Answer, Right?

*"Ask the Experts" is moderated by Béla Lipták (**http://belaliptakpe.com/**), process control consultant and editor of the three-volume Instrument Engineer's Handbook (IEH). He is recruiting contributors for the 5th edition. If you would like to contribute or if you have questions for our team of "experts, please send them to **liptakbela@aol.com**. *

**Q: **My background is in electronics, and I need to simulate the behavior of a valve in Simulink (MATLAB). Both the inlet and outlet pipe diameter to the valve are 2 inches. How do I select the diameter inside the valve? Should it be more or less than the size of inlet? Because I already have the model in MATLAB, I just need to choose the diameters of the duct inside the valve and the inlet and outlet ducts connecting the valve. My valve is a straightforward one run by a stepper motor. I don't know the exact name of it in mechanical terms, but I believe that the output from the motor (cross-sectional area) is fed to the valve as an input based on which valve will open or close. Is there any site where I can get some ready-made simulated valves that can be run in Simulink?

*Mohammed Hanneef*

*Mohammed.Hanneef@Honeywell.com*

**A: **This question reflects today's culture of the "black box." This culture suggests that all it takes to gain answers to complex questions is to push some buttons on a box or to plug in a number, and the canned software will provide the answer. This is wrong! The question, "What port size is required if the pipe is 2 in?" is similar to asking, "What size shoe should I buy if my waste is 34?"

If process control in general or control valve simulation in particular were that simple, we would not need process control engineers! Gadgets like black boxes are only as good as the software inside, and if the programmer did not understand the problem, the software is useless. The rule of "garbage in, garbage out" will apply! In other words, if the instructions for a valve simulator require only to provide the inside diameter of the valve, that simulator model is useless.

This does not mean that there is anything wrong with Simulink. It is a commercial tool for modeling, simulating and analyzing multi-domain dynamic systems. It is used in the model-based simulation of the control of both simple processes, such as the thermostat control of a home, or as complex processes as the simulation of the automated transport vehicle (ATV) used in the international space station. The problem is not with the capabilities of this software; it is with the understanding of what information it needs to make the simulation meaningful.

In order to simulate the behavior of a control valve station, first the purpose of the simulation must be defined, and then both the characteristics (the "personality") of the valve and the nature of the process must be described. The process description includes both the nature of the installation and the properties of the flowing fluid, including its Reynolds number. As to the valve/actuator/positioner package itself, both its steady state and dynamic behavior should be described.

Its steady-state behavior (characteristics) describes the relationship between valve position and flow as a function of pressure drop (on the left of Figure 1). This inherent characteristic (linear, equal-percentage, hyperbolic, quick opening, square root, etc.) is affected by the variation in the system pressure drop, which determines the distortion coefficient (Dc on the right of Figure 1) and results in the actual characteristics of the valve.

The dynamic behavior of the valve station describes the relationship between the controller output signal (desired valve position) and the actual valve position, which is affected by the dead band and velocity limits of the installation. Naturally, these effects are reduced if the valve is provided with a positioner.

The dynamic behavior of a control valve may be represented by a time lag of first or second order, with a limited velocity in stem movement. The time lags are simulated by lag or lag-lead elements. Velocity limiting may be expressed by the differential equation below,

where x is the stem position, vL denotes the velocity limit, and xideal is the input position of an ideal, unconstrained valve. When the velocity exceeds the limiting value, the gain of the actuator decreases, and its phase lag increases.

The electrical engineer asking this question probably did not understand what I wrote here, but it should show that simulation is a complex and sophisticated field of engineering that requires process control knowledge, and if somebody suggests that all you need to simulate a valve is to plug in the port diameter, that person does not possess that knowledge. If you want to learn about valve simulation, read Chapter 8.11 in the 2nd volume of my handbook, the many ISA documents (such as 75.25) on valve simulation, or see my 2007 article on the subject at www.controlglobal.com/articles/2007/451.html.

*Bela Liptak*

*liptakbela@aol.com*

**A: **The simulation you are using might not be adequate.

First your request does not say why the simulation is being done. That is, is it to learn flow dynamics, control dynamics or simply to estimate flows and pressure drops under a static situation? Each objective will require a different approach.

For the valve flow, see the ISA valve sizing program if the valve is to be used over a wide range. Flow relationships will vary with pressure drop and be linear versus stem position at very small openings; go into a region where the square root of pressure difference sets flow; and then may well go into a choked-flow regime where the flow is constant regardless of pressure changes. Also, the valve flow coefficient might not be linear with stem position.

For dynamics, see ISA 75.25 for the impact of imperfect stem positioning versus control signal to describe control problems caused by valve actuator dynamics.

If your concerns are simple, the valve simulation can be simple. If you are looking for subtle issues or for a difficult application, the simulation will have to be more detailed. A valve is not a simple resistor.

Simulation can be a very powerful tool. The question is always, is it valid? Can it be proven adequate for the questions asked? I know very well how to get the desired answer, but that might not represent the truth.

*Cullen Langford former chair of ISA 75.25 and 75.07*

*CullenL@aol.com*

**A: **In Simulink simulations, I recall that there is an input function block for step inputs. Please check. (I could be wrong, since I have not used MATLAB, Simulink, Control Toolbox, Signal Processing, etc. for awhile). But having an input function block is of no use. You need to write your own simulation codes for the control valve. This means you need to know the dynamics of your valve—the time constant, the gain, the time lag, etc., of its responses to step changes. More important is the resolution of your valve; typically a diaphragm-operated valve has a resolution of 2%, while a piston-operated valve has a resolution of only 1%. I have not seen any stated resolution for step-motor actuator. (The resolution here means the changes in output fluid pressure caused by the valve for every unit change in valve stroke).

You can study the dynamics of your valve by statistics—clusters analysis, PCA (principle component analysis), DMC (dynamic matrix), etc., from historical data captured with a sampling time at least several times faster than your step motor. (I am assuming that your plant data were captured once every second for a total number of 6000 plant variables). The changes in the output (ideally the flow rate of the valve), if not, the valve stroke, versus the input (the step motor input signal and dynamics of the motor) have to be given.

There is software in the market called Process Doc, written in MATLAB codes, which can help you to pinpoint the key dependent variables as a function of the independent variable (the flow rate of the valve or the valve stroke). But again you need to provide enough statistical data, both for building a model for the valve and for model validation. You can start out by assuming a model, such as Box-Jenkins or ARMA models, etc., and work your way by including white noise, using your Model Identification Toolbox. For reference, please read and examine the codes in IDDEMO. To build a model using MATLAB and Simulink is fast, but garbage in, garbage out, if the dynamics of the valve are unknown or assumed incorrectly.

It is not impossible to build a valve model analytically. But it is very difficult to do so, and basic chemical engineering assumptions have to be used. Sometimes the viscous nature of the fluid can affect the response of your valve to an unknown extent for every change in your step motor input.

I do not believe anyone would, or could, release ready-made software that will simulate your valve for free. I have seen MATLAB + Simulink crashed in non-linear engineering applications.

For any modeling of a control valve, it has to meet the published Cv versus lift in the valve catalog provided by the specific manufacturer. Lift here means the percent opening or travel of the valve plug inside the valve trim. Such published Cv versus lift data is used to validate the valve model. For a given valve size, the Cv versus lift varies from manufacturer to manufacturer because the loss coefficients of their trims are not the same, since their trim geometries are not the same. Even among the various valve types or valve models of the same size made by the same valve manufacturer, the loss coefficient of the trims are not the same. The loss coefficient can be calculated from the geometry of the trim based on knowledge (internal flows) in chemical engineering transport phenomenon or in mechanical engineering fluid mechanics.

For example Crane Technical Publication 410 bases the flow geometry model on a circular flow geometry and suggests the following relationship:

Cv/A = 38/sq.root (k)

Where A = 3.1416d2/4 and is the effective flow area of the valve trim in inches squared,

k is the loss coefficient of the valve trim (dimensionless), and d is the equivalent flow diameter inside the valve trim.

The above equation assumes that the capacity of a control valve (Cv) is a function of the upstream resistance (i.e., loss coefficient) of the valve trim. Knowing the loss coefficient and the Cv, the effective flow area (A) can be calculated. This area is always smaller than the physical flow area of the valve trim, depending on the upstream loss coefficient, k. Cv is called the capacity of the control valve, while Cv/A is called the flow capability of the control valve because it is a function of the trim loss coefficient.

For complicated valve trim geometries, the loss coefficient can be calculated by an iterative method: First assume a numerical value for k; measure the outlet flow area of the trim or from its photograph; calculate the Cv/A at the trim outlet; then calculate the Cv/A at the trim inlet and, therefore, the Cv. If the calculated Cvs match with the published Cv at various strokes to within 5%, then the assumed loss coefficient is the k of the valve trim. Such a reversed engineering method has been published by Joe Steinke of CCI.

There are valve trims with variable loss coefficients as the valve stroke changes. Examples are those control valves used in regulating boiler feedwater flow, where the trim loss coefficient varies to take into account the boiler pump curve for optimized control—low flow rate at small valve opening with high loss coefficient; high flow rate at large valve opening with low loss coefficient.

*Gerald Liu, P.Eng.Control Valve Consultant*

*gerald.liu@shaw.ca*

## What are your comments?

Join the discussion today. Login Here.

## Comments

No one has commented on this page yet.

RSS feed for comments on this page | RSS feed for all comments