-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use different properties in multi-stage simulations #9128
Comments
@KratosMultiphysics/all As i think this involves pretty much everyone |
Hi @ddiezrod ! It is indeed a good question. I do not fully understand the problematic or the current limitation of the Kratos approach, could you elaborate? :D Generally, the element is the one in charge of computing the kinematics of the problem and, once you have a measure of the strain/F, you integrate the stress via a CL (which can evolve along time). What is the additional feature that you need? |
@ddiezrod maybe we can update the reading process so it can read multistage materials, because the alternative would be to make CL multistage, and I think it is easier to tackle this from the point of view of the properties (with maybe some communication process between stages, to transfer information from a previous stage to the next one) |
Hi @ddiezrod, we also do multistage calculation in Geomechanics application. In geomechacical problems, we switch between constitutive laws from one stage to another. In order to overcome the issue that you mentioned, we are storing stresses and state variables in the element. In the beginning of each stage, we initialize constitutive laws with these values using set functions. However, this is not the best solution. I think there must be an external mechanism which allows for multistage calculation and bringing stresses and state variables from one stage to another because then we can also change elements, if needed. |
A priori if we agree in an interface we can do those transfer in a standard and unified manner |
Note that associating the constitutive law to the properties makes possible to define more than one constitutive model at the same time. The current solver design makes this impossible so we would require to modify the Having said this, I think that the question is, do we want one materials file for each stage simulation (I'd say no) or no? If this is the case we should probably change the material import settings to map one property to one constitutive law. |
Basically what I said + a post stage transfer process |
Hi @AlejandroCornejo, the problem is that you have two stages that require different constitutive law but right now it is only defined in one place: material.json which is common for all stages (right now) |
@rubenzorrilla So you mean that you want to have one unique material file for all stages? How would you solve the problem then? Maybe what you meant was the other way around. I agree with your points @loumalouomega, probably that's the correct way to proceed. We had some opposition to go in this direction inside Altair as some people argued that material properties are unique and should not change from one stage to the other. That's why I suggested this other approach, but I think what @rubenzorrilla mentions is a real blocker, we must be able to use different CLs in our computing model part. |
thanks @Vahid-Galavi for your comment. Just out of curiosity, how do you define right now which CL is used in each stage? |
my comment about this is that material properties and constitutive laws are
intimally related one to the other.
having said this i am perfectly positive in having different material
properties per each stage...
…On Wed, Sep 15, 2021 at 2:45 PM Daniel Diez ***@***.***> wrote:
Hi @ddiezrod <https://github.com/ddiezrod>, we also do multistage
calculation in Geomechanics application. In geomechacical problems, we
switch between constitutive laws from one stage to another. In order to
overcome the issue that you mentioned, we are storing stresses and state
variables in the element. In the beginning of each stage, we initialize
constitutive laws with these values using set functions. However, this is
not the best solution. I think there must be an external mechanism which
allows for multistage calculation and bringing stresses and state variables
from one stage to another because then we can also change elements, if
needed.
thanks @Vahid-Galavi <https://github.com/Vahid-Galavi> for your comment.
Just out of curiosity, how do you define right now which CL is used in each
stage?
—
You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub
<#9128 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB5PWELMKCVNF73PZZQSLHDUCCINBANCNFSM5ECFE2PQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
That's precisely my point. I think that the best solution, also from user perspective, is to have a unique materials file for al the stages. This contains all the material properties, although some of them might not be used in some of the simulation stages. Then we edit the |
In any case, I think we should first decide if
|
KISS
I don't think that, if we define an interface to identify stages that would be unnecessary |
I am much in favor that (optionally) one per stage rather than a single one with multiple stages. and i would be in favour of defaulting to having a single one for all of the stages as happens now |
@rubenzorrilla Could you please write very schematically how the material.json file would look like if we keep using only file for all stages? In principle, it seems to be that having multiple material files should solve the problem quite efficiently. Maybe we should have something like "main_material.json" (bad name) that contains the properties that will not change throughout the whole process and then each file stage_materia.json will "override" the properties of the main one. |
I have a question, how do you identify stages? |
I think that we will need to name |
Would look as it is right now but without constitutive laws. In the properties you'll need to add all the material parameters that you'll require during the simulation (e.g. for a first thermal stage followed by a mechanical one you'll have
I think that using multiple materials files would imply no changes in what we have so far. Only the preprocess writing needs to be changed. If we decide to go in this direction, I don't see the point on having the global materials file you suggest. |
I was wondering if there was some procedure, and some identification or ID |
The point is that then many of your material properties will be repeated in all the files, for example, the density. Having the same thing defined multiple times seems like a problem to me, especially if you want to modify its value in the file later. |
And chances are that you forget to modify one of the files so you end up repeating the simulation because of this. This would definitively be an advantage of having a unique materials file. |
I really think that the CL belongs in the material properties... |
or a common "base" material.json that is overridden with each stage material file :P |
Hi @ddiezrod, in Kratos we can define ProjectParameters.json per stage. In each ProjectParameters.json file, we can define a different material parameters JSON file. So, we can perfectly use and define different CLs and material parameters per stage. This is simply possible in Kratos. There are already some examples in the app, if you are interested. |
In my opinion the current implementation is fine. There is only a mechanism is missing to transfer data of CLs from one stage to another. Element is not the right place. I fully agree with Riccardo that the CL should be a part of material properties. |
I also think like @RiccardoRossi that the material and CL are very related. And even the same material needs different data for different CL in different stages (like aluminum in filling and cooling stages of Casting) but I think we can modularize it in a different way: Obviously we can have all of them in one Properties.json which has the materials, material_laws and interfaces sections |
So, first we read it usual ay without any problems (at the ctor). Then we recursively check for string parameters starting with "#include", if found, then the file is read, and replaced with the KratosParameters object from the file. Will there be any problems with this approach? |
@sunethwarna how would the syntax be? note that if you add a special keyword to the RHS (to the ones of type string) than you will need to parse any string RHS in search of this special keyword and this would add a lot of overhead on the top of current implementation. if it is done on the user side the overhead would be much smaller |
Ok I see two possibilities,
We also can put the same non-recursive seach with |
{
"some_string": "#include file_name.json"
}
This is the syntax i was thinking of. |
just for the reference...this is the definition of json pointers in the standard |
IDK if this could be useful for your case but when we treat composite materials we define a CL which has inside different CL like: {
"properties" : [{
"model_part_name" : "Structure.Parts_Solid_Auto1",
"properties_id" : 1,
"Material" : {
"constitutive_law" : {
"name" : "SerialParallelRuleOfMixturesLaw",
"combination_factors" : [0.7, 0.3],
"parallel_behaviour_directions" : [1,1,1,1,1,1]
},
"Variables" : {
},
"Tables" : {}
},
"sub_properties" : [{
"properties_id" : 11,
"Material" : {
"constitutive_law" : {
"name" : "LinearElastic3DLaw"
},
"Variables" : {
"DENSITY" : 7850.0,
"YOUNG_MODULUS" : 3e9,
"POISSON_RATIO" : 0.0
},
"Tables" : {}
}
},{
"properties_id" : 12,
"Material" : {
"constitutive_law" : {
"name" : "LinearElastic3DLaw"
},
"Variables" : {
"DENSITY" : 2000.0,
"YOUNG_MODULUS" : 2.1e11,
"POISSON_RATIO" : 0.0
},
"Tables" : {}
}
}]
}]
} |
We actually thought about this option. We could have a law that has a Fluid and a Thermomechanical law defined inside as subproperties and then decide which one to call using ProcessInfo for example. This looks very ad hoc in my opinion and not very clear... |
another issue i see with this is that as of now the ProjectParameters is not in charge of opening files. I honestly think this is good and i would be quite reluctant to changing this |
But in refers to several files, like materials.json and the mdpa file |
yes, but so far we open the file and read it in and then pass it as a string to the ProjectParameter |
I was thinking that maybe we do not need any include. ReadMaterialsUtility does not completely overwrite the properties, so this would work:
we run stage 1
when we run the stage 2 the rest of the properties from stage 1 will still be there (DENSITY, LATENT_HEAT etc) , so you do not have any duplication. ReadMaterials will throw a warning, that is all... |
After some time thinking about your comments I arrived at the following reflections:
|
about point 3, |
It is not a bad idea but then we should put them in the same json. Isn't it? |
yes, but this is completely inline with your proposal: essentially what i am proposing is that you can either set the parameters as you are doing normally "Parameters" : { "YOUNG" : 30e6, "POISSON" : 0.3} or to say that "Parameters" points to another section in the json "Parameters" : "/material_library/mat1/Parameters" where i am assuming that there is a portion "material_library" somewhere within the samefile (from the root of the file in this case) |
just to tell this is documented here: https://github.com/nlohmann/json#json-pointer-and-json-patch and that at the same link you also get links to the standardization of the feature (also the patch feature is supported, which may also be interesting) |
sure that can be done. Note that this requires to interpolate/extrapolate to the nodes before and after mapping, but apart from that it should work |
Extrapolation/interpolation to the nodes might smoothen the stresses and state variables. This is not a desired behaviour when the same mesh and number of integration points are used in the calculation stages. |
I was thinking of non-matching meshes. Ofc for matching meshes you could just copy the variables, no need for mapping Sure the inter/extrapolation might alter the values, but so does the mapping itself. IMO this is the price one would have to pay for non-matching meshes |
And we should think about the mapping of elemental integration point data |
@RiccardoRossi I like the idea of the pointer |
well, i agree about all of those comments about 7, nevertheless i think it is a bit of a different issue: one thing is how to write the material parameters file... a different (very relevant, but different) thing is to do the interpolation of data when the mesh is changed |
We have to deal currently in @KratosMultiphysics/altair side with a design problem in our casting solver. We do multi-stage computations so we can for example do filling + thermomechanical simulation. The problem is that the constitutive law is defined in the material.json and it is unique, although of course, it should be different in each stage.
I know that on the public side nobody is doing multi-stage simulations so you could think this is not a problem yet, However, I understand that this will become a problem in the near future for more and more people so I'd like to open the debate as its always better to think about these things in advance.
I don't have a strong opinion now, but my first thought is that maybe constitutive law has more in common with element formulation than with material properties, so perhaps the most evident solution would be to specify it in the solver settings as we do for "element_name" and "condition_name" instead of defining it in the material.json.
All comments are welcomed, please, share your thoughts.
The text was updated successfully, but these errors were encountered: