Skip to content
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

Thermally coupled Constitutive Laws #9053

Merged
merged 157 commits into from
Aug 31, 2023

Conversation

AlejandroCornejo
Copy link
Member

@AlejandroCornejo AlejandroCornejo commented Aug 16, 2021

Description
Dear @KratosMultiphysics/structural-mechanics and @KratosMultiphysics/constitutive-models

I'm implementing all the code infraestructure in order to be able to simulate thermo-mechanical calculations with a solver that couples the Structural and the ConvectionDiffusion Apps.

The solver was already there long time ago, I've just improved it a bit and corrected a detail.

The setting of the REFERENCE_TEMPERATURE, different options are implemented: using the GetValue() in the Geometry (has to be set outside by someone) and being a material property as:

void ThermalLinearPlaneStrain::InitializeMaterial(
    const Properties& rMaterialProperties,
    const GeometryType& rElementGeometry,
    const Vector& rShapeFunctionsValues
    )
{
    if (rElementGeometry.Has(REFERENCE_TEMPERATURE)) {
        mReferenceTemperature = rElementGeometry.GetValue(REFERENCE_TEMPERATURE);
    } else if (rMaterialProperties.Has(REFERENCE_TEMPERATURE)) {
        mReferenceTemperature = rMaterialProperties[REFERENCE_TEMPERATURE];
    }
}

Changelog
Please summarize the changes in one list to generate the changelog:
E.g.

  • Erased the convective term in the Eulerian calculation
  • Creation of the new thermal CL inside the ConstitutiveLawsApp, only the elastic basic ones
  • etc...

Documentation

Now, the materials.json for the structural problem looks as this:

{
    "properties" : [{
        "model_part_name" : "Structure.Parts_Solid_Solid_Auto1",
        "properties_id"   : 1,
        "Material"        : {
            "constitutive_law" : {
                "name" : "ThermalLinearPlaneStrain"
                
            },
            "Variables"        : {
                "DENSITY"       : 7850.0,
                "YOUNG_MODULUS" : 2.1e11,
                "POISSON_RATIO" : 0.29,
                "THERMAL_EXPANSION_COEFFICIENT" : 7.2e-6,
                "REFERENCE_TEMPERATURE" : 22.5
            },
            "Tables"           : {
                "TEMPERATURE_vs_E" : {
                        "input_variable"  : "TEMPERATURE",
                        "output_variable" : "YOUNG_MODULUS",
                        "data"            : [[-1,   2.1e11],
                                             [3500, 2.1e8 ],
                                             [1e6,  2.1e8 ]]
                    }
            },
        "accessors"        : {
            "accessor_table_T_E" : {
                "accessor_type"  : "table_accessor", // here we indicate the table accessor
                "properties" : {
                    "table_input_variable"      : "TEMPERATURE",
                    "table_output_variable"     : "YOUNG_MODULUS",
                    "table_input_variable_type" : "node_historical" // we support several types

				}
            }
        }
        }
    }]
}

Copy link
Member

@loumalouomega loumalouomega left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Se my comment of VariableUtils

@loumalouomega
Copy link
Member

1. In order to reduce code repetition in the `thermal_constitutive_laws `I'm going to slightly modify the original CL. This change consists in subtituting the `rValues.GetProperties()[YOUNG_MODULUS]` by a new virtual method called `GetMaterialProperty(YOUNG_MODULUS)`, which in the original cl will do the same operation as before. In the case of the thermal laws, the only method to be modified would be the `GetMaterialProperty(rVariable)`, where we modifiy the property according to a certain `TEMPERATURE` Table.

This has a small overhead..., I am OK because there is not easy manner. Except maybe templated static auxiliary methods...

@AlejandroCornejo
Copy link
Member Author

1. In order to reduce code repetition in the `thermal_constitutive_laws `I'm going to slightly modify the original CL. This change consists in subtituting the `rValues.GetProperties()[YOUNG_MODULUS]` by a new virtual method called `GetMaterialProperty(YOUNG_MODULUS)`, which in the original cl will do the same operation as before. In the case of the thermal laws, the only method to be modified would be the `GetMaterialProperty(rVariable)`, where we modifiy the property according to a certain `TEMPERATURE` Table.

This has a small overhead..., I am OK because there is not easy manner. Except maybe templated static auxiliary methods...

Te other option is to repeat all the code and leave alone the original CL... IDK if more templates.. hehe

loumalouomega
loumalouomega previously approved these changes Aug 16, 2021
@AlejandroCornejo
Copy link
Member Author

AlejandroCornejo commented Aug 22, 2023

ok guys! I've done quite an effort in avoiding code repetition. In this case I avoided Templates (sorry Vicente, nothing personal ;) ). Now the elastic 3D thermal implements everything and the thermal plane strain and stress derive from it overriding only 3 methods.

I've moved a previously repeated method to the utilities to reuse the same implementation.

@loumalouomega
Copy link
Member

ok guys! I've done quite an effort in avoiding code repetition. In this case I avoided Templates (sorry Vicente, nothing personal ;) ). Now the elastic 3D thermal implements everything and the thermal plane strain and stress derive from it overriding only 3 methods.

I've moved a previously repeated method to the utilities to reuse the same implementation.

It works for me

loumalouomega
loumalouomega previously approved these changes Aug 22, 2023
Copy link
Member

@loumalouomega loumalouomega left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing my block

@AlejandroCornejo
Copy link
Member Author

Let's see if @rubenzorrilla @RiccardoRossi @philbucher have something to say

@AlejandroCornejo
Copy link
Member Author

ping

loumalouomega
loumalouomega previously approved these changes Aug 25, 2023
@loumalouomega
Copy link
Member

ping

Pong

Copy link
Member

@rubenzorrilla rubenzorrilla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests subsubfolder are still in there. Besides, the subfolder is at the level of the files of another test, something that is way misleading.

Please, either wrap the already existent test files in a new folder or simply put the thermo_mechanical_accessor at the same level.

@AlejandroCornejo
Copy link
Member Author

done

@AlejandroCornejo
Copy link
Member Author

ping

Pong

ping

@loumalouomega
Copy link
Member

ping

Pong

ping

@rubenzorrilla

@rubenzorrilla
Copy link
Member

rubenzorrilla commented Aug 31, 2023

done

Thanks. Now it's much more tidy.

Copy link
Member

@rubenzorrilla rubenzorrilla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All my concerns have been addressed. Good job.

@loumalouomega
Copy link
Member

@AlejandroCornejo right now

@AlejandroCornejo
Copy link
Member Author

68747470733a2f2f6d656469612e74656e6f722e636f6d2f544f4c4844616432686e6741414141432f637261622d64616e63652e676966

@AlejandroCornejo right now

yeah!!!!!!!!!!!!!!!!!!!!! finally :)

@AlejandroCornejo AlejandroCornejo merged commit b1a09f2 into master Aug 31, 2023
11 checks passed
@AlejandroCornejo AlejandroCornejo deleted the thermal-solver-mechanical-coupling branch August 31, 2023 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants