×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

External Pressure VBA Code

External Pressure VBA Code

External Pressure VBA Code

(OP)
Good evening,

Im trying to develop a code to dimension vessel code thickness using VBA. So, the internal pressure process is direct, but to external pressure, i need find a way to make my program find A and B values on ASME data tables.I hope you can help me with that.

Thank you

RE: External Pressure VBA Code

xsamp, you don't say but cylinders, Sec VIII, Div 1?

Regards,

Mike

RE: External Pressure VBA Code

(OP)
I will work with cilinder an sphere vessel. So I believe that if i find a way do cilinder to external pressure, i would do with other kind of vessel. Im using Division I.

RE: External Pressure VBA Code

xsamp, OK, kind of an involved process. First, do some example problems by hand to understand it. I don't have any code for you but here's the general process for cylinders, following UG-28:

Tabular data for Fig. G might be represented by an array. Calculate Do / t & L / Do and select bracketing values for A. Calculate A by interpolation. Limiting values per various parts of UG-28 are tested at each step.

Select the proper external pressure data, based on material under consideration. Using the calculated value of A and external design temperature, select bracketing values of B.

Calculate B by performing two interpolations, on A and on temperature.

Depending on value of Do/ T, perform calculations per UG-28(c)(1) or UG-28(c)(2).

To calculate a required thickness, a thickness is assumed, external pressure calculated and the resulting value tested, iterating to a desired degree of convergance.

To check a given thickness only one pass through the process is needed, assuming the thickness is adequate.

Process is much the same for a sphere, but somewhat simpler.

Warning: I am not a particularily skilled programmer and I know nothing about VBA. Terms such as array may not be exactly correct.

Plan B: Use commmercial software.

Regards,

Mike
 

RE: External Pressure VBA Code

(OP)
I got it SnTMan,

Unfortunately the data i have from ASME (Tabular G) is in pdf format. I understand I have to interpolate values, but do you know how can I get the equation that generates those graphics or another format of those tables? Im writing a work and I have to calculate it by myself, so I cant use commercial softwares.

RE: External Pressure VBA Code

xsamp, no I don't. Section II, Part D is the primary reference.

Regards,

Mike

RE: External Pressure VBA Code

An ex-colleague of me made the external pressure calc in Excel without VBA.
In gross lines, here's how it works. Please notice the formatting defines the visual representation in excel and the worksheets youll have have to make.
  1. Creat a new Excel workbook. Make 1 sheet your calculation results sheet, where all inputs and results are defined, incl. material and temperature. The other sheet(s) are used for determing G, A and B.
  2. Make an input field for calculating D/t and L/D. Worst case, L/D is greater than 50
  3. Copy paste the table that belongs with figure G of II-D (table G) into excel, just by selecting the data in pdf, crtl+C | crtl + V. Excel has easy ways of re-organizing large amounts of data in row and columns in such a format you can easily work with that data (use the Data ribbon, and use "Text to columns"). Make an array or table. Now, and this is where Im on the same page as Mike (Im not a skilled programmer either - if someone in your company is, get him to join you).
  4. Determine your lower and higher D/T value that comes back in table G. Do the interpolation to find A from table G (this sounds easy, but should be pretty straightforward in excel for an experienced excel guru - no VBA required).
  5. Copy value A back into your input/result sheet
  6. Just as you can make an input for table G in excel, you can also do this for e.g. table HA-2 (this is 316). Once you get the hang of it, its fairly easy to get all material tables into excel.
  7. Assuming you use 316, thus HA-2, copy the found value of A into this sheet, and let the sheet determine the value of B, in the same way as defined in step 4.
  8. Copy value B back into your input/result sheet
  9. Now, you need to do some programming in excel (fairly easy using IF and AND statements) to determine if you have to follow how you can calculate UG-28(c)(1) or (c)(2). From there on, you can determine Pa (or Pa1/Pa2)
The programming will require some background data to be available. Ive found it easy to have all stress values from II-D table 1A in excel. Using VLOOKUP and INDEX functions, you can easily determine stress allowables based on the given temperature input.
In your input/result sheet, you could use a dropdown for selecting your material. With a VLOOKUP, excel then can easily determine the corresponding stress allowable that is used in determining Pa/Pa1/Pa2.

Hope this helps. In the end, run some test calcs by hand to determine if your calcs and programming are OK.

RE: External Pressure VBA Code

(OP)
Thank you all. I''l try it. From my own good I hope it works. lol

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources