Previous TableOfContents Next

Creating a New Material Type

A material law reflects the behaviour of a certain material. Steel behaves different from clay and so on. To be able to model the material behaviour correctly, a material law is needed. The law "rules" how the stress response should be based on a strain input. Some laws depends on the history of the material i.e. if the material has been stretched before, it may behave differently if one tries to stretch it again. For the material law to reflect this, it needs to have a memory which makes it ideal to make the law into an object which is put inside each element that uses it. You can read more about that under the chapter adding an element.

The material law has only one purpose; To determine the correct stress matrix based on a strain matrix and a strain increment matrix. There are several versions of these matrices where the most general one is of course the three dimensional one. It is used in the hexahedron element for example.

Other versions are plane stress matrix which is used in shell elements and a single one dimensional matrix which is used in a rod element. For the material law to be able to calculate all of these cases, the material law class (which is where the material law code resides), has several methods as can be seen in this figure:

The methods has to be present in all the different material law classes and be called the same for the concept to work.



The Material Class

The material class is the mother class of all the different material laws. This class contain a large amount of abstract methods which are the ones you have to define in your subclass, should you choose to add a new material law. It also contains a few general methods which are usable for all the material subclasses. The methods will be listed in the later subsection.

All the code in Impact is written in such a way that it treats all material laws as just instances of the Material class. This is a well known concept that can be used in object oriented programming. It allows the programmer to extend Impact with new material laws without having to change code in other parts of the program. If you want to add a new material law, you just have to create a new material sub class and fill in the code in the methods that are declared in the mother class as abstract methods.



Creating a Sub Class

If you compare the methods in the mother material class and the methods in any of the sub classes, you will see that they are exactly the same apart from the code inside the methods. As an element is created (in a problem that is to be solved), a material object is also created and put inside the element. That material object is an instance of the material law subclass that was chosen for that very element in the problem indata file.

During the simulation, the element will call on the material object over and over again (once every timestep). Basically, the question will be the same, namely "here is my strain matrix. What is my state of stress?" The material law will then do some calculations to find this out and return the stress matrix to the element.

In the picture there are two subclasses defined. The elastic subclass is very simple since it only multiplies the strain with Young's modulus and returns the stress. For two and three dimensions you have some more calculations to do but the concept is the same. The elastoplastic law however is more advanced. The material behaves like in the elastic material law up to the yield stress of the material. After that level is passed, the material starts to behave like plastic material (similar to a gum) and the strain will be irrecoverable. That means that the strain will not go back to zero again should the stress drop, or seen in another way, the stress will not be zero if the strain goes back to zero. This material law has a memory. It remembers if it has passed yield stress before and even remembers the maximum stress level it has reached.

Other more advanced laws that can be added are not only depending on the strain and the loading history, but also the speed at which the material is extended, so called strain velocity hardening. Most steels constitute a significant strain velocity hardening component (up to 25% higher stress level at rapid loading).



The Methods

Now follows a description of each method in the material law. We will start with the general methods that are defined in the mother class and which are usable for all material classes.

The General Methods in the Material Class

clone

This method will clone the material object i.e. make an identical copy. It is used my the elements to create a local copy to embed inside themselves for the duration of the solution.

getDensity

This method returns the density of the material

getName

This method returns the name of the material

getNumber

This is a useful method for getting a number from a string containing several number separated with commas. It is useful in the parsing stage.

getYoungsModulus

Returns the Youngs Modulus of the material.

numberOfPoints

Returns the number of data points in an indata string by looking at the number of commas used for separation. Used in parsing of indata.

setName

Sets the name of the material object

The Abstract methods in the Element class

These methods need to be coded in the subclasses. The coding will be unique for each new material law.

calculateStressOneDimensional

This method calculates a stress given a strain and strain increase since the last timestep. In this case all matrices are assumed to be of the standard 6x1 type.

Strain dStrain Stress
Epsilon XX dEpsilon XX Stress XX
Epsilon YY dEpsilon YY Stress YY
Epsilon ZZ dEpsilon ZZ Stress ZZ
Gamma XY dGamma XY Stress XY
Gamma YZ dGamma YZ Stress YZ
Gamma ZX dGamma ZX Stress ZX

The stress is given as an input to the method, but is changed inside the method to the return value.

calculateStressTwoDimensionalPlaneStress

Similar to the above method but for plane stress situation (used by shells)

calculateStressThreeDimensional

Similar to the above method but for three dimensional stress (used by all solid elements)

parse_Fembic

This is the method where the material law object will interpret and set it's indata. The data is taken from the indata file by the Reader object and sent here for interpretation as a string.

To parse this string you can use the methods numberOfPoints and getNumber explained above to sort out the data.

If more indata formats are added in the future, there will be more methods like this to define when you add a new material law

setInitialConditions

In this method you check that all variables has been read in and set. You also set the ones you need to set before solution starts.

wavespeedOneDimensional

Returns the speed of waves through the material. This is for one dimensional situations and is used by rod elements to determine smallest timestep.

wavespeedThreeDimensional

Returns the speed of waves through the material. This is for three dimensional situations and is used by solid elements to determine smallest timestep.

wavespeedTwoDimensional

Returns the speed of waves through the material. This is for two dimensional situations and is used by shell elements to determine smallest timestep.



Other things to think of

Keep your variables private inside your class to prevent others from fiddling about with them in ways you didn't expect

Read the code. There are plenty of documentation

Go for it! Good luck!


Previous TableOfContents Next