Friday, June 24, 2016

Pressure vessel Finite Element Analysis using Calculix and Salome 7 - Part 2 (Mesh)

     In the part 2 (of 3), I've shown how I made the mesh for the finite element analysis of the can using Salome 7 software. One of the problems we face using Salome+Calculix is that Salome7 don't export the mesh in *.inp format needed for calculix. Our solution to the problem is to export the mesh in *.unv and convert it using a python script. 


     More information on these extension conversion scripts can be found in the following sites:


     Or you can download the one that I already fixed here (.tar.gz) or here (.zip).

Friday, June 17, 2016

Pressure vessel Finite Element Analysis using Calculix and Salome 7 - Part 1 (Geometry)

     One of the reasons I made this blog is to keep a record about what I'm doing so in the future I can come back and see details, that with time I can end up forgetting. This Video is about Finite Element Analysis using only free software, some of them open-source. The softwares I'm talking about are Calculix and Salome 7.

    The test model I'm simulating is internal pressure of an aluminum can, and its effects. An aluminum can is a good  because its commonly available, cheap. So it's relatively easy to get some results experimentally to match with the calculations. Other good reason is that the analytical models of pressure vessel are very straightforward, good for solid mechanics students. 

     In the picture we can see that the can I'm using is a funky one, because I attached a tire valve stem, so I can load and unload the can with air pressure, and use a tire pressure gauge to read a ball park value of the inside pressure in the can. 


     I also have a strain gage bonded in the can, making possible some extensometry studies, and perhaps numerical values of the strain related to the internal pressure

  

      Here we can see an arduino setup to read the Wheatstone bridge.  

     
     The last picture is the results for displacements that returned from calculix. The numerical answer has shown a good agreement with analytical calculations.  


    Finally, the video: 


Sunday, June 12, 2016

Compressibility Factor For Air on HP50g

     The compression factor is related to the difference between the behavior of real and ideal gases. The ideal gas model tends to fail at low temperatures or high pressures, requiring correction. In the image below is shown an example of this misbehavior, in the case for nitrogen.

 Source: http://www.chem.ufl.edu/~itl/4411/lectures/lec_e.html

The compressibility factor is expressed by the relationship:


     There are several methods for finding the compressibility factor under certain conditions of pressure and temperature. The classic method is to search for the information on diagrams available in the relevant literature, but here is shown another method that is based on a modification of the Redlich-Kwong equation of state. It is an iterative method.

      The algorithm shown is proposed by Tapan Kumar Sen and published by Breno Tresoldi Minzon and Fabio Malavazzi Santilio. The original program, that operates in Reverse Polish Notation (RPN), is available in http://www.hpcalc.org/details.php?id=5806.

     The proposed approach is iterative, making an interesting use of programmable computers. The method is to guess an initial value for "Z" and iteratively achieve convergence between the following formulas:
 
  
Pr is the reduced pressure, given by Pr equals  P / Pc.
Tr is the reduced temperature, given by Tr equals T / Tc.

      The constant Pc and Tc are the critical pressure and the critical temperature of the gas. The values for some gases are shown in the table below.

 

     As my interest lies in the properties of air (applied to compressors, internal combustion engines) the code shown is built to deal directly with this gas.
    The following example is in USER RPL, to use with HP50g calculator in Algebraic mode.

The program also can be downloaded here.

Thanks for reading.

Eddie

Saturday, June 11, 2016

Live data plot with Arduino + Python

      This post is about my interpretation about live data plot using  Arduino and python. I say it is my interpretation because it already been post by a few people some scripts about that. I like very much the one posted by Mr. Paul McWhorter, its simple and very well explained.

http://www.toptechboy.com/tutorial/python-with-arduino-lesson-11-plotting-and-graphing-live-data-from-arduino-with-matplotlib/

     But the problem begins when you need high baudrates. Mr. McWhorter application is reading a temperature sensor relatively slowly. My application was a Gyroscope + Accelerometer MEMS sensor (MPU6050 by Invensense), and I needed faster rates. I don't know why, at least with my setup, Python 2.7, Ubuntu, Arduino Uno Clone and MPU6050, when the communication between computer and the microcontroller begins, Arduino sends some gibberish just in the very beggining, but it is enough to ruin the communication. My way around this problems goes in the script below.



     Here is the print screen of the script running, it's very cool to see real time data being plot.


     One final information: in the arduino side I used a Script by Jeff Rowberg, which can be found in https://github.com/jrowberg/i2cdevlib. 

Thanks for reading

Eddie

Friday, June 10, 2016

Machining Plexiglass

Having some fun machining plexiglass for another machine protection guard. Truth be told, nothing is funnier than making some chips!



Thanks for stopping by!

Eddie

Wednesday, June 8, 2016

A simple Scriber in CadQuery

     Considering I've worked with a number of 3d drawing softwares (SolidWorks, Catia, Inventor, AutoCAD 3d) I Need to say: CadQuery is awesome. So far I liked it better than the formers.

     Rhinoceros still my favorite one, but it has an Achiles heel, It doesn't work in linux. At the time of this writing, I'm running only ubuntu in my personal computer. For my taste ubuntu is a lot better than windows, and pay for it just to run only one software sounds bad for me.

     When I was searching for 3d softwares for ubuntu, at some point I found CadQuery, and better yet, it has module to run along with Freecad.

     CadQuery is coded by Dave Cowden, and the module is provide by Jeremy Wright.


     I really need to say that these guys done an awesome work. Thanks.

     The installation is very easy and the learning curve, steep. In the same day I wrote my first script, a Scriber based in the design by Stan Bray, published in Workshop Practice Series Number 14 - Making Small Workshop Tools.

Source: BRAY, Stan. Workshop Practice Series Number 14 - Making Small Workshop Tools. Argus Books, 1987. P.8.

The Code:

The Output:


Thanks for reading!

Eddie