Here is a copy of the intro to the excel spreadsheet for Flange Design that I received from Mogens. If anybody can tell me how to paste the excel file to this thread I will do so.
"Hello Everybody:
Please find attached the spreadsheet.
Before you start up, here’s a little background information and some comments
I started this spreadsheet some years ago when I needed a calculation sheet. I haven't made any calculations recently, but have used this spreadsheet more as a "work bench" tool which I could use to learn the Excel VBA language. I do not have a great knowledge of VBA and I know that sometimes things may not work on other operating systems etc. Should this be the case I hope that some of you guys may know how to debug such errors.
Have a go at it and let me (and the forum) know if you find it useful. I sort of got stuck at this stage and haven't really had the time to improve it further, so when I saw at eng-tips the "Taylor Forge bulletin" thread and the "Flange bending moment" thread I just thought that maybe some of you guys out there might benefit from it as it is.
The Spreadsheets
The spreadsheet consists of 4 (visible) worksheets:
A three page flange calculation sheet which works as a document in itself. The input fields are the white fields. By pressing the "Load Flange data" button the white fields will be filled automatically via a form. By pressing the Databases button you will gain access to databases containing material and gasket data. However none of these have to be used if you fill out the fields yourself. The external loads fields will not be filled out automatically.
A one page flange drawing which works on its own. The input fields are the white fields.
A one page Material properties sheet which works on its own. The input fields are the white fields.
A notes sheet.
The calculation sheet uses to some extent the variables of the Taylor Forge Bulletin. This also means that some variables (the greek flange factors) carry names not found directly in the ASME code.
The Macros
There is quite a few macro's built into the system, however only a few are used on the calculation worksheet. This is the worksheet functions which calculates the flange factors. All other calculations are performed directly on the worksheet.
On the drawing sheet and the material sheet a couple of worksheet functions are used to find dimensions and material stresses.
The remaining macro's are all related to the input form and the databases, The heaviest being the one which processes the data before putting them on to the spreadsheet.
The Databases
6 databases are included:
Flange dimensional database containing all B16.5 weld neck flanges.
Pipe dimensional database (Pipe thickness versus schedule)
Bolting Dimensional database
Gasket material database
Flange material database
Bolt material database
The databases menu includes two "greyed out" buttons. These were added for later use, as I have not made any forms for these. If you want to see/check the dimensional data for bolting and flange, there's two ways of doing this:
Go to the "Flange Drawing" tab and enter Size, Rating and facing in the white fields. The drawing will update the dimensions accordingly. Not all dimensions are there, though, fex. there are no gasket data.
Go into the Tools Menu, and remove sheet protection. Then go into the Format menu and select Sheet and Unhide. This will bring up a list of all hidden sheets. Select the sheet called "FlangeData". This sheet contains a table of all dimensions for flange and gaskets. Only be aware if you manipulate the sheet, that you could mess up the database definition, thus producing false results.
Although I have not had any external to check my data, I am relatively confident that the dimensional data for flanges and gaskets are correct (It is also those which cannot be changed via the manu)
(I had considerations of how to present these data, as they are constant and should not be modified, so a normal form was probably not the right way to present them. The option was a form with a drawing on so you could scroll through the sizes or to improve the "FlangeDrawing" tab to show all dimensions. The first option I liked best, only I don't know how or if it is possible to print a data form other than via PrintScreen. (It can be printed in VBA, but that is without data) The second one I just haven't got around to, so for the time being, to see all dimensional data, you have to follow the above steps.)
The last four dabases are accessible via the "databases" button and can be altered by the user, i.e. more materials can be added etc. A button on the form will print the complete database.
A few materials have been included but stress data for bolting, flanges and gaskets should not be used without double checking against the code, as they ARE NOT all correct.
I entered those rather quickly and did some copy/paste just to test.
You should print out the databases (press button on database menu) and check all records for those materials you intend to include in your design.
No password protection
All sheets are protected except input cells. Furthermore sheets not required for printout are hidden.
There is however no password protection on neither hidden sheets, locked cells or the VBA code modules, i.e. anything can be acessed if desired. I have deliberately not used password protection as I hope that in this way, by allowing others to see what is going on, that they will also provide me with any improvements or information of errors.
Excel and VBA
The spreadsheet is made in Excel version 2000.
I have no separate VBA module installed on my computer, only the one that comes with excel.
Miscellaneous Errors when running the menu
I noticed that when I open up the sheet, don't change anything, but leave all settings as they are, and click ok, I get a "Run type error 13". This comes because the gasket field is left blank. When selecting a gasket, this did not happen.
I have also noticed that sometimes I get an error when switching between RF and RTJ gaskets, but this I have not been able to track down, or to solve.
I don't get any errors in the databases.
If an error comes up, via the menu, It may be an idea to try to change the data in an other order. Some of the data you have to change in a certain sequence. For instance you cannot select the schedule until you have selected the size because not all schedules are available for all sizes.
Almost all of the code lies in manipulating the menu, and many of these errors don't show up until somebody start using the menu's.
The Metric bolt option don't work, as I have included no metric bolts. The "Bolt root area" field on the spreadsheet will show "don't work", and the calculation will fail. You will have to enter this data yourself. The bolt dia, and the number of bolts will work as they are picked from the flange data table.
Unfortunately I may not be able to solve all the errors, but I hope that among all of you who received the sheet, the might be a VBA wizard who can debug it and share the information with all of us. Anyway I hope that you will be able to avoid (or solve) the error, and to use the spreadsheet. After all the spreadsheet itself will work irrespective of any errors in the menu.
FAQ.
Your spreadhseet does all the calculations and gives value in "Metric" units. Is there anyway I can get the answers and values in the standard North american inch-pounds units ?
I see your point. Many of you prefer to have inputs and outputs in the imperial units.
However it is not uncomplicated to convert all units to imperial.
Being from the continent it was natural for mee to convert all units to metric (SI) in the calculation. In the material databases although, I have used imperial units, but this was also tht most natural because the allowable stresses comes from american codes (easier to add new records when you can pick from th code directly)
Now in order to convert the spreadsheet completely to imperial you would have to do the following:
Change all formulas in the spreadsheet and change all output units listed. I don't remember if some formulas even change due to conversion factors, but the entire spreadsheet is would have to be checked.
Change all dimensional databases to imperial (this will take a while). Alternative option to this is to convert the data before loading, but this may produce small "errors" in rounding the numbers to fractions.
Change the macro code for the "Load Flange Data" form, as this converts everything to metric.
Remember, if you try do do this yourself, that you do all of it and that you carefully check all formulas, otherwise the form will not fill out the fields correctly.
There's a simpler way which may do:
Using the "Load Flange Data" form, already allows you to do all your inputs in imperial units.
By changing the formulas in the cells C52, C53 and C54 (on Sheet1) you get the result pressures in imperial.
This is done as follows:
Unprotect the sheet
Cell C52: Replace (pd;2)&"N/mm2" with (pd/0.006895;0)&"psig"
Cell C53: Replace (pd;2)&"N/mm2" with (pd/0.006895;0)&"psig"
Cell C54: Replace (MIN(AM34;AM35);2)&"N/mm2" with (MIN(AM34;AM35)/0.006895;0)&"psig"
Now your result comes out in imperial. All you have to do is to convert to metric any value you enter directly in the white fields, e.g. the external loads.
A few more comments which I think may be of interest to all
Be aware that bolt stress data are depending on the bolt size.
For instance when you pick
A193 B7 >2.5"
in the bolt material combo box, this may not be correct. You should check that the actual bolt size for the flange connection (which you can see after loading the data) actually IS larger than 2.5". If not, go back into the menu, and select bolt material for bolt sizes smaller than 2.5".
Also something which is interesting to notice is when you "play" with the gasket types:
Try to load a 12" 2500# RTJ flange with Schedule XXS neck and 3mm ca.
Use flange material A105, Bolt material A193 B7 >2.5", pressure=345barg, temp=38F
Select soft Iron ring type gasket.
With this data the flange calculation will show that the flange is ok.
Go back into the menu and change gasket type to Stainless steel ring gasket. Now the bolting will fail, and you have to pick some other (stronger) bolts. (There's no suitable bolts in the database right now).
Please do not hesitate to revert with more comments, even though I may not be able to answer them. After all a part of the reason why I distributed the spreadsheet was in the end to get a better spreadsheet for everyone. Please also consider to use the eng-tips forum for any interesting findings that may benefit everyone.
Best regards
Mogens