Kratos: Material with elastic parameter dependant of strain

Created on 15 Feb 2018  Â·  20Comments  Â·  Source: KratosMultiphysics/Kratos

I want develop an elastic material of which the parameters depend of the strain state.
For example: the shear modulus will be defined by G=fct(strain)

I have 2 options:
-The easy way is to define new material with the specific behaviour.

-Add the parameter “shear modulus” inside the elastic material parameters and allow the parameter to be defined by a function of strain. Then, the shear modulus will be evaluated before the computation of the Elastic Matrix.
Thus, we can use a “PythonOneParameterFunction” to allow the parameter to depend of another parameter. With this strategy, it will be possible to have Young modulus or other parameter that depend of the temperature.

It is already possible to have mechanical parameters dependant of mechanical state?

Discussion Help Wanted

Most helpful comment

Riccardo we have an implementation of that benchmark in the StructuralMechanicsApplication as an UniTest
https://github.com/KratosMultiphysics/Kratos/blob/master/applications/StructuralMechanicsApplication/tests/constitutive_law_test.py

All 20 comments

Hi @PhilippeBussetta i am not sure to follow you. Parameters in properties are shared between a lot of elements, so they cannot be changed. What would be possible is to provide a table input for some of them, and then to write a CL that reads in that table input.

this would mean that you define your own cl, but when you need instead of accessing to the variable FCT you get the _table_ FCT(strain) and you given strain as input.

Hi @RiccardoRossi
Yes, I can write a new CL but for me it is not the best way because of the duplication of code.

I would like a material with shear modulus defined by FCT(strain)= A gamma12^4+ B gamma12^3... - the property.
This property will be evaluated - not modified - to compute the elastic matrix.

Until now, the properties are constant, I would like to add the possibility to define properties by function of the mechanical state.

Additionally, the idea is to extend the elastic model to the case of the parameter could depend of the temperature.

@PhilippeBussetta as i understand you are asking to be able to assign a function. I am afraid this is not possible due to a technical limitation of the python interface.
The point is that if you want to prescribe a function to be parsed by python than you must go through the limitations of cpython, in particular the fact that the cpython is strictly single threaded because of the GIL (Global Interpreter Lock).

This is a big problem since CLs are executed in openmp parallel which would trigger a GIL error if you were to try executing a function evaluation on every gauss point.

in short... i am afraid i have no solution to offer...

Thank @RiccardoRossi
Thus, no python function in the CLs. I will find another solution.
I will make modification inside elastic CLs, I have to create a new branch or to joint one?

@PhilippeBussetta you should create a branch and add the new CL to the StructuralMechanicsApplication. We will try to help you in the process. In the testing phase you may want to check the behaviour by using the python interface.

for this it is useful to take a look at

https://github.com/KratosMultiphysics/Kratos/blob/master/kratos/test_examples/constitutive_law_base_benchmark.py

Riccardo we have an implementation of that benchmark in the StructuralMechanicsApplication as an UniTest
https://github.com/KratosMultiphysics/Kratos/blob/master/applications/StructuralMechanicsApplication/tests/constitutive_law_test.py

Thanks,
@loumalouomega , I would like to understand well, these tests are used only to check the behaviour of the Kirchhoff Saint Venant hyperelastic law?
The last function of the file is really needed?

if __name__ == '__main__':
    KratosUnittest.main()

This procedure have to be extended to all CLs?

The last line is to launch all the test using the Unitest framework https://docs.python.org/3/library/unittest.html

It checks all the Cl added to the test, right now just some are added

I understand the meaning of the last line but why in this file is not just to define tests about CLs?
I have difficulty with some of yours acronym, it is possible to make a list (CI, PR, etc.)
CI?

Cl -> CL (constitutive law), I forgot the capital, sorry
PR->Pull Request (to apply to merge one branch to a different branch, usually to the master)

I don't understand well.
I have to do similar procedure to test my new CL or I have just to put the new CL into a list of tested CLs?
To do general procedure to test all CLs?

You can create a new test if you thing that the current format doesn't fit your needs, we can discuss to create a format easy to use and that could fit all our needs

I am making change into the linear_plane_stress and how I can verify that my new version compute identical result that the old official version?
Tests are already implemented? How it is tested?

I don’t think adding this to the plane stress law is a good idea since it is sth rather specific. I suggest to make an extra constitutive law that derives from the plane stress law.
This way we are also sure that nothing existing breaks.

The tests are very manual, due to the fact that each CL is a complete different world, so you must know a priori the solution for a given deformation gradient

Of course, @philbucher , I will create a new CL derived from the plane stress law.
Then I have to do some changes into the plane stress law and I would be sure that the performance would be identical.

@loumalouomega , thus, we can create a folder StructuralMechanicsApplication\material_test in which we can put the results of basic test over one element -- traction, shear, ect. -- for each CLs?
These tests prove that the CLs are identical regardless the PRs at least considering one element.
Do you agree?

Looks OK for me, let's wait what @KratosMultiphysics/structural-mechanics say

@PhilippeBussetta
I would suggest to consider the "basic" constitutive laws as immutable, since they provide the very basic features and are also used by many people.
Of course if sth essential is missing we can discuss it but I would suggest to follow this advice.

Regarding the tests I would suggest to add a test for your law to StructuralMechanicsApplication/tests/constitutive_law_tests.py
These tests are designed to ONLY test the constitutive law, without elements. This should theoretically be enough, have a look at what is being done there.
If you think that this is not enough, you can add a "complete case" to the already existing folder StructuralMechanicsApplication/tests/cl_test/your_custom_law. For these tests you provide an mdpa file containing the model, a ProjectParameters.json with the settings and a StructuralMaterials.json with the material parameters.
Please keep in mind to keep your tests as small as possible, i.e. with minimal execution time (<< 1 second)

i think this thread is currently finished. I am closing to reduce the number of open issues. Feel free to reopen as you deem it necessary

Was this page helpful?
0 / 5 - 0 ratings