`What products are involved in this article?This article is based on the use of RCP (Rheonics Control Panel) connected to the SME (Smart Module electronics) operating SRD, DVP, and DVM. Hence it can be used for any of these Rheonics sensors.`
`What is the purpose of this article?Explain the process to get a temperature compensated density when it has a linear trend. Usual applications are with fluids with a linear dependency on temperature.`

`1. Temperature-compensated Density`

Density, defined as the substance's mass per unit of volume is an important fluid property that has an increasing presence in monitoring processes and control systems.

Density is affected by temperature and pressure. For most liquids, the Density decreases with temperature. As pressure increases, the density of any stable material also increases, markedly in gases, and almost negligibly in liquids and solids.

In most cases, we want to monitor the fluid density at a constant reference temperature. If the process temperature isn’t constant, an additional source of error to the control system is added. To avoid the temperature dependence on the fluid’s density and truly monitor its consistency, the temperature compensated density is introduced.

To compensate for temperature effects, the Rheonics Control Panel offers the following models Linear, Polynomial, or ASTM functions.

`2. Math model`

The SRD sensor can measure inline density, viscosity, and temperature. With the use of mathematical models, temperature compensated measurements can be obtained.

Below is the mathematical formula for the density linear model used in the RCP (Rheonics software).

Equation 1: Density Polynomial Model.

Where:

ρcomp - Compensated density, calculated by the Sensor.

ρL - Line density, read by the Sensor.

and - Coefficients, specified by the user.

T - Temperature, read by the Sensor.

Tref - Reference temperature, is the temperature around which the Sensor will compensate the readings. This is defined and should be specified by the user.

`3. Checking the data`

The first step to achieving a compensated density requires the user to take samples of density at different temperatures, these temperatures must be higher and lower than the operation temperature range in your process. Once enough data is obtained (to see the polynomial behavior), the user should define the reference temperature.

The following steps outline the correct procedure for data analysis:

3.1.  Select the reference temperature and density from data obtained in tests. Here, reference temperature and density are highlighted in blue in the next Table, we want to create a correlation at 20°C where we expect a density of  0.9982067 g/cc.

 Temperature [°C] Density [g/cc] 10 0.9997 15 0.9991026 20 0.9982067 25 0.997047 30 0.9956488 35 0.9940326

Table 1. Data points from inline measurements.

3.2. Plot data points of Denisty vs Temperature to study the behavior of the data. In this scenario, the data behavior can be represented by a second order polynomial curve.

Figure 1: Plot chart Density vs Temperature

3.3. To obtain coefficients A and B from equation 1, we will simplify and reorganize the expression by using variables  A', B', T', and ρ', so we get equation 2.

A' = A/ρcomp, B' = B/ρcomp, T' = Tref - T, and ρ'= ρ/ρcomp

Equation 2. Equation 1 simplified and  rearranged

3.4. Then, we have to calculate the relation between compensated or reference viscosity and the measured viscosity by dividing the two.

 ρ'= (Line densi/Comp. densi) @20 °C Results ρ'= 0.9982067/0.9997 0.99850625 ρ' = 0.9982067/0.9991026 0.9991033 ρ' = 0.9982067/0.9982067 1 ρ' = 0.9982067/0.997047 1.00116313 ρ' = 0.9982067/0.9956488 1.00256908 ρ' = 0.9982067/0.9940326 1.00419916

Table 2. Compensated viscosity calculation table.

3.5. After that, calculate the difference between the reference and measured temperature by subtracting them.

 T' = Tref - T @20 °C Results T' = 20 - 10 10 T' = 20 - 15 5 T' = 20 - 20 0 T' = 20 - 25 -5 T' = 20 - 30 -10 T' = 20 - 35 -15

Table 3. Variation to the reference temperature.

3.6. Plot the V’ (Comp. Visco/Visco @20°) vs T' (Tref - T) and use a second order polynomial trendline to find A and B values or make a regression analysis to find the coefficients.

 T' = Tref - T @20 °C ρ'= (Line densi/Comp. densi) @20 °C 10 0.99850625 5 0.9991033 0 1 -5 1.00116313 -10 1.00256908 -15 1.00419916

Table 4. Datapoints for viscosity and temperature referenced to known values.

A graphing tool is used to create a trendline with the points obtained, it can also show the trendline equation.

Figure 2: Plot chart ρ' vs T'.

The equation in Figure 2 is compared against Equation 2, we obtained the following coefficients:

A' = 0.0002 and B' = -0.000005

We can calculate the values A and B to the values A' and B' as shown below

A = -A'*ρcomp and B = -B'*ρcomp

A= -(0.0002*0.9982067)  and B = -(-0.000005*0.9982067)

A = -0.00019964 and B = 0.00000499103

Figure 3. Expected results when applying the mathematical model.

`4. How to load models into the Sensor electronics?`

The calculation tab on RCP allows configuring the Sensor to run mathematical models for viscosity, density, and concentration. Expert mode needs to be enabled for this.

Figure 4. Calculation tab for the exponential model of density.

The following steps are needed to load the models into the Sensor electronics:

1. In the dropdown list “Select Measurement to Apply Model” density should be as default parameter.  If not, select it from the options in the list.

2. In “Select Model from list” select the model you would like to use for the specific parameter. When you select the model, you will get more information about the specific equation used and the coefficients you will need to apply to that model.  Select “Density Polynomial model”

3. Input A calculated coefficient. For this example, it has a value of -0.00019964.

4. Input B calculated coefficient. For this example, it has a value of 0.00000499103.

5. Input reference temperature is used to find the coefficients models. In this example is 20°C.

6. Click “Upload Model” to load the model settings into Sensor electronics. The button should turn GREEN for a couple of seconds if the action was successful or turn RED if the operation was unsuccessful. This action will refresh the values for the uncompensated and compensated indicators. Here you can verify if the model is calculating the expected values. If not, you can correct and repeat the process.

7. Click “Load Configuration” to update the display and channel configurations in Sensor electronics.

4.1. Handling Sensor Outputs

For the SME-TRD, the compensated viscosity values can be shown on the display. Select the line to display the parameter:

Figure 5. Selecting read line for LCD display.

Select the analog channel to send data, this can be verified in the “Service” Tab

Figure 6. Selecting analog output channel

Measurement can always be accessed at the register address that is displayed.

Figure 7. Modbus TCP/IP register

4.2 Demonstration Video

Video 1. Configuration Density Polynomial model in RPC Software.