Contact and Periodic BCs

Numerical methods and mathematical models of Elmer
Post Reply
pmxppl
Posts: 15
Joined: 29 Jun 2021, 13:41
Antispam: Yes

Contact and Periodic BCs

Post by pmxppl »

Hi

I am trying to run a mechanical/stress analysis that includes both periodic and contact BCs. It seems that this may not be possible?

If I use "Apply Contact BCs = Logical True". I get errors until I comment out the periodic boundary conditions

If I use "Apply Mortar BCs = Logical True" as well then I get the same errors.

If I use just "Apply Mortar BCs = Logical True" then the analysis runs but I don't think the contact boundary conditions are applied properly?

Thanks and Best Regards,

Paul
kevinarden
Posts: 2221
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Contact and Periodic BCs

Post by kevinarden »

Have you reviewed chapter 9 of the solver manual? It discusses both.

https://www.nic.funet.fi/pub/sci/physic ... Manual.pdf
pmxppl
Posts: 15
Joined: 29 Jun 2021, 13:41
Antispam: Yes

Re: Contact and Periodic BCs

Post by pmxppl »

Thank you very much for your quick reply

Yes I did review the solver manual, and have reviewed it again following your reply.

Previously I had successfully applied both contact and periodic boundary conditions separate models.

My current problem is when I try to apply them both in the same model. I have a situation with a contact condition within the domain and periodic boundary conditions applied at the edges of the domain. I cannot get this situation to run even though it runs fine if I consider only the contact, or only the symmetry condition.

I wanted to ask whether there was a fundamental limitation in applying both in the same model before spending too much more time trying to get it to work.
raback
Site Admin
Posts: 4801
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Contact and Periodic BCs

Post by raback »

Hi

The periodic BCs are applied in a node-to-surface type of interpolator that sums up the rows and eliminates the entries. So yes, I could see that there could be a problem with these manipulated lines are used in the contact bc setting.

Now the mortar stuff creates a weak surface-to-surface type of projection matrix that is by default treated with the help of Lagrange multipliers (unless using biorthogonal basis & elimination but let's not go into that). The contact conditions are basically almost the same except there is an additional contact condition that picks only a subset of the rows from the projection matrix.

I don't think we looked at the compability of periodic and mortar stuff in case when they share some dofs. There should be no issue when they do not share nodes.

You could try combining "mortar bc" and "contact bc", or even having just "contact bc" with "tie contact" to imitate the periodic bc.

We might have a look at some contact stuff during summer time. There is some ongoing developments on the topic.

-Peter
pmxppl
Posts: 15
Joined: 29 Jun 2021, 13:41
Antispam: Yes

Re: Contact and Periodic BCs

Post by pmxppl »

Hi Peter

Thanks for the reply, I am impressed with the speed of the support :)

I understand what you are saying, and it makes sense that there may be some issues when they share dof

Actually in my case the contact and periodic conditions do not share dof and so "There should be no issue when they do not share nodes." gives me some encouragement to keep trying.

I shall try it further and put together a test case that I can send over if I still cannot get it to work.

Kind Regards,

Paul
raback
Site Admin
Posts: 4801
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Contact and Periodic BCs

Post by raback »

Hi Paul,

If you still face the problem and have a minimal example I could have a look.

-Peter
pmxppl
Posts: 15
Joined: 29 Jun 2021, 13:41
Antispam: Yes

Re: Contact and Periodic BCs

Post by pmxppl »

Elmer Example.zip
Elmer Example
(95.52 KiB) Downloaded 169 times
Hi Peter,

I have tried a number of things but not quite got it to work yet. Here is a test example.

As setup at the moment if I run it, it does not like that I am trying to use a radial projector for the symmetry condition

Boundary Condition 2
Name = Side1
Target Boundaries(1) = 2
Mortar BC = Integer 3
Mortar BC Nonlinear = Logical False
Mortar BC Static = Logical True
Radial Projector = Logical True
Galerkin Projector = Logical True
Tie Contact = Logical True
End

I have all the Mortar BC's set as tie contacts at the moment but in the end would like a frictional contact for the magnet contact and a periodic BC at the edges of the wedge.

Thanks

Paul
pmxppl
Posts: 15
Joined: 29 Jun 2021, 13:41
Antispam: Yes

Re: Contact and Periodic BCs

Post by pmxppl »

Hi Peter,

I am wondering if you had a chance to look at the files I sent yet and whether you had any feedback.

Thanks,
Paul
DGEckold
Posts: 10
Joined: 10 May 2021, 18:09
Antispam: Yes

Re: Contact and Periodic BCs

Post by DGEckold »

Hi Paul,

Take this with a pinch of salt, as I don't really know what I am doing, I've just been digging around to try and solve my own contact BC problems, but:

It looks like in the SolverUtils.F90 file, a function called DetermineContact is called if 'apply contact bcs = true', and this function will loop over all boundaries with mortar conditions indiscriminately. It is this function that is throwing the error that the projector must be one of flat, plane, rotational or cylindrical, etc.

If you are compiling Elmer from source you could go into this function and make a new logical variable that skips the loop (and therefore the actual work of the function) on a keyword. That way it will hopefully just do the normal mortar method with a radial projector instead of the more specific contact method. With this, a slightly modified version of your case file will run.

This patch is based on the git head of devel, as of a few days ago:

Code: Select all

diff --git a/fem/src/SolverUtils.F90 b/fem/src/SolverUtils.F90
index dc9e4c85..a2aebda5 100644
--- a/fem/src/SolverUtils.F90
+++ b/fem/src/SolverUtils.F90
@@ -2141,7 +2141,7 @@ CONTAINS
      TYPE(Matrix_t), POINTER :: Projector, DualProjector
      TYPE(ValueList_t), POINTER :: BC, MasterBC
      REAL(KIND=dp), POINTER :: nWrk(:,:)
-     LOGICAL :: CreateDual, pContact
+     LOGICAL :: CreateDual, pContact, NonContact
      CHARACTER(*), PARAMETER :: Caller = 'DetermineContact'
      INTEGER, TARGET :: pIndexes(12)
      TYPE(Variable_t), POINTER :: UseLoadVar
@@ -2267,6 +2267,9 @@ CONTAINS
 
        BC => Model % BCs(bc_ind) % Values
 
+       NonContact = ListGetLogical(BC, 'Non-Contacting BC',Found )
+       IF( NonContact ) CYCLE
+
        CALL Info(Caller,'Set contact for boundary: '&
            //TRIM(I2S(bc_ind)),Level=8)
        Model % Solver % MortarBCsChanged = .TRUE.
Hopefully this isn't a silly idea,
David
Attachments
elmer.patch
(894 Bytes) Downloaded 143 times
Example Analysis.sif
(4.23 KiB) Downloaded 154 times
pmxppl
Posts: 15
Joined: 29 Jun 2021, 13:41
Antispam: Yes

Re: Contact and Periodic BCs

Post by pmxppl »

Hi David,

Thank you very much for your reply and sorry for not getting back sooner, for some reason I did not get a notification of it and only just spotted it while browsing the forum.

I have been trying to avoid having to compile Elmer up to now but will get back to this topic sometime soon and will give what you have suggested a go.

Kind Regards,

Paul
Post Reply