BCs dependent on other boundaries values (during simulation)

Numerical methods and mathematical models of Elmer
Post Reply
poyin
Posts: 3
Joined: 23 Dec 2022, 14:53
Antispam: Yes

BCs dependent on other boundaries values (during simulation)

Post by poyin »

Hello Forum,

First of all, thank you Peter for your superb work both in terms of software development and in supporting the community!

I am quite new to Elmer and was wondering if it is possible to solve the following scenario:
Imagine a simple Static Current problem where I have 2 bodies interconnected. I have attached a drawing of one such (simple) case.
Forcing potentials or current densities on BC1 and BC2 there is a certain current flowing (red arrow) through bodies 1, 2 and the yellow "wire".

The question is:
- Is it possible to force a relationship between Boundary 3 and Boundary 4 so that I don´t have to add the (irrelevant to the problem and expected ideal) wire for the interconnection (the yellow dashed body) and making the mesh more complicated than necessary?
- In this simple example of course the problem is not that terrible, but imagine a multiple body case where there may be multiple interconnections and maybe even "crossing wires". :?

Would it be possible to force something like "Potential BC 3 = Potential BC4" and "Current Density 3 = - Current Density 4" or something of that style?
(notice I am not talking about setting static / time dependent conditions on boundaries but more forcing the solver to assume that those boundaries are - at all times- having the stated relationship)

Thanks for you suggestions and congratulations on your bright work!

-Alex
Attachments
Static Current.png
Static Current.png (21.34 KiB) Viewed 278 times
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: BCs dependent on other boundaries values (during simulation)

Post by kevinarden »

https://www.nic.funet.fi/pub/sci/physic ... Manual.pdf
Periodic conditions chapter 9
In this example BC 1, left side is set equal to BC 2 bottom ,by rotating the displacement values by 90 degrees around Z, and scaling them by 1.
Boundary Condition 1
Name = "symmetry"
Target Boundaries(1) = 2
Periodic BC = Integer 2
Periodic BC Translate(3) = Real 0 0 0
Periodic BC Rotate(3) = Real 0 0 90
Periodic BC Scale(3) = Real 1 1 1
Periodic BC Displacement = Logical True
End

Boundary Condition 2
Name = "target"
Target Boundaries(1) = 3
Displacement 1 = 0 ! Normal in Cartesian
End
periodic.png
periodic.png (56.08 KiB) Viewed 275 times
poyin
Posts: 3
Joined: 23 Dec 2022, 14:53
Antispam: Yes

Re: BCs dependent on other boundaries values (during simulation)

Post by poyin »

Thanks, Kevin for your quick reply.

I think I may not be grasping the concept that much or I am missing a portion of it.
What you described is fine if I FORCE a boundary condition on a boundary and want it to be also applied to other ones (with the required rotation, scaling or traslation).
In my case that would work for BC 1 and 3, where i DO FORCE a Potential on them.

The problem with BC3 and BC4 is that I do not set a value to them. They are whatever they need to be based on the calculation.
So the only thing I know a-priori is that, for example, their potentials should be equal (though not what that value is).

Hence, I am not sure how to define that in the SIF file. In my mind it would be something of this sort (the rotation would account for that the current that flows out of one end feds in on the other...):

Code: Select all

Boundary Condition 3
  Target Boundaries(1) = 3 
  Name = "wire_L"
End

Boundary Condition 4
  Target Boundaries(1) = 4 
  Name = "wire_R"
  Periodic BC = Integer 3
  Periodic BC Translate(3) = Real 0 0 0
  Periodic BC Rotate(3) = Real 0 0 180
  Periodic BC Scale(3) = Real 1 1 1
  Periodic BC Potential = Logical True
End
(but obviouslly that is not enough).
Maybe I am missing something fundamental
Last edited by poyin on 23 Dec 2022, 19:43, edited 1 time in total.
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: BCs dependent on other boundaries values (during simulation)

Post by kevinarden »

Sorry, I mis-understood. But in the same chapter 9 is Mortar conditions, they can provide the capability you are describing.
poyin
Posts: 3
Joined: 23 Dec 2022, 14:53
Antispam: Yes

Re: BCs dependent on other boundaries values (during simulation)

Post by poyin »

OK, I finally found what the problem was!

It didn´t like the translate statement.

So the final code that would do it looks like:

Code: Select all

Boundary Condition 3
  Target Boundaries(1) = 3 
  Name = "wire_L"
End

Boundary Condition 4
  Target Boundaries(1) = 4 
  Name = "wire_R"
  Periodic BC = Integer 3
!  Periodic BC Translate(3) = Real 0 0 0
  Periodic BC Rotate(3) = Real 0 0 180
  Periodic BC Scale(3) = Real 1 1 1
  Periodic BC Potential = Logical True
End
Thanks for the tip on the appropriate references (I had read the manuals but, apparently, not deeply enough)
Post Reply