UMAT and mortar BC

Numerical methods and mathematical models of Elmer
Post Reply
FredrikR
Posts: 11
Joined: 08 Aug 2023, 13:49
Antispam: Yes

UMAT and mortar BC

Post by FredrikR »

Hello!

About ElasticSolver with UMAT and Mortar BC. I have run into some problems

1. Using UMAT without Mortar BC and

Code: Select all

Normal-Tangential Displacement = True 
for Dirichlet BC and together with Neumann BC at the load boundary just output a 0 result. After a little debugging I can see in ElasticSolver that the RHS is all 0 after the Dirchlets have been applied.


2. Using UMAT with Mortar BC and

Code: Select all

Normal-Tangential Displacement = True 
in the Mortar BC at the interface does not give reasonable stress and strain results.

3. Using UMAT with Mortar BC and

Code: Select all

Normal-Tangential Displacement = False 
for the Mortar BC seems to give reasonable stress and strain result but the displacement contact load is not correct.

I think this has to do with ElasticSolver is normally (without UMAT) solving Ku = F using the total displacement while with UMAT it is solving for the incremental displacement.

Any suggestions here would be appreciated..

Best regards Fredrik
FredrikR
Posts: 11
Joined: 08 Aug 2023, 13:49
Antispam: Yes

Re: UMAT and mortar BC

Post by FredrikR »

I think I have found something with the issue with Normal-Tangential Displacement BC with UMAT, (1) in previous post. Here in ElasticSolve, DValues refer to the NT-rotated coords while Displacement refers to cartesian.

Code: Select all

1201     IF (UseUMAT) THEN
1202       ! ---------------------------------------------------------------------------------
1203       ! Now the solution variable is the solution increment while the sif-file specifies
1204       ! the Dirichlet BCs for the complete field. Modify BCs so that the right BC
1205       ! is obtained for the solution increment.
1206       ! ---------------------------------------------------------------------------------
1207       IF (ALLOCATED(StiffMatrix % ConstrainedDOF)) THEN
1208         DO i=1,StiffMatrix % NumberOfRows
1209           IF (StiffMatrix % ConstrainedDOF(i)) THEN
1210             StiffMatrix % DValues(i) = StiffMatrix % DValues(i) - Displacement(i)
1211           END IF
1212         END DO
With the following modification it seems to work

Code: Select all

****       DisplacementRot = Displacement
****       CALL RotateNTSystemAll( DisplacementRot, StressPerm, STDOFs)
1207       IF (ALLOCATED(StiffMatrix % ConstrainedDOF)) THEN
1208         DO i=1,StiffMatrix % NumberOfRows
1209           IF (StiffMatrix % ConstrainedDOF(i)) THEN
1210             !StiffMatrix % DValues(i) = StiffMatrix % DValues(i) - Displacement(i)
****             StiffMatrix % DValues(i) = StiffMatrix % DValues(i) - DisplacementRot(i)
1211           END IF
1212         END DO
Also I had to modify

Code: Select all

1163         IF (UseUmat .AND. Iter == 1) THEN
1164           ! ---------------------------------------------------------------------------
1165           ! Update the RHS vector which contains just the contribution of external loads
1166           ! for the purpose of nonlinear error estimation:
1167           ! ---------------------------------------------------------------------------
1168           ValuesSaved => StiffMatrix % RHS
1169           StiffMatrix % RHS => StiffMatrix % BulkRHS
1170           CALL DefaultUpdateForce(LocalForce)
1171           Solver % Matrix % RHS => ValuesSaved
1172         END IF
--
1187         CALL DefaultUpdateEquations( LocalStiffMatrix, LocalForce )
to

Code: Select all

1163         IF (UseUmat .AND. Iter == 1) THEN
1164           ! ---------------------------------------------------------------------------
1165           ! Update the RHS vector which contains just the contribution of external loads
1166           ! for the purpose of nonlinear error estimation:
1167           ! ---------------------------------------------------------------------------
1168           ValuesSaved => StiffMatrix % RHS
1169           StiffMatrix % RHS => StiffMatrix % BulkRHS
****           LocalForceSaved = LocalForce
1170           CALL DefaultUpdateForce(LocalForce)
****           LocalForce = LocalForceSaved
1171           Solver % Matrix % RHS => ValuesSaved
1172         END IF
because LocalForce gets rotated in DefaultUpdateForce. Later DefaultUpdateEquations is also rotating LocalForce so it must be sent in "unrotated".

I'm out on deep water here. Maybe someone from the Elmer team can have a look at this and see if this is the proper way of solving it. For instance, is it the StressPerm that should be used for displacement or does it have it own permutation?

Best regards Fredrik
mika
Posts: 236
Joined: 15 Sep 2009, 07:44

Re: UMAT and mortar BC

Post by mika »

Hi,

I think you have done right code modifications to allow for a normal-tangential BC with UMAT. They might well be worth creating a pull request.

-- Mika
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: UMAT and mortar BC

Post by raback »

Hi

You went deep quickly! Both UMAT and mortars prefer solving for the residual and these have been developed independently. Of course these shoudl work together but you may be the 1st person to try out this combination.

You could maybe have a test case at some github repo. Then it could be easier to check the results.

-Peter
FredrikR
Posts: 11
Joined: 08 Aug 2023, 13:49
Antispam: Yes

Re: UMAT and mortar BC

Post by FredrikR »

Hi!

Yes sure! I have a simple test case. I just need to clean up the code a little. I will notify later.

Regarding issue 2 and 3 in the first post I think I have found the cause. I will submit some comments for those in a short while as well.

Best regards Fredrik
FredrikR
Posts: 11
Joined: 08 Aug 2023, 13:49
Antispam: Yes

Re: UMAT and mortar BC

Post by FredrikR »

Hi!

I posted a pull request. First time for me using GitHub. I hope I did it correctly and as intended. If not, let me know.

Best regards Fredrik
mika
Posts: 236
Joined: 15 Sep 2009, 07:44

Re: UMAT and mortar BC

Post by mika »

Thanks, your changes have now been merged. I noticed a small mistake in a size specification of memory allocation. It is also fixed in the devel branch.

-- Mika
Post Reply