Studio 5000 Totalizer Function Block GPM to MGD

Let's go back to the beginning:

I am trying to setup the TOT function block so that I bring in GPM and want to output MGD. I cannot seem to figure out the correct gain in the function block. I typically use GPM and convert it to Gal x 1000 using the gain, but I'm not sure if it's possible to get MGD as the totalized output. Has anyone ever tried to do this using the TOT function block?

The input to the TOT block is a rate i.e. quantity per unit time e.g. GPM, gallons per minute

The output from the TOT is a quantity, e.g. gal (gallons) or Mgal (million gallons); MGD is a rate, so that will never be the output (Total) of the TOT block.

If you want the accumulated flow, Mgal (quantity), over a time period of one day (time), you can reset the TOT block every day (1d = 24h = 1440min = 86400s), and the total Mgal for the day ending at the previous reset will be available as the OldTotal output parameter. That OldTotal quantity value in Mgal will have the same magnitude as the average flow rate, in MGD, for that previous day, but only because it was totalized over one day.

To convert an instantaneous rate in gpm to an instantaneous rate in MGD (million gallons per day), you need to multiply by 0.00144; see the derivation below.



Code:
[COLOR=Magenta][COLOR=Black]1.1) Definition of a megagallon:[/COLOR][/COLOR]

[COLOR=Magenta][COLOR=Black]    1Mgal = 1000000gal
[/COLOR][/COLOR]
[COLOR=Magenta][COLOR=Black]1.2) Divide both sides by 1000000gal:[/COLOR][/COLOR]

[COLOR=Magenta][COLOR=Black]      1Mgal         1000000gal
[/COLOR][/COLOR][COLOR=Magenta][COLOR=Black]   ----------  =   ----------[/COLOR][/COLOR]
[COLOR=Magenta][COLOR=Black]    1000000gal      1000000gal[/COLOR][/COLOR]

[COLOR=Magenta][COLOR=Black]1.3) Simplify:
[/COLOR][/COLOR]
[COLOR=Magenta][COLOR=Black]            MGal
[/COLOR][/COLOR][COLOR=Magenta][COLOR=Black]   0.000001 ----  = 1
[/COLOR][/COLOR][COLOR=Magenta][COLOR=Black]             gal[/COLOR][/COLOR]
Code:
[COLOR=Magenta][COLOR=Black]2.1) Definition of d (day) in minutes:[/COLOR][/COLOR]

[COLOR=Magenta][COLOR=Black]    1440min = 1d[/COLOR][/COLOR]

[COLOR=Magenta][COLOR=Black]2.2) Divide both sides by 1d:[/COLOR][/COLOR]

[COLOR=Magenta][COLOR=Black]    1440 min     1d[/COLOR][/COLOR]
[COLOR=Magenta][COLOR=Black]    --------  =  --[/COLOR][/COLOR]
[COLOR=Magenta][COLOR=Black]       1d        1d
[/COLOR][/COLOR]
[COLOR=Magenta][COLOR=Black]2.3) Simplify:[/COLOR][/COLOR]
[COLOR=Magenta][COLOR=Black]
[/COLOR][/COLOR][COLOR=Magenta][COLOR=Black]        min
[/COLOR][/COLOR][COLOR=Magenta][COLOR=Black]   1440 ---  =  1
[/COLOR][/COLOR][COLOR=Magenta][COLOR=Black]         d
[/COLOR][/COLOR]
Say we have a flowrate of 1000gpm, and we want to convert that to Mgpd. We know that we can multiply any value by 1 and it will still be the same number. Since we have two values above that are equivalent to 1, let's take our 1000gpm and multiply it first by one, and then by the other:
Code:
[COLOR=Magenta][COLOR=Black]        gal[/COLOR][/COLOR]
[COLOR=Magenta][COLOR=Black]  = 1000 --- [/COLOR][/COLOR]
[COLOR=Magenta][COLOR=Black]         min
[/COLOR][/COLOR][COLOR=Magenta][COLOR=Black]
         gal
  = 1000 ---  x 1               [Multiplying by 1 does not change the value]
         min
[/COLOR][/COLOR][COLOR=Magenta][COLOR=Black]
         gal             Mgal
  = 1000 ---  x 0.000001 ----   [0.000001 Mgal/gal is equal to 1]
         min             gal
[/COLOR][/COLOR][COLOR=Magenta][COLOR=Black]
                      gal Mgal
  = (1000 x 0.000001) --------  [rearranging ...]
                      min gal
[/COLOR][/COLOR][COLOR=Magenta][COLOR=Black]
          Mgal
  = 0.001 ----                  [gal in numerator and denominator cancel]
           min
[/COLOR][/COLOR]
So 1000gal/min (gpm) is equivalent to 0.001Mgal/min

Applying the same approach to the time units:
Code:
[COLOR=Magenta][COLOR=Black]      Mgal[/COLOR][/COLOR]
0.001 [COLOR=Magenta][COLOR=Black]--- [/COLOR][/COLOR]
[COLOR=Magenta][COLOR=Black]       min
[/COLOR][/COLOR][COLOR=Magenta][COLOR=Black]
          Mgal
  = 0.001 ---  x 1               [Multiplying by 1 does not change the value]
          min
[/COLOR][/COLOR][COLOR=Magenta][COLOR=Black]
          Mgal        min
  = 0.001 ---  x 1440 ---   [1440min/d is equal to 1]
          min          d
[/COLOR][/COLOR][COLOR=Magenta][COLOR=Black]
                   Mgal min
  = (0.001 x 1440) --------  [rearranging ...]
                   min d
[/COLOR][/COLOR][COLOR=Magenta][COLOR=Black]
          Mgal
  = 1.440 ----                  [min in numerator and denominator cancel]
           d
[/COLOR][/COLOR]
So 0.001Mgal/min is equivalent to 1.44Mgal/d, the latter of which is therefore equivalent to our original flowate of 1000gal/min (gpm).

Oh and by the way, making the mistake of dividing, instead of multiplying, gpm by 1440 and using the result as the input to the TOT block, then scaling by a Gain of 0.00000144, yields Ggal (billions of gallons) in the Total and OldTotal outputs of TOT.

All that is needed is a sense of proportion.

And yes, when I wrote "That's what I thought," that was supposed to be funny.
 
Last edited:
I am trying to setup the TOT function block so that I bring in GPM and want to output MGD. I cannot seem to figure out the correct gain in the function block. I typically use GPM and convert it to Gal x 1000 using the gain, but I'm not sure if it's possible to get MGD as the totalized output. Has anyone ever tried to do this using the TOT function block?

For your GPM input directly to .In, a Timebase of 1 and Gain of 0.000001 will get you MGals at .Out.

Test that with fixed .In value over a short totalization period to convince yourself (I just did):

.In = 694 (Integer)
.Timebase = 1
.Gain = 0.000001

exactly sixty seconds later...

.Out = 6.94000046e-004

After 1439 more minutes at that .In rate your .Out would be 0.9993601 (1 MGal)
 

Similar Topics

Good morning, I have a flow meter that has an output pulse configured to 378.541 liters per pulse. My question is, do I just count the pulse per...
Replies
19
Views
1,807
Good morning, I have a flow meter that that has an output with is a pulse. The pulse is configured to 378.541 liters per pulse. My question is...
Replies
6
Views
704
Hi Everyone. Not posted on here for a long time, but I am hoping someone can help me. I am doing a differential pressure calculation in a L27ERM...
Replies
15
Views
267
Hi, how do I convert 2x Integer registers to a Real? The two integers are from Modbus registers that contain a floating point value, I need to...
Replies
2
Views
121
What is the best way to extract the hour and minute from the register that comes from Yaskawa VFD. In studio 5000 I have a register saved as INT...
Replies
3
Views
125
Back
Top Bottom