Contact Mechanics - Friction Test

Numerical methods and mathematical models of Elmer
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Contact Mechanics - Friction Test

Post by kevinarden »

I don't know how to do that from the sif file. I could envision copying the module and adding output code directly. Which module did you find the code in?
maike151
Posts: 41
Joined: 10 May 2019, 10:00
Antispam: Yes
Location: Cologne, Germany

Re: Contact Mechanics - Friction Test

Post by maike151 »

That's what I thought. So right now I am trying to output Fdynamic and Fstatic directly to the terminal. It is not working yet though. Are you well versed in Fortran90?
The code can be found in SolverUtils.F90, Subroutine TangentContactSet.

I added lines to

IF( FrictionContact .AND. &
ListGetLogical( BC,'Stick Contact Global',Found ) ) THEN

[....]

Fstatic = Fstatic + mustatic * ABS( NodeLoad )
Fdynamic = Fdynamic + mudynamic * ABS( NodeLoad )
Ftangent = Ftangent + ABS( TangentLoad )
IF( Ftangent > Fstatic ) THEN
SlipContact = .TRUE.
FrictionContact = .FALSE.
ELSE
GOTO 100
END IF
END DO

!!!!!!!!!!!!!!!!!!!!! new !!!!!!!!!!!!!!!!!!!!!!!!!!!
write(str_dyn , *) Fdynamic
CALL Info('TangentContactSet',str_dyn)
write(str_stat , *) Fstatic
CALL Info('TangentContactSet',str_stat)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

ENDIF

Compiling worked, but I don't get the output. Also, it seems that the subroutine TangentContactSet is not called for a very long time, the first time it is called is when the cube is already displaced beyond the edge of the floor, so there is no contact anymore. Then I get the output

LevelProjector: Number of slave entries: 0 ! <-------- no contact
LevelProjector: Number of master entries: 0 ! <--------- no contact
List_ToCRSMatrix: Number of entries in CRS matrix: 943
List_ToCRSMatrix: Matrix format changed from List to CRS
List_ToCRSMatrix: Number of entries in CRS matrix: 943
List_ToCRSMatrix: Matrix format changed from List to CRS
WARNING:: LevelProjector: Projector % InvPerm not set in for dofs: 943
LevelProjector: Projector created
PeriodicProjector: Elapsed REAL time: 0.0237 (s)
PeriodicProjector: Projector created, now exiting...
DefaultFinishBulkAssembly: Saving bulk values for: nonlinelast
DetermineContact: Rotating displacement field
DetermineContact: Determining contact load for contact problems
DetermineContact: Set contact for boundary: 4
DetermineContact: Using also the dual projector
DetermineContact: We have a normal-tangential system
DetermineContact: Using friction contact for displacement
DetermineContact: All normals are consistently signed
DetermineContact: Normal direction for distance measure: 1
TangentContactSet: Setting the stick set tangent components ! <-------- Function was called
DetermineContactSet: Creating fields out of normal and stick contact sets
DetermineContact: Setting contact friction for boundary
SetSlideFriction: Number of friction nodes: 0
DetermineContact: All done

The last iteration before this there are nodes in the contact pair and I don't get the output "TangentContactSet:....". I hope you can follow me, sorry for the huge amount of text.
maike151
Posts: 41
Joined: 10 May 2019, 10:00
Antispam: Yes
Location: Cologne, Germany

Re: Contact Mechanics - Friction Test

Post by maike151 »

So little update: I deleted the line "Stick Contact Global = Logical True" and now the function is called from the beginning on. But my output is still not there. I even added the line

CALL Info('TangentContactSet', 'Hallo_outofif')

outside of the IF-loop to see if the If-condition is maybe not met, but this is also not in the output.
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Contact Mechanics - Friction Test

Post by kevinarden »

I would have done
write(*,*) 'Fdynamic =',Fdyanamic
to write it to the screen

and

inquire(unit=10,open=lopen)
if (.not. lopen) OPEN( 10, FILE='myFile' )

Write(10,*) 'Fdynamic =',Fdyanamic

to write to a file, of course you can only open the file once. so the open can't be in a loop, or you don't want to open it every time the subroutine is called.

The inquire statement lets you go fishing around to see what is on disk, and what is currently attached to units in your program. The key arguments are 'FILE=', to establish the name of the file being checked, and 'EXIST=', to assign a logical variable telling whether or not the file exists.
inquire(file='test.file',exist=lexist)
will result in a value of .true. in the logical variable 'lexist' if 'test.file' exists in the current directory. You can check if the file has been opened with:
inquire(file='test.file',opened=lopen) .
where 'lopen' is a logical variable, or if a unit is connected with something like:
inquire(unit=11,opened=lopen)
maike151
Posts: 41
Joined: 10 May 2019, 10:00
Antispam: Yes
Location: Cologne, Germany

Re: Contact Mechanics - Friction Test

Post by maike151 »

I get an output now, but unfortunately not the right values:

mustatic: 0.29999999999999999
mudynamic: 0.20000000000000001
NodeLoad: 0.0000000000000000
DetermineContactSet: Creating fields out of normal and stick contact sets
Fstatic: 4.5454039417394682E-322
Fdynamic: 6.9529800193766885E-310

the fricition coefficients are correct but NodeLoad (Normalload) is somehow zero and Fstatic and Fdynamic also very close to zero.
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Contact Mechanics - Friction Test

Post by kevinarden »

Found this in the code, if you don't set Contact Type it defaults to slide
options are stick, tie, friction, slide
not yet sure what the behavior of each is

! Get the contact type. There are four possibilities currently.
! Only one is active at a time while others are false.
StickContact = .FALSE.; TieContact = .FALSE.
FrictionContact = .FALSE.; SlipContact = .FALSE.

ContactType = ListGetString( BC,'Contact Type',Found )
IF( Found ) THEN
SELECT CASE ( ContactType )
CASE('stick')
StickContact = .TRUE.
CASE('tie')
TieContact = .TRUE.
CASE('friction')
FrictionContact = .TRUE.
CASE('slide')
SlipContact = .TRUE.
CASE Default
CALL Fatal('DetermineContact','Unknown contact type: '//TRIM(ContactType))
END SELECT
ELSE
StickContact = ListGetLogical( BC,'Stick Contact',Found )
IF(.NOT. Found ) TieContact = ListGetLogical( BC,'Tie Contact',Found )
IF(.NOT. Found ) FrictionContact = ListGetLogical( BC,'Friction Contact',Found )
IF(.NOT. Found ) SlipContact = ListGetLogical( BC,'Slip Contact',Found )
IF(.NOT. Found ) SlipContact = ListGetLogical( BC,'Slide Contact',Found )
IF(.NOT. Found ) THEN
CALL Warn('DetermineContact','No contact type given, assuming > Slip Contact <')
SlipContact = .TRUE.
END IF
END IF
maike151
Posts: 41
Joined: 10 May 2019, 10:00
Antispam: Yes
Location: Cologne, Germany

Re: Contact Mechanics - Friction Test

Post by maike151 »

In BC 4 I define Friction Contact = Logical True. In the SolverManual it says

"Instead of using the above flags to set the contact type, the user may also give a string that chooses between the different options."

The "above flags" are using for example "Friction Contact = Logical True". This is what the code after the ELSE is looking for.

So it should have the same effect. I tried it anyway and nothing changes :-(
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Contact Mechanics - Friction Test

Post by kevinarden »

Is this output from the beginning of the simulation or the end?

mustatic: 0.29999999999999999
mudynamic: 0.20000000000000001
NodeLoad: 0.0000000000000000
DetermineContactSet: Creating fields out of normal and stick contact sets
Fstatic: 4.5454039417394682E-322
Fdynamic: 6.9529800193766885E-310

the fricition coefficients are correct but NodeLoad (Normalload) is somehow zero and Fstatic and Fdynamic also very close to zero.
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Contact Mechanics - Friction Test

Post by kevinarden »

from ElmerSolver manual
Mortar BC Integer
This is set for the non-mortar (slave) boundary to refer to the boundary condition index of the
corresponding mortar boundary. The mortar boundaries always come in pairs, but the settings
are only given in the context of the non-mortar boundary.

I took this to mean that the parameter is set for the slave surface and points back to the master. I switched it around in the sif. The contact worked but the answer is still the same for different coefficients of friction.
maike151
Posts: 41
Joined: 10 May 2019, 10:00
Antispam: Yes
Location: Cologne, Germany

Re: Contact Mechanics - Friction Test

Post by maike151 »

The output was from the beginning of the simulation. Now I am only looking at the output at the end of a timestep.

I deleted the lines
displacement 1,2,3 = 0 in Bc 4 (the master condition, top of the floor)

and now the normalloads are not zero anymore, but way too high.

I also tried switching the parameters in the master condition to the slave condition, but the normalloads are still way too high.
Post Reply