Alph - A Little Process Helper

Fluids and Formulas Tutorial

This is the third part of the Alph introduction tutorial. If you did not go through the previous parts, you might want to start with them first, but a completed tutorial 2 case is available.

Alph tutorial pages:

In this part we shall look at doing simple process calculations using multiple fluids and introduce Alph variables and formulas. The basis for this will be a simple dew point control plant for natural gas as represented by the following flowsheet.


The inlet feed gas is cooled sufficiently so that enough of the heavier compounds condense out, that the resulting sales gas will have a dew point below a specification at a given pressure. The liquids are typically "stabilized" in a simple tower to produce liquids that are not too volatile for atmospheric storage.


Continuing from where we left off in part two, tap the


button to return to the information flow diagram. You should see the feed fluid and the two tools we have defined so far represented as something like what is shown to the right.

iPad On the iPad, you can also just tap on any blank spot on the background screen dismiss the window floating over the diagram.

Each object will have lines connecting its left hand side to the right hand side of each object which it references

You can interact with the diagram using any of the following gestures:

  • tap any object to bring up its page for viewing or editing
  • move any object by dragging it around
  • drag on the background to move the entire diagram around
  • double tap anywhere to zoom the diagram such that everything just fits on the screen in the current orientation
  • zoom the diagram in and out using the normal two finger pinch gesture
  • delete any object by triple tapping on it
  • tap and hold to bring up a context menu - if you do this on an icon, you will be able to copy that object to the pasteboard and if you do it on the background you can paste a copied object.

Try rearranging things so they look something like the next screen shot.


This might be a good time to mention that when you are on the session menu, the diagram or one of the object list pages, you can bring up an undo dialog by shaking the device. If the previous operation involved changing the properties of the object on its page, then all changes made on that page are reversed. A redo option will appear on the undo dialog if something has been undone and no other operation has yet taken place.

While shaking is the official way to get an undo menu on the iPhone OS, it can take a pretty vigourous shake to bring it up, particularly on the iPad, so Alph also has an undo button at the right of the title bar on the diagram.

Returning to our problem, we shall assume the plant feed is our previously defined fluid named "feed".

Tap the Add Fluid button to create a new fluid. Remember that you can first tap on the background of the diagram to designate where the new icon will be placed. Alternatively you can tap and hold at the desired location and then select Add Fluid from the context menu.


This fluid will represent the feed to the low temperature separator, so change its name to "lts" and give it a temperature of 0 C.

The LTS feed is the vapour off of the inlet separator (our feed fluid vapour phase), after passing through two heat exchangers. Let's assume a 50 kPa pressure drop on each exchanger. We could just type in 3900 kPa, since we know the feed fluid pressure, but a better approach is to include the feed pressure in a simple formula.

@feed - 100

The 'at sign' means retrieve the value from the fluid whose name follows the @. In this case we want the pressure of the feed fluid and since this formula is for a pressure variable, all we have to enter is the feed name. It would also be correct to enter the formula as:

@feed.P - 100

but the specific variable type is not required in this case.

iPad When you are in a formula field on the iPad, you can tap on an icon on the background diagram to have that object's name appended to the end of the formula. You can pan and zoom the diagram to bring the desired object into view, without closing the overlying window.

Continue down to the flow field.


You will notice that the two empty fields have both been filled in with copies of the pressure formula. As you will see, it is common for a fluid to reference another fluid or tool in several of its fields, so as a convenience, blank fields are automatically filled in whenever you enter a formula starting with an @ or # character (# is the tool reference character that will be introduced later).

We know the lts feed flow must be the same as the vapour phase flow of the feed fluid, so we can either edit the existing flow formula or clear it and just enter:


Similarly the lts feed composition can be set to the same as the feed vapour phase with the same formula in the X (composition) field.

With the input set as shown, tap the Buik button to look at the calculated result.


If you refer back to part one, you will see that the lts fluid does indeed have the same composition and flow rate that the vapour phase of the feed fluid did.

You might note the different colours of the values. Green values are user specified values where the formula consisted only of a value and a unit or the defined array, in the case of composition. Blue values are the result of some calculation performed by the formula, even if that was just referencing a value in another fluid. Finally the black values are ones calculated by the property package.

Tap the upper left corner button to return to the information flow diagram and then tap the Add Fluid button to create a third fluid.

iPad On the iPad, just tap on any blank spot on the background screen to dismiss the fluid window and then create the fluid.


We shall use this fluid to check the dew point specification, so change its name to "dewpt".

To this point we have flashed fluids at a given temperature and pressure, but this time we want something different. Tap on the button that has T on it and it will change to P as shown. All fluids must have either temperature or pressure specified, so this top button only toggles between the two.

When the top button changed to P, the second button also changed, becoming H. A flash always requires two intensive variables, and since the second one was already pressure, it had to change to something else and enthalpy is probably the most common choice. However we want a dew point, so tap on the button that now has the H and you will see that it will change again. Repeat this until Vf appears, which stands for vapour fraction. As special cases, vapour fraction specifications of 0.0 and 1.0 are taken to mean the bubble point and dew point respectively.

Retrograde flashes are also possible by setting the switch at the bottom of the page, but in this case we just want a normal dew point.


I seem to recall that a common dew point spec was something like 15 F at 800 psig, so enter 800 psig for the pressure and 1.0 for the vapour fraction.



for the composition. As a convenience, the flow will also be filled in with this value, but in this case it doesn't really matter what it is.

Tap Done to dismiss the keyboard and then tap Bulk to view the result.


The calculated dew point is about -0.4 C, but 15 F is about -9.4 C, so clearly the low temperature separator has to be a lower temperature.

Time to fly without a net, or at least a screen shot. Follow the following steps:

  • Tap the button at the left of the title bar to return to the information flow diagram.
  • Tap the lts icon to view the lts fluid.
  • Tap the Input button on the bottom tool bar to switch to input view.
  • Change the temperature to -10 C.
  • Tap the button at the left of the title bar to go back to the diagram and then tap the dewpt icon.

iPad Once again, you can just tap on any blank spot on the background screen to dismiss a window. Even better you can just tap on another object on the diagram to switch the window to that object. So in this case you could just tap on the lts icon, make the change and then tap on the dewpt icon to see the effect.


If all has gone well, you should be looking at a screen like this. The dew point temperature is now about -9.9 C, which I shall call a tutorial solution.

There is a short cut for switching between fluids. Try just dragging your finger horizontally from left to right across the screen. If you manage to do it without scrolling up or down, the fluid should switch to "lts". Drag in the other direction to switch back. Each left to right swipe moves to the previous fluid in the list, while a right to left swipe moves to the next one. If at the beginning or end of the list, the selection will wrap around to the bottom or top as appropriate.

If you are on the Input view, you have to drag in the clear area below the retrograde switch.

Return to the information flow diagram and rearrange it if necessary.


This is how mine looks, but of course you can arrange your diagram anyway you like.

If you tap the


icon, the case will be immediately saved in the current case name. There will be no visual confirmation, but the phone will vibrate briefly to confirm your request.

iPad The iPad doesn't vibrate, but the icon does glow briefly when you tap it.

Now that we have some fluids defined, let's return briefly to the fluid list page.

Tap the Session button at the upper left once to return to the session menu and then tap the Fluids button on the bottom tool bar.


We now have three fluids to play with, so tap the Edit button in the upper right corner.


Two new icons appear on each line, a red circle to the left and some grey bars to the right.

Try dragging the grey bars on the dewpt line up the screen.


You should be able to drag the dewpt row to any position in the list. The screen shot to the right shows it in mid drag.

Tapping a red button at the left will change that line's grey bar into a delete button. We don't want to delete any of these fluids, so tap the Done button instead and then the New button to create a new fluid.

Don't bother changing any of the fluid input, but just return to this list.


Now just swipe either left or right on the newly created sacrificial fluid. A Delete button should appear at the right. This is the same button that would have appeared if you had tapped one of those red icons when were were in edit mode, but this is nice and easy. Simply tap on the Delete key to remove the fluid. Tapping anywhere else will make the button disappear with out making any changes.

The same actions work to rearrange or delete items from the tools and variables lists. Speaking of variables, let's have a look at them.

Tap the


icon at the bottom of the screen to go directly to the information flow diagram.

iPad Tapping this icon also works on the iPad, although the effect is just to dismiss the window, the same as tapping on the main window background.

Tap the Add Var button to create a new variable.


Earlier we created a formula that set the lts fluid pressure to be 100 kPa less than that of the feed fluid. However hard wiring the 100 into the formula not only is less flexible than having a variable, but also does not allow for changing units. We shall create a delta P variable that addresses this problem.

Change the name of the new variable to "dp". We really should have different variables for different pieces of equipment, but for simplicity I am going to assume all pressure drops are the same.

After changing the name, tap on the Type line.


Variables need to have a property type so they can know what units to use. Spin the spinner down to the bottom to select DeltaP. Note that for delta T and delta P, you want to pick the appropriate delta property type, not the corresponding T or P properties or errors could result if you switch unit sets later on.

Tap Done to return to the variable input page.


Enter 50 as the pressure drop and tap Done to dismiss the keyboard.


The appropriate unit has been appended to the input and the calculated result is displayed below. In this case it is just the input value, but if the input were a formula, the necessary calculations would have been made.

Let's also make a delta T variable while we are here.

Tap the New button at the bottom of the page to create another variable.


Input the name, property type (DeltaT) and value (5) so the new variable input looks like the screenshot to the right.

Now go to the fluid list page by tapping the Fluids button and then tap on the lts line to return to the lts fluid. You could of course also go to the diagram and tap the lts icon.


Modify the pressure formula so it is:

@feed - 2 * $dp

Just like the @ 'at sign' is used to designate a fluid reference, the $ 'dollar sign' indicates a variable value. In this case we are multiplying the pressure drop by two to account for the passage through both the gas/gas exchanger and the chiller. Spaces aren't required in formulas, but they can make them easier to read. Normal arithmetic precedence is maintained, but parenthesis can be used as needed or wanted.

Switch to the Bulk view to confirm that the pressure is still 3900 kPa and then return to the fluid list and create a new fluid with the New button.


This fluid will represent the sales gas from the gas to gas exchanger, so name it salesgas and enter the other input as the formulas in the screen shot. See if you can use the automatic fill in to minimize the amount you have to type.

We shall use the delta T variable we created to set the hot side temperature approach (versus the feed fluid temperature) and the pressure drop variable to set its outlet pressure from the lts fluid pressure. We know that both the flow and composition must be identical to the lts vapour, so we can fill those in too.

iPad Don't forget that on the iPad you can quickly fill in the names of objects in a formula by just tapping on their icon in the background.

Tap on the Done and then the Bulk buttons to see the result.


Your results should look like this and a quick inspection shows the temperature, pressure, flow and composition are all what we would expect.

Return to the information flow diagram.


It looks a little messy as we have added a number of things directly from the lists.

Rearrange things appropriately to tidy things up.


Tap Add Var to create a another new variable.


Name this variable ggduty, for it will calculate the gas to gas exchanger duty. Select Q, which is energy flow, as the type and enter the following formula for the input:

@salesgas - @lts.v

It should be fairly obvious by now that we are simply subtracting the lts vapour phase energy flow from that of the salesgas. This is of course the gas/gas duty, that is displayed in the result field.

Note that we could have appended .Q to the end of each term in the formula, but if the fluid variable type is missing, the type assigned to this variable will be used by default, again saving some typing.

Even so, you will see that longer equations can be difficult to view and work with in the relatively small field. This brings us to the blue icons to the right that we have been ignoring. Tap it now.


You now have an expanded field in which to view and edit your formula. You can even use the return key to space it over multiple lines. Also all formulas can have comments appended to the end of them by placing them after a single quote character.

One last task for this part of the tutorial. Tap Cancel to return to the variable input page and then to go to the diagram. You might want to reposition the ggduty variable to a more pleasing location.

Create a new fluid, using the Add Fluid button.


This will be the chiller feed fluid, so name it chillfeed. In this case I have added the words Chiller Feed after the name. Any text following the first space on the name field of a fluid, variable or tool is taken as a description and will be displayed in the lists and other output.

Set the two intensive variables to be P and H (enthalpy). The formulas for P, F and X should be straightforward by now.

Use the blue icon to the right of the H field to get the expanded formula field.


Enter the following formula:

(@feed.v.Q - $ggduty) /

All we are doing here is subtracting the heat removed in the gas/gas exchanger from the feed vapour phase and then dividing by its flow to get its enthalpy value.

Tap the Save button and then once all the input is complete, the Bulk button to see the results.


Alph will have performed an isenthalpic flash calculation to determine the chiller feed temperature. It would be easy to add another variable calculation to determine the chiller duty.

Return to the diagram and tidy it up as appropriate.


That's it for this part of the tutorial. Tap the save icon on the bottom tool bar to save your work.

Continue with the next tutorial page to see calculations for mixing streams, using component splitters and mailing yourself a report.