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

[Structural] copy-paste bugfix in ConvCrit #5718

Merged
merged 1 commit into from
Oct 15, 2019

Conversation

philbucher
Copy link
Member

@philbucher philbucher commented Oct 3, 2019

Fixing a copy-paste error that leads to NEGLECTING the "other" Dof. For Structural Cases this means that it ALWAYS neglects how the rotations converge / convergence of rotations is not being checked!!!

This is the second time I fixed a MAYOR error in this criteria.
I have not checked the tests yet, no time right now

Since this is anyway 100% the same as the VelPr Criteria in the FluidDynamics I will refactor this and put it to the Core (and also make it compatible with Trilinos) FYI @sunethwarna @jcotela

@KratosMultiphysics/structural-mechanics please check your cases with this

Edit after my findings I would say this should also solve #4479 (closes #4479)

@@ -420,7 +420,7 @@ class DisplacementAndOtherDoFCriteria : public ConvergenceCriteria< TSparseSpace
}
else
{
mReferenceOtherDoFNorm += AuxValue*AuxValue;
DeltaOtherDoFNorm += AuxValue*AuxValue;
Copy link
Member

Choose a reason for hiding this comment

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

Uff, that it is my fault

Copy link
Member Author

Choose a reason for hiding this comment

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

no worries
I was always curious why it always said that the rotations converge instant, but never checked in detail why

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.

OK

@philbucher
Copy link
Member Author

@KratosMultiphysics/structural-mechanics this seems to be a game changer, the simulations that I struggle with for very very very long now converge like a charm!

@agiuliodori could you please try the cases that did not converge for you from #4479 with this branch?

@philbucher
Copy link
Member Author

I ran the tests now, they work fine, hence I will merge this

@loumalouomega @AlejandroCornejo the following test fails (has nothing to do with this PR):

======================================================================
FAIL: test_execution (structural_mechanics_test_factory.TensileTestStructuralTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/philippb/software/Kratos_prod/applications/StructuralMechanicsApplication/tests/structural_mechanics_test_factory.py", line 55, in test_execution
    self.test.RunSolutionLoop()
  File "/home/philippb/software/Kratos_prod/kratos/python_scripts/analysis_stage.py", line 69, in RunSolutionLoop
    self.FinalizeSolutionStep()
  File "/home/philippb/software/Kratos_prod/kratos/python_scripts/analysis_stage.py", line 144, in FinalizeSolutionStep
    process.ExecuteFinalizeSolutionStep()
  File "/home/philippb/software/Kratos_prod/kratos/python_scripts/from_json_check_result_process.py", line 173, in ExecuteFinalizeSolutionStep
    self.__check_values(elem.Id, "Element", value[gp], value_json, variable_name)
  File "/home/philippb/software/Kratos_prod/kratos/python_scripts/from_json_check_result_process.py", line 262, in __check_values
    self.assertTrue(isclosethis, msg=msg)
AssertionError: False is not true : Error checking Element #1221 for variable PLASTIC_DISSIPATION results:
0.38531 != 0.39531; rel_tol=0.0001, abs_tol=0.01

----------------------------------------------------------------------

@philbucher philbucher merged commit a305686 into master Oct 15, 2019
@philbucher philbucher deleted the structural/fix-disp-and-other-dof-crit branch October 15, 2019 11:45
@AlejandroCornejo
Copy link
Member

I ran the tests now, they work fine, hence I will merge this

@loumalouomega @AlejandroCornejo the following test fails (has nothing to do with this PR):

======================================================================
FAIL: test_execution (structural_mechanics_test_factory.TensileTestStructuralTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/philippb/software/Kratos_prod/applications/StructuralMechanicsApplication/tests/structural_mechanics_test_factory.py", line 55, in test_execution
    self.test.RunSolutionLoop()
  File "/home/philippb/software/Kratos_prod/kratos/python_scripts/analysis_stage.py", line 69, in RunSolutionLoop
    self.FinalizeSolutionStep()
  File "/home/philippb/software/Kratos_prod/kratos/python_scripts/analysis_stage.py", line 144, in FinalizeSolutionStep
    process.ExecuteFinalizeSolutionStep()
  File "/home/philippb/software/Kratos_prod/kratos/python_scripts/from_json_check_result_process.py", line 173, in ExecuteFinalizeSolutionStep
    self.__check_values(elem.Id, "Element", value[gp], value_json, variable_name)
  File "/home/philippb/software/Kratos_prod/kratos/python_scripts/from_json_check_result_process.py", line 262, in __check_values
    self.assertTrue(isclosethis, msg=msg)
AssertionError: False is not true : Error checking Element #1221 for variable PLASTIC_DISSIPATION results:
0.38531 != 0.39531; rel_tol=0.0001, abs_tol=0.01

----------------------------------------------------------------------

Okkey thank you, since I want to change the characteristic length calculation, I'll check all the changes

@agiuliodori
Copy link

@philbucher Hi Philipp, i tried the example again with the new branch but it still doesnt work for large displacement (it does work with small displacement beams). Here i attach the example:
https://www.dropbox.com/s/2i2np91zjj6ahdo/Test_viga_18_10_2.gid.rar?dl=0

@philbucher
Copy link
Member Author

@agiuliodori I see that you set the number of non-lin iterations to 10, which in my experience is not enough for very non-lin problems. Did you try with a higher number? I suggest to try with up to 100. Usually it does not need this many but in some steps it might

Also did you try to play with the conv-crit tolerances?
Your setup seems to be the one written by default from gid

Last but not least did you play with the timestep?

What is the error you are getting? Does it not converge in some step or already not in the first one?

@agiuliodori
Copy link

@philbucher Thanks Philipp, i have already tried increasing the number of iterations and with different timestep values, but i did not try to play with tolerances yet. I will do it and tell you.
The simulation runs and finishes correctly but since the first time step the results make no sense (the displacement that i set is in the order of 1e-2 and the displacement output is about 1e+38).

@agiuliodori
Copy link

@philbucher @RiccardoRossi Hi Philipp; i have run the test decreasing tolerances and the displacement field, and incresing the inertia values and it has already converged. Thanks!

@KlausBSautter
Copy link
Contributor

KlausBSautter commented Oct 22, 2019

@agiuliodori if you have further problems, could you check out this branch:
https://github.com/KratosMultiphysics/Kratos/tree/StructMech/beam_check

and use the BeamElement3D2N ? It works way better than the current beam. We might replace it in the future.... @philbucher

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.

Failing Example in release
5 participants