19 Replies Latest reply on Mar 26, 2015 9:58 AM by pthivierge

    Retention time in a tank

    tolisrouf

      hello everyone

       

      This time I believe I have something really difficult!!!

       

      There is an in-going flow in a tank and an outgoing flow out of the tank and a level set point (42-xxx.SP) which we change very often.This is our problem.We try to calculate the retention time of a thick liquor in a tank to use it in other calculations.The easiest way to calculate what is the retention time in a certain level of the tank, is to count how much time the tank needs to fill in that level. So in order to know the retention time in the tank when the level is e.g. 60% ,we have to know how much time it was needed to fill the tank to 60% level.

       

      I created a totalizer to calculate the time needed until the tank is filled to  the higher set point (60%).This is 'fillingtime'. What we really want is another tag called 'Retentiontime' to give us the time needed to fill the tank in a different level set point.For example:

       

      If the tank reaches 60% level in 60 minutes the 'fillingtime' totalizer shows 60 minutes.Now, if the level set point is set to 60% we want the 'retentiontime' tag  to show us 60 minutes.

      If we change the level set point e.g. to 30% , we want the 'retentiontime' tag to show us how much time needed until the tank is filled to that level)


      Or if it is easier we want the 'retentiontime' to show the time needed to fill the tank to the current level (if the level now is 24% to show us the time needed to fill the tank level to 24%)

       

      I tried to make it happen but I can't.It's too difficult for me.

       

      Does anyone have any ideas?Is there any way to do that?

       

      Thank you

        • Re: Retention time in a tank
          xwang

          Hi Apostolos,

           

          Let me describe my understanding from your explanation.  However, please forget Totalizer in my description.

          1. you have a tag to collect the data for the level

          2. the value of this tag might be changed manually or automatically.  For example, you could change it to 60% or 30%.  Or, it could be 24%

          3. you need to know the time for the liquor achieving to that level.

           

          If my understanding is right, I think you could do this via PI Event Frame.

          1. use the tag as the trigger

          2. store the frame for each event.  For example, the trigger could be from 0 to 60%, and the frame will store the time spend of this.

           

          This is the brief description, expect your feedback, and we could make some deep discussion.

           

          Xi Wang

          PI Developer Club

            • Re: Retention time in a tank
              tolisrouf

              Hello Xi,

               

              Thank you for your answer.

               

              1.Yes i have a tag that collects the data for the level.It shows in real time the level of the tank.

              2. I wasn't very clear with that.There is 2 level tags.One with the real-actual level and the other is where we set the Level Set point we want to keep in the tank.Imagine there is a discharge pump that keeps the level steady.We enter the Level Set Point we want to retain and the pump works in cascade to keep the level at the given set point

              3.I need to know the time for the liquor achieving to that level at the initially filling, either for the actual level or for a given level as the Set Point. (e.g. if the actual level now is 34% I need a tag to show me how much time needed when the tank was initially filled from 0 to 34%.

               

              the retention time of the liquor in the tank, for a certain level = the time needed to initially fill the tank to that level

               

              Hope I made myself clear.Ask me if you need anything else.

                • Re: Retention time in a tank
                  xwang

                  Hi Apostolos,

                   

                  One question is the time you need is always from empty to the value you set please? like your mentioned from 0 to 34%.  Is there any situation like from 20% to the value you setting up please?  Many thanks.

                   

                  Xi Wang

                  PI Developer Club

                    • Re: Retention time in a tank
                      tolisrouf

                      Yes sir. The retention time we need refers only to the time needed to fill the tank from 0 to the level we want.

                       

                      Thank you Xi

                        • Re: Retention time in a tank
                          xwang

                          Hi Apostolos,

                           

                          If so, the PI Event Frame could set the trigger.  The start could be when the value of your real-time level tag = 0, and the end could be that value = your setting value.  The setting value could be from one attribute in PI AF.  Based on this setting, you could fetch out the time spend for each event you want I believe.

                           

                          Xi Wang

                          PI Developer Club

                            • Re: Retention time in a tank
                              tolisrouf

                              Sounds good but tell me something.

                               

                              It will give me the time when the level is reached to my setting value but the level changes all the time.We control it to different levels during the day.How can I see the retention time for a new level?If, for example,it counts 70 minutes from 0 to 60% it will show me retention time 70 minutes.When we change the level to 30% how can I make it show the retention time for this level?Can we make PI keep time for each level and show me this time every time the level changes?

                                • Re: Retention time in a tank
                                  Rhys Kirk

                                  Sure can. If you set the PE (or ideally the Abacus Analysis) to be event driven off the Level tag then it will calculate the time as the level changes.

                                    • Re: Retention time in a tank
                                      tolisrouf

                                      Understood.The thing is that I don't want Pi to calculate the time continuously.I want Pi to calculate the time in the beginning during the filling of the tank and then depending the level to give me the time needed to fill to that level.How can I do this?

                                        • Re: Retention time in a tank
                                          xwang

                                          Hi Apostolos,

                                           

                                          If setting the trigger as when level = 0, does this mean the calculation will start from the beginning of the filling please?  If not, PI Event Frame support mutiple trigger.  You could use one tag to control the start.  For example, you might have 2 tags, one for "level", we named "level" in here, the other for when the event start, we named "start" here.

                                           

                                          In the PI Event Frame, you could set:

                                          StartTrigger: 'level' = 0 and 'start' = '1'

                                          EndTrigger: 'level' = 34% or 'start = '0'

                                           

                                          From the above example, you could see that we could use 'and' and 'or' function to control your record.  How do you think this way please?

                                           

                                          Xi Wang

                                          PI Developer Club

                                            • Re: Retention time in a tank
                                              tolisrouf

                                              I have 2 tags. The first is for the level and the other showing the filling time of the tank.(notice that the level transmitter of the tank is not at the bottom which means that it needs 10 minutes to start reading the level)

                                               

                                              level           filling time

                                              0.1              10 minutes

                                              10               13 minutes

                                              20               17 minutes

                                              25               19 minutes

                                              30               25 minutes

                                              …                        …

                                               

                                              This record is ONLY for the first filling of the tank.We only care about this values. Since we filled the tank, we try to maintain the level in different set points because of our process. We may run the process for months but we care only for the first filling attribute.          

                                               

                                              What I want is a new tag called 'retention time' to continually show me the first filling time depending the current level of the tank. If the current level now is 10% I need to show me 13 minutes, if it is 20% to show me 17 minutes (according the previous table).

                                               

                                              This means that the tag ‘retentiontime’ have to look what is the current level now and then search and present to me what was the filling time in the beginning for the level we have now, the current one.

                                               

                                              The triggers for the ‘filling time’ could be like this. Start counting when the inlet flow is >0 and stop counting when the outlet flow>0 or the discharge pump is on. (We are filling the tank and when we hit the set point level, we start discharging to keep the level steady). Notice that we never stop feeding the tank so it’s a continuous process.

                                                • Re: Retention time in a tank
                                                  xwang

                                                  Hi Apostolos,

                                                   

                                                  From your description, it seems some challenge.  Can I ask some question please?

                                                  1. From my experience, some industries will have this kind of form to indicate the time spend and level rate of the tank before using PI.  According to your description, it seems you wish to use PI to generate that form please?

                                                  2. Do you need to store the timerange in PI please?

                                                  3. You mentioned "the filling is continuous", my understanding is you need to know many timeranges for one event.  Like when the inlet > 0, you need the timeranges for 0 to 10%, 0 to 20%...  Is that right please?

                                                  4. How about your inlet flow.  The speed is steady or change please?  Do you have a PI tag to store the flow speed please?  And do you have the volume of the tank please?

                                                   

                                                  Expect your reply.

                                                   

                                                  Xi Wang

                                                  PI Developer Club

                              • Re: Retention time in a tank
                                Rhys Kirk

                                You could use the FindEq function within an Abacus Analysis to determine when your tank was last empty - assumption here is that you empty it between operations.

                                 

                                So the following will give you the time your tank was last emptied...

                                 

                                TimeLastEmpty := FindEq('LevelAttribute','*','*-30d',0)

                                 

                                Then your "retention time" attribute would be something like

                                 

                                '*' - TimeLastEmpty

                                 

                                Then of course you could manipulate the expression to look for other starting values, e.g. 10%, up to the current value.

                                You may want to change the retention time to reflect the first time your tank hit its current level in the event that you're currently keeping the tank level constant.

                                • Re: Retention time in a tank
                                  Ian.Gore
                                  the retention time of the liquor in the tank, for a certain level = the time needed to initially fill the tank to that level

                                   

                                  Do you know the volume of your tank and the volume profile (if not a cylinder)?

                                  Do you know or measure the input flowrate into the tank - is it fixed?

                                   

                                  Retention time then becomes very simple Time = (Volume * level %) /. Flowrate.

                                   

                                  The retention time will change as the current level measurement changes.

                                   

                                  .

                                  • Re: Retention time in a tank
                                    dng

                                    Hi Apostolos,

                                     

                                    Have you found a solution for this issue? It would help others if you mark the answer that helped you as correct, otherwise you can give us more details so we can further assist you. Thanks.

                                    • Re: Retention time in a tank
                                      tolisrouf

                                      Guys you were very helpful.I finished my project and it worked.You were all very helpful.Thank you all!!!!

                                        • Re: Retention time in a tank
                                          pthivierge

                                          Hello Mr. Roufanis,

                                           

                                          I am very happy that things worked for you!

                                          I wanted to let you know that I re-marked your question as "success" instead of "Final", because "Final" has the side effect of not showing the comments when the page loads.

                                          Actually this is the first time I see what this Flag does, and I thing Success is more appropriate in your case

                                          And this should be easier for others to read this post.

                                           

                                          Have a wonderful day

                                           

                                          Regards,

                                        • Re: Retention time in a tank
                                          gavin.strack

                                          G'day,

                                           

                                          I've been working on asset templates using PI AF.  I noticed your post on calculating the tank retention time and thought I'd post how I am approaching this problem in case this is of any benefit.

                                           

                                          I've created a generic Asset Template which contained the common attributes that all of my assets are expected to have.  e.g. Asset ID number, Asset Name, Asset Drawing Number, etc.  I then create derived templates for each type of asset, like a Tank, or a Flow Meter.

                                          Asset Template.JPG

                                          For my Tank Template, I have created attributes that allow me to calculate the working volume of the tank, and the current volume based on the measured tank level.  I then added an attribute for an in-flow, which could be an assumed, static number or a PI point for a real flow measurement.  Finally, I created two retention time attributes.  The static retention time attribute is determined by the maximum and minimum working levels.  The dynamic retention time attribute is determined by the measured inventory level and the minimum working level.

                                          Tank Template.JPG

                                          As the measured tank level is typically a % and the working levels are typically measured in metres, I had to cater for this in the dynamic retention time calculation.  Using this template, I get a calculated dynamic retention time in real-time, based on the current level and inflow measurements.  I'm still testing and playing with it, but so far it seems to do the job.  I've attached the XML export from PI AF in case anyone else wants to have a play with it.

                                           

                                          Any feedback would be welcome!

                                           

                                          Cheers,

                                          Gavin