Featured Articles

Check out the latest featured articles.

New Article

Product Viscosity vs. Shear

Featured File

Vertical Tank Selection

New Blog Entry

Low Flow in Pipes- posted in Ankur's blog

3

Calculation Tools: Unit Conversion, Drum, Compressor, Flare, Control V

#calculation compressor drum pump valve kod orifice gas presure flare

16 replies to this topic
|

#1 ReonArd

ReonArd

Brand New Member

• Members
• 4 posts

Posted 16 March 2023 - 04:25 AM

Fellow engineers, I am sharing a suite of spreadsheets that are designed to aid in various process calculations commonly used in the oil & gas and petrochemical industries. Appreciate any feedback or suggestions for improvement.

Unit Conversion
Compressor
Drum Geometry, Hold-up and Surge Rate
Flare Stack Sizing by ANSI/API Standard 521/ ISO 23251
PED Selection: European Pressure Equipment Directive 97/23/EG
Pump
Sieve Opening Size
Horizontal Knock Out Drum as per API RP 521
Control Valve
Restriction Orifice
Pressure Safety Valve
External Fire in a Liquid Filled Vessel â€“ Wet Area Calculation
External Fire â€“ Gas Expansion
Gas Calculations (p.V=n.R.t.Z)

Pressurization and Depressurization

Noise Calculation by API 521
Pressure Loss of Single Phase Flow in Circular Rough Piping
Pressure Loss of Single Phase Flow in Non-Circular Rough Piping
Pressure Loss of Two Phase Flow in Circular Rough Piping
Properties of Saturated Steam
Physical Properties of Pure Components
Pipe Size Optimization for Carbon and Stainless Steel Pipes
Prime Numbers
Geometry - Volume and Area Calculations

#2 Bobby Strain

Bobby Strain

Gold Member

• Members
• 3,361 posts

Posted 16 March 2023 - 11:49 AM

Any user should assume all risks when using any of these spreadsheets. Much use does not assure correctness. And since it is a web page, the code defies inspection.

Bobby

Gold Member

• Members
• 226 posts

Posted 16 March 2023 - 12:16 PM

Caveat lector, same with simulators.

#4 latexman

latexman

Gold Member

• 1,511 posts

Posted 16 March 2023 - 12:51 PM

MegaCorp won't let me use that website, so . . . I can see them, but when I click on them, alarms go off on my PC.

#5 Pilesar

Pilesar

Gold Member

• Members
• 1,141 posts

Posted 16 March 2023 - 05:58 PM

I liked the calculations on the whole. The format is clear. There is consistent user interface between the calculation sheets. References are given. Some equations are shown as text. Some of the calculation sheets are duplicates of what you might find in a web search (e.g. sieve opening size and geometry) but that does not make them less useful. I've built calc spreadsheets for my own use that may have more features for specific uses, but are not as clearly laid out. Good job! I learned much by building my own calc engines and I am sure you have also. Bobby Strain already identified the main problem with calcs such as this... there needs to be some verification. But for your own use, these are great! They might be useful for educating others. There may even be a commercial use. What do you hope to do with these? Do you think you can make money from these in some way? It would be nice if you could as there should be some external reward for the work you put into them.

#6 Pilesar

Pilesar

Gold Member

• Members
• 1,141 posts

Posted 16 March 2023 - 06:08 PM

I never before heard of the Pressure Equipment Directive and do not understand that sheet. What do you do with the results?

#7 ReonArd

ReonArd

Brand New Member

• Members
• 4 posts

Posted 17 March 2023 - 02:48 AM

Thanks everyone for the feedback.

Re: Bobby Strain. Point taken and the disclaimer on the homepage says as much. I do not 100% guarantee correctness, however I do refer the sources and include the calculation formulae and each user is encouraged to self-validate.
Re: latexman: Can you please explain what the issue is?  Essentially the website is the simplest html possible and the tools are Excel spreadsheets shared through the Zoho interface withe no code nor any macro running in the background, so they should pass even the strictest IT restrictions.  If I can replicate the issue I can look into it more.  I am keen to make the site accessible for everyone from everywhere.

Re Pilesar: Thank you for the review, very helpful.  Here is the history behind, as a process engineer I developed these spreadsheets over two decades in the industry and they significantly improved my workflow.  Now I have moved more into technology and consulting, so I figured I could offer the tools for others to use, because a lot of work went into it and I think it would be a waste to not use them any more.  I only launched the site a week ago, the site is hosted free via Wordpress (that's why the domain is a bit complicated) and the sheets are shared via Zoho for free as well, so there is no running cost and I am under no pressure to monetize.   At this point I have no clear goal what to do with it - basically, I want to see what the usage and feedback is and if it makes sense to transform it into something more professional.

The European Pressure Equipment Directive 97/23/EC (PED) is a set of mandatory EU regulations on pressure equipment. The output of the PED calculation is the PED category, which governs the certification requirement for the conformity assessment procedure. This certification provides evidence that the equipment meets the essential safety requirements of the PED and is safe to use in the European Union.  The selection criteria is very complex and largely manual.  I am aware that this specific sheet can be confusing for engineers who never had to use the directive; I have developed a graph that somewhat illustrates the selection criteria, and I am working on a way to display that graph in the sheet; this is not trivial, so it's a work in progress.

Lastly, if there is enough interest and continuous visits to the site, I have the idea of putting the code on Github to enable easy review and to open source the sheets.  It would also fully address the comment on inspection.

#8 latexman

latexman

Gold Member

• 1,511 posts

Posted 17 March 2023 - 06:06 AM

I don't know the exact issue.  I do know our IT is very strict.  Here's what I get when I click one of the apps:

#9 Bobby Strain

Bobby Strain

Gold Member

• Members
• 3,361 posts

Posted 17 March 2023 - 12:50 PM

Visit my website and have a look at the sample separator. Compare the required input to yours. Big difference. You haven't included what you know into your application.

Bobby

#10 Pilesar

Pilesar

Gold Member

• Members
• 1,141 posts

Posted 17 March 2023 - 01:46 PM

I tried to reverse-engineer the prime numbers spreadsheet as I was curious how to do that. I think my method was different in that I used the 'greatest common denominator' function to reduce the fraction as a shortcut instead of calculating a combination of all the common prime factors. I also added some additional error trapping and some 'build on demand' format enhancements. The attached 'Simplify Fractions.xls' is protected with no password. (replaced with an updated version 'Simplify Fractions 01.xls') I am sure there is a more efficient way to code this, so if anyone looks at it enough to point out additional nifty tricks, let me know. I have Excel 2003 so am missing some of the better error trapping functions that come with the newer versions.

Edited by Pilesar, 18 March 2023 - 12:18 AM.

#11 Bobby Strain

Bobby Strain

Gold Member

• Members
• 3,361 posts

Posted 17 March 2023 - 03:46 PM

That's pretty neat. But I don't use cell formulas; it's difficult to relate them to math. Can you do the same in VBA? Is this what Texas Eastman gives you? You can buy  Office 2019 for \$20 for a single PC one-time install. Most larger companies have a deal with Microsoft so employees can get a free Office Enterprise for their home use.

Bobby

#12 Pilesar

Pilesar

Gold Member

• Members
• 1,141 posts

Posted 17 March 2023 - 07:50 PM

I already found an error in my spreadsheet with resolved fractions between -1 and zero. Oh well. I had fixed that then unfixed it when I optimized further. Maybe some day I will play with this more to deal with that case better. This was mostly just a 'teach myself' exercise.

I used to program a bit for a paid job at a commercial software company, but never really got good at it. What coding I learn quickly gets lost unless used often. Some people seem to eat and breathe code and I can just watch and admire. I learned VBA several times and would have to learn it again to make any sense of it. Cell formulas are ugly and hard to follow and hard to troubleshoot when complex. They start simply and you get led down the path of 'let's just add this one other feature' until the spaghetti code gets really cooked.

My home computers are mostly still Windows 7 and I need to do something about that. I did buy an updated Office Suite cheaply through my employer some years ago but never installed it. I used to be tech savvy but tech never stops and I did.

You and ReonArd are very generous with your software. Thank you.

#13 ReonArd

ReonArd

Brand New Member

• Members
• 4 posts

Posted 18 March 2023 - 03:13 AM

I don't know the exact issue.  I do know our IT is very strict.  Here's what I get when I click one of the apps:

From the error message I can only assume they would block anything with a bit more interactive ability.  That is quite strict, indeed.

Visit my website and have a look at the sample separator. Compare the required input to yours. Big difference. You haven't included what you know into your application.

Bobby

I did have a look at your separator app at Applications / Horizontal Separator / Sample Separator and compared it to my KOD sheet. The required input is about the same, albeit the approach is different: if there is water in the feed (not always in my projects) then I run two simulations with each liquid separately; number of inlets & outlets are simulated as number of passes; if there is mesh present, then I convert the K-value to the equivalent droplet size.  I could not figure out what the sample separator uses for the separation length, but I made an assumption based on the size of the nozzles.

Given all that, I was able to match the results between the two applications, specifically the vapor velocity, settling velocity and dimensions.

I already found an error in my spreadsheet with resolved fractions between -1 and zero. Oh well. I had fixed that then unfixed it when I optimized further. Maybe some day I will play with this more to deal with that case better. This was mostly just a 'teach myself' exercise.

I used to program a bit for a paid job at a commercial software company, but never really got good at it. What coding I learn quickly gets lost unless used often. Some people seem to eat and breathe code and I can just watch and admire. I learned VBA several times and would have to learn it again to make any sense of it. Cell formulas are ugly and hard to follow and hard to troubleshoot when complex. They start simply and you get led down the path of 'let's just add this one other feature' until the spaghetti code gets really cooked.

My home computers are mostly still Windows 7 and I need to do something about that. I did buy an updated Office Suite cheaply through my employer some years ago but never installed it. I used to be tech savvy but tech never stops and I did.

You and ReonArd are very generous with your software. Thank you.

Your calculation is actually quite elegant.  My approach was more "heavy handed", I refer to a table of the first 500 prime numbers and run a check for each number.

I actually fully switched to Linux and LibreOffice / Office365 years ago and very happy with the decision.

Happy to hear the feedback, thank you all for it.

#14 latexman

latexman

Gold Member

• 1,511 posts

Posted 18 March 2023 - 09:08 AM

From the error message I can only assume they would block anything with a bit more interactive ability. That is quite strict, indeed.

I suspect itâ€™s unfamiliarity to the corporation. We have access to other interactive websites.

#15 Bobby Strain

Bobby Strain

Gold Member

• Members
• 3,361 posts

Posted 18 March 2023 - 09:45 AM

ReonArd,

It's one thing to match output, but you started with the dimensions. Your spreadsheet is typical for rating existing equipment. You start with a design, then check the parameters. That's quite different from designing a new separator. To use your spreadsheet for design is a "poke & hope" operation. And you have no way to optimize, i.e. minimum cost. Hard code is much safer, and easier to verify when developing the software. But most engineers never go beyond spreadsheets with cell formulas. I have seen some from major engineering companies that are examples of horrible spaghetti.

You can download software from my site when you register. There are some related to drop settling. They demonstrate using libraries with a spreadsheet by comparing results with VBA, where you can see the calculations.

You should seriously consider developing coding skill to move on from Excel cell formulas.

There are a few affordable calculators that are reliable. These should be recommended in lieu of spreadsheets. Unit conversion and fluid flow and others can be found at katmarsoftware.com. The author, Harvey Wilson shows up here occasionally.

Bobby

Edited by Bobby Strain, 20 March 2023 - 10:18 PM.

#16 ReonArd

ReonArd

Brand New Member

• Members
• 4 posts

Posted 20 March 2023 - 06:33 AM

ReonArd,

It's one thing to match output, but you started with the dimensions. Your spreadsheet is typical for rating existing equipment. You start with a design, then check the parameters. That's quite different from designing a new separator. To use your spreadsheet for design is a "poke & hope" operation. And you have no way to optimize, i.e. minimum cost. Hard code is much safer, and easier to verify when developing the software. But most engineers never go beyond spreadsheets with cell formulas. I have seen some from major engineering companies that are examples of horrible spaghetti.

You can download software from my site when you register. There are some related to drop settling. They demonstrates using libraries with a spreadsheet by comparing results with VBA, where you can see the calculations.

You should seriously consider developing coding skill to move on from Excel cell formulas.

There are a few affordable calculators that are reliable. These should be recommended in lieu of spreadsheets. Unit conversion and fluid flow and others can be found at katmarsoftware.com. The author, Harvey Wilson shows up here occasionally.

Bobby

Thank you for the links, I will certainly have a look.

Regarding the KOD drum calculation, in my past projects the objective was typically either of these:
- New design with design constraints defined by the client (usually maximum length of the drum for transport reasons or ID for manufacturing reasons).  In this case I would lock one dimension and vary the other to optimize the size.  If there is no such constrain, I would apply a cost function to the Length/Diameter ratio and aim to optimize the Utilization = Residence Time / Settling Time just over 100% (with design margin).
- Rating existing KOD, in which case I start with 100% Utilization and work out the maximum separation ability.
The sheet was developed to accommodate all such scenarios.

Actually, the KOD sheet as well as all the others, was originally programmed with VBA and later reworked to a simple spreadsheet for several reasons.  We found that working directly with sheets allows greater flexibility, using functions instead of simple numerical values as an input, and the ability to goal seek where necessary.  In this way we could respond very quickly to the differences in each project.  Also with hard coded software the junior engineers had a tendency of just hitting the button and accepting the values without fully understanding the calculation mechanism.

Last but the most important reason: a few years ago my company started phasing out locally installed MS Office in favor of cloud based solutions (Office 365, LibreOffice, OnlyOffice, Zoho etc.) and remotely hosted solutions (VPN and VPS), where the VBA compilation very often failed due to incompatibility issues or could not be used at all on the hosted side.  Additionally, most software we originally had was supported only on Windows or Macs, but with cloud shared sheets we can access our company repository from any type of device and operating system, be it Windows, Apple, Linux or Android.

#17 Bobby Strain

Bobby Strain

Gold Member

• Members
• 3,361 posts

Posted 20 March 2023 - 09:37 AM

Sounds like high tech to support dinosaur age software. But, each his/her own. Junior engineers left with poke & hope applications usually leads to failed design. Automatic smart software takes much of the risk out of using untrained engineers. Engineering companies are balking at separating education and production. I wonder what the future holds for engineering with the rapidly advancing AI.

Riley Bechtel has created an entire organization dedicated to innovation.

edit:

My website has been up for 17 years. And accessible with most devices, including those from Apple, Google, and more.

Bobby

Edited by Bobby Strain, 20 March 2023 - 02:11 PM.