KratosMultiphysics / Kratos

Kratos Multiphysics (A.K.A Kratos) is a framework for building parallel multi-disciplinary simulation software. Modularity, extensibility and HPC are the main objectives. Kratos has BSD license and is written in C++ with extensive Python interface.
https://kratosmultiphysics.github.io/Kratos/
Other
1.02k stars 245 forks source link

LHS of linear elastic material changes in newton raphson scheme in geomechanics application #10588

Closed aronnoordam closed 1 year ago

aronnoordam commented 1 year ago

Either a bug or at least unexpected behaviour

In the geomechanics application, when running a dynamic calculation with newton raphson strategy and newmark scheme, the left hand side of the solution changes between solutionsteps. Currently the calculation can only be performed when the LHS matrix is rebuild every solutionstep; when only rebuilding the RHS, the solution does not converge. (in other words, using rebuildlevel = 0, does not work, rebuildlevel =1 or 2 works)

Since the material is linear elastic I expect the LHS to be constant

loumalouomega commented 1 year ago

Huuum, does it happen in static calculation?, maybe the problem is due to the dynamic LHS contributions.

loumalouomega commented 1 year ago

What elements are you using?, SmallDisplacementElement and TotalLagrangianElement integrates in the reference configuration

Vahid-Galavi commented 1 year ago

@aronnoordam in dynamic simulations, you have dt in LHS. Are you using the same dt in all steps? Do you have other contributions which are not constant in the time steps, damping matrix, permeability, ...?

aronnoordam commented 1 year ago

@loumalouomega , I will check if it also happens in static situation. I'm using SmallDisplacementElement

@Vahid-Galavi I am using a constant dt. The rest should also be constant. I have performed a drained calculation, using the GeoLinearElasticPlaneStrain2DLaw

loumalouomega commented 1 year ago

Okay, tell me if there are changes.

aronnoordam commented 1 year ago

the problem stays in quasi-static calculations

Vahid-Galavi commented 1 year ago

@aronnoordam There is no element with this name "SmallDisplacementElement" in GeomechanicsApp.

aronnoordam commented 1 year ago

i narrowed the problem down to the calling of:

BaseType::mpLinearSystemSolver->Solve(A, Dx, b);

line 476 in residualbased_block_builder_and_solver.h

aronnoordam commented 1 year ago

@aronnoordam There is no element with this name "SmallDisplacementElement" in GeomechanicsApp.

I've used UPwSmallStrainElement2D3N

Vahid-Galavi commented 1 year ago

@aronnoordam There is no element with this name "SmallDisplacementElement" in GeomechanicsApp.

I've used UPwSmallStrainElement2D3N

Do you have the same behaviour with an equivalent element from StructuralmechanicsApp? Are you using viscous boundaries?

aronnoordam commented 1 year ago

I did not check in other applications. I only have a line load and a non displacement boundary. But I expect indeed that its not an error in geomechanics, rather in the linear solver or my linear solver settings. Do you expect that one of the linear solver settings can change the LHS ? If so, can i change the settings such that it doesnt happen?

aronnoordam commented 1 year ago

I've found out that, if the linear solver scaling setting is set on false, the calculation runs correctly. When setting the scaling parameter on true, the LHS changes per iteration. @loumalouomega is this expected?

aronnoordam commented 1 year ago

@Vahid-Galavi , are there reasons to no set the linear solver scaling parameter in the Geomechanics application on False?

Vahid-Galavi commented 1 year ago

@Vahid-Galavi , are there reasons to no set the linear solver scaling parameter in the Geomechanics application on False?

This is to scale stiffness matrix when you have components with different stiffness. In your case, you do not need to set scaling to true. But it is still strange that this option changes the matrix differently per step, although the input stiffness is always the same.

aronnoordam commented 1 year ago

okay thanks, I will close this issue and make one for the core

aronnoordam commented 1 year ago

https://github.com/KratosMultiphysics/Kratos/issues/10589