Coder Social home page Coder Social logo

lamipy's Introduction

lamipy

Laminated composites engineering simulations in Python.

Brief description:

This project's purpose is to provide simple & accurate computations for engineering simulations of fiber-reinforced composites. This kind of advanced material is used in many areas of engineering: spacecrafts, pressure vessels, risers etc. Basically, the idea behind composite laminates is to produce a component which has the required engineering properties (high elastic modulus, low self-weight and others) through stacking many layers of laminae, in such way that each one can be layed in different fiber angles and can consist of different materials.

Therefore, a composite laminate consists of a material resultant of layers (laminae) bonded together. In this program, the layers are considered continuous and orthotropic. It is possible to input different properties for each used material in the layers.

The implementation uses the Classical Laminate Theory (CLT) for computations. The summary of this theory can be found in: NASA's Basic Mechanics of Laminated Composite Plates, Prof. W. Stein's document and other sources.

Currently lamipy is not ready for use due to the lack of verification and validation tests, which will be produced soon.

Project goals:

  • Provide a simple interface for laminate testing;
  • Display accurate information of results, including graphical analysis;

Technical features:

  • Calculates CLT stresses & strains (lamina & laminate coord. systems);
  • Failure tests for individual laminas (Tsai-Wu, Max. Stress, Max Strain and Hashin criteria);
  • Progressive failure analysis using Ply Discount method;
  • Plotting of progressive failure analysis;
  • Easy entry of laminate data;
  • Puck failure criteria;
  • Thermal & moisture effects on CLT calculations;
  • Laminate materials simple database
  • ...

How to use:

Currently, lamipy is not ready for general usage. If you want to test the code, here are the steps:

Note: using lamipy requires a python3 environment for executing the runfailuretest.py file. It is also required numpy and matplotlib libraries (both of which are easily encountered in many python distributions).

  1. Clone this repository;
  2. Edit runfailuretest.py to input the laminate data;
  3. Execute.

Understanding lamipy:

As previously stated, lamipy works through the CLT computations. This way, the user input consists of the material properties, layup configurations, force vectors and other settings.

Below is a summary of the data flow inside lamipy for a simple analysis (i.e. not a progressive failure analysis).

Example results:

Through the obtained results from an analysis, it is possible to plot charts for better visualisation:

Also, since lamipy is capable of running a progressive failure analysis, it is possible to automatically plot the Load Factor vs. Average Strain of the laminate while directly pointing First Ply Failure and Last Ply Failure:

lamipy's People

Contributors

joaopbernhardt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

lamipy's Issues

CLT - results dictionary could be clearer

In the results given by calc_stressCLT in the CLT module, the current returned data structure is like this:

return {"LCS" : {"strain" : {"inf" : LS_strain_inf,
                                 "sup" : LS_strain_sup}}, 
            "MCS" : {"stress" : {"inf" : MS_stress_inf,
                                 "sup" : MS_stress_sup}, 
                     "strain" : {"inf" : MS_strain_inf,
                                 "sup" : MS_strain_sup}}}

Where LS_strain_inf, LS_strain_sup... are lists of the size [3 x number_of_layers].
The dimension 3 is related to the 3 stresses/strains types (i.e. sigma1, sigma2, tau).
This means that the current format is:

MS_stress_inf = [sig_1, sig_2, tau]

It would be better to continue the formatting in a cascading dictionary for easier understanding of what the results hold, that is:

MS_stress_inf = {'sig_1': value, 'sig_2': value, 'tau': value}

This change will result in errors in the Failure Criteria module, which will have to be adjusted to this new format.

Refactoring of Failure Criteria module

The Failure Criteria module, as it is, presents many methods for calculating failure criteria based on different approaches.

It would be better to have it as a Class that presents those objects as Class methods.

Tests - coverage of clt.calc_stressCLT

The test class CLTFunctionsTest inside tests.py is not covering the main function calc_stressCLT.

It's required that it covers:

  1. Validation of all inputs
  2. Results based on bibliography references
  3. Returned values assembling and formatting

Tests - Failure Criteria coverage

Tests are not covering the Failure Criteria module.

It is required that the tests cover, for each failure criterion:

  1. Validation of inputs
  2. Results based on bibliography problems
  3. Returned values

Docs and Setup Class

Hi,

are you going to make some documentation to run laminate calculations?
Also, it would nice to have a class to define the laminae, laminate and loads and eventually fire up the calculation.
Something as simple as:

lamina0 = Lamipy(E1,E2,G12,v12,0)
lamina90 = Lamipy(E1,E2,G12,v12,90)

laminate = Lamipy.laminate(lamina90,lamina0,lamina90)

loads = Lamipy.Loads(Nx,Ny,Mx,My)

Lamipy.Failure(laminate,loads,'display','Tsai-Wu') 'with option to file such as c:\result.png and type of
 failure criteria to select Tsai-Wu, Hoffman, Max Stress, Max Strain etc.'

This is just a quick idea worthwhile to explore? Let me know!

Great work by the way!

Issue running test.py

Hi,

after I ran test.py I found the first error where \plots\strain_lf.png was missing.
I created a fake file at the path and the program ran.
However, the following error was returned.
I run Anaconda Py3.7 with all the necessary libraries loaded up.

Can you fix it?

First Ply Failure at LF: 175
Last Ply Failure at LF: 608
LPF / FPF : 3.5
.........F.F....FExecution time: 0.0013759140056208707 seconds.

======================================================================
FAIL: test_calc_moistures_forces_known_input_returns_expected_result (main.CLTFunctionsTest)
Sends known input to the function and expects a known output,

Traceback (most recent call last):
File "C:/Users/admin/Desktop/Python/lamipy-master/tests.py", line 382, in test_calc_moistures_forces_known_input_returns_expected_result
self.assertTrue(0.999 < error < 1.001)
AssertionError: False is not true

======================================================================
FAIL: test_calc_thermal_forces_known_input_returns_expected_result (main.CLTFunctionsTest)
Sends known input to the function and expects a known output,

Traceback (most recent call last):
File "C:/Users/admin/Desktop/Python/lamipy-master/tests.py", line 305, in test_calc_thermal_forces_known_input_returns_expected_result
self.assertTrue(0.999 < error < 1.001)
AssertionError: False is not true

======================================================================
FAIL: test_tsaiwu_2D_known_input_returns_expected_result (main.FailureCriteriaTest)

Traceback (most recent call last):
File "C:/Users/admin/Desktop/Python/lamipy-master/tests.py", line 406, in test_tsaiwu_2D_known_input_returns_expected_result
self.fail('Finish this test!')
AssertionError: Finish this test!


Ran 17 tests in 0.019s

FAILED (failures=3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.