Kratos: How to extend to other materials?

Created on 16 Jun 2020  Â·  20Comments  Â·  Source: KratosMultiphysics/Kratos

I would like to use an application (ContactStructuralMechanicsApplication) with materials it does not provide (rubber models).

I saw that there is a ConstitutiveModelsApplication that offers the Ogden model among others. I don't actually understand how to use two applications together, though I assume that this application is only useful in conjunction with others. The possibilities I see for using multiple applications are:

-Python side. Importing the python modules corresponding to applications, the whole application seems to be imported with no selectivity so any name conflicts lead to an error for me.

-C side: Inheriting from the specific KratosApplication classes in a new application, however as a diamond inheritance it seems a bit dodgy.

-Rewrite with lots of copy-paste: obviously not ideal.

It doesn't seem like any of these are the proper way of using two applications so it would be good to be pointed in the right direction.

For the specific case of ConstitutiveModelsApplication it seems to use different concepts with a model and a law, I cannot fit this with the ReadMaterialsUtility most other applications are apparently using. I also notice the application has barely changed in two years so wonder if it is still alive.

There appears to be two other material options, UMATApplication and MGISApplication, but I haven't found much info on them. Of course I understand I can implement custom constitutive laws without relying on an application but that feels like a lot of duplicated effort.

What approach would you suggest for this?

Thanks

Help Wanted

Most helpful comment

Just to tell that if a CL is implemented within another application AND IT CONFORMS WITH THE STANDARDS than by simply including it in the material.json as

NameOfApplication.NameOfConstitutiveLaw

it should automatically import the application it belongs to.

Having said this the ConsitutiveModelsApplication is unfortunately legacy and it is incompatible with the StructuralMechanicsApplication. Admittedly (CC-ing @KratosMultiphysics/technical-committee) we should move it to legacy ASAP in order to avoid this kind of misunderstandings)

All 20 comments

Hi @jc-bm , I think @loumalouomega can guide you on how to proceed with this.

in any case it should be enough to add the cl to the materials.json, and it
shoukd import it automatically

On Tue, Jun 16, 2020, 9:57 PM Rubén Zorrilla notifications@github.com
wrote:

Hi @jc-bm https://github.com/jc-bm , I think @loumalouomega
https://github.com/loumalouomega can guide you on how to proceed with
this.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/KratosMultiphysics/Kratos/issues/7090#issuecomment-644980777,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AB5PWELCMPOHFWVPIIHQCXDRW7FEBANCNFSM4N7YQAIA
.

Hi @jc-bm !
What we usually do when performing Contact simulations by means of the ContactStructuralMechanicsApplication (assume that you use the GiD problemtype) is by compiling and using the constitutive laws that we have available in the StructuralMechanicsApplication.

If you do that, you only have to put the name of the constitutive law that you want to use (tell me which one and I can give you the exact string) inside the Materials.json and should work.

Cuurently we have available the following hyperelastic laws:

  1. Kirchoff
  2. Neo-Hookean
  3. Ogden

Regards,

Hi @AlejandroCornejo !
I have been using HyperElastic3DLaw to set the problem up before I use specific material measurements in the way you have described. The Ogden law I found in structural mechanics had the specifier 1D so I assumed it would not work for my problem, trying it now the Check supports my assumption: "Wrong constitutive law used. This is a 3D element! expected strain size is 6".

I would like not to be restricted to certain materials, especially if other materials have been implemented in other parts of Kratos. Is this not how the framework works?

You're right! the Ogden is only for 1D. We can implement the Ogden for 3D if you want to use that CL :D. What do you mean by restricted? We can help you to have the needed CL for your problem :)

Just to tell that if a CL is implemented within another application AND IT CONFORMS WITH THE STANDARDS than by simply including it in the material.json as

NameOfApplication.NameOfConstitutiveLaw

it should automatically import the application it belongs to.

Having said this the ConsitutiveModelsApplication is unfortunately legacy and it is incompatible with the StructuralMechanicsApplication. Admittedly (CC-ing @KratosMultiphysics/technical-committee) we should move it to legacy ASAP in order to avoid this kind of misunderstandings)

NameOfApplication.NameOfConstitutiveLaw

@RiccardoRossi I don't think this works, the materials are imported in C++

@RiccardoRossi that clears things up, the format used by ConstitutiveModelsApplication is considered legacy and new code should not be based on this. If the constitutive law has been registered in Kratos then including it as you specify makes sense and you are saying that it will be automatically imported and thus registered? This does not seem to be the case for me, I get "RuntimeError: Error: Kratos components missing" whether I prefix with the application name or not. If I explicitly import the application from python and the import doesn't fail because of some clash then I can use the component. I see @philbucher has responded on this while I was writing.
,
@AlejandroCornejo it would be great if you could implement that! What I meant by 'restricted' is not a concern from what Riccardo says, if I implement a material in an application anyone else can use it from another application and I can use a material from any other application.

Thanks!

@jc-bm You're interested in the 3D Ogden then?

@AlejandroCornejo I am!

ok! I'll tell you when it is added then

ok! I'll tell you when it is added then

BTW, do you have any literature of the model? thank you!

@AlejandroCornejo this is the original paper https://royalsocietypublishing.org/doi/abs/10.1098/rspa.1972.0026. Let me know if you cannot access it, or if you are looking for something different.

Hi, sorry for the delay. Here are several models for hyperelastic materials: https://redbkit.github.io/redbKIT/math/SolidMechanics/

Quite simplified, so it can be useful to implement

If the constitutive law has been registered in Kratos then including it as you specify makes sense and you are saying that it will be automatically imported and thus registered? This does not seem to be the case for me, I get "RuntimeError: Error: Kratos components missing" whether I prefix with the application name or not. If I explicitly import the application from python and the import doesn't fail because of some clash then I can use the component. I see @philbucher has responded on this while I was writing.

Guess we need a mechanism to import the corresponding apps. How do you think we should proceed @RiccardoRossi @loumalouomega @AlejandroCornejo ?
This needs to be done in Python but the materials-reader is implemented in C++
Maybe a utility-fct that parses the Mat-file and imports the used applications?

If the constitutive law has been registered in Kratos then including it as you specify makes sense and you are saying that it will be automatically imported and thus registered? This does not seem to be the case for me, I get "RuntimeError: Error: Kratos components missing" whether I prefix with the application name or not. If I explicitly import the application from python and the import doesn't fail because of some clash then I can use the component. I see @philbucher has responded on this while I was writing.

Guess we need a mechanism to import the corresponding apps. How do you think we should proceed @RiccardoRossi @loumalouomega @AlejandroCornejo ?
This needs to be done in Python but the materials-reader is implemented in C++
Maybe a utility-fct that parses the Mat-file and imports the used applications?

As @RiccardoRossi CL should respect standards. For the applications should be imported in the main

If the constitutive law has been registered in Kratos then including it as you specify makes sense and you are saying that it will be automatically imported and thus registered? This does not seem to be the case for me, I get "RuntimeError: Error: Kratos components missing" whether I prefix with the application name or not. If I explicitly import the application from python and the import doesn't fail because of some clash then I can use the component. I see @philbucher has responded on this while I was writing.

Guess we need a mechanism to import the corresponding apps. How do you think we should proceed @RiccardoRossi @loumalouomega @AlejandroCornejo ?
This needs to be done in Python but the materials-reader is implemented in C++
Maybe a utility-fct that parses the Mat-file and imports the used applications?

Yes i think that this is an important feature that got lost in the porting of the utility to c++

the only way i see to solve this is to parse twice the json, once in python, where we can import the app, another one within the c++ where we actually construct the CL.

responding to @loumalouomega we need a mechanism so that it is not obligatory to change the main to use a CL in a different app. It could be the one i am proposing or a different one, if there are better proposals...but we do need one

also observe that for example for linear solvers we can use the trick i am proposing

In that case it is OK, it is easier to check dependencies in python than in C

@jc-bm I'm implementing this new CL in the branch adding-3d-ogden-law. I've based my implementation on the Comellas PhD thesis (see https://upcommons.upc.edu/handle/2117/108955 pg 43) which is more FEM applied than the original paper from Ogden (order 3).

This thesis asumes a mixed u-p formulation but we ommit the pressure terms (maybe I'm wrong) what do you think?

It's implemented but not tested.

Regards

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ipouplana picture ipouplana  Â·  6Comments

e-dub picture e-dub  Â·  3Comments

KlausBSautter picture KlausBSautter  Â·  6Comments

maceligueta picture maceligueta  Â·  6Comments

roigcarlo picture roigcarlo  Â·  7Comments