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 415 times
kevinarden
Posts: 2420
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 412 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: 2420
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)
Tapegoji
Posts: 28
Joined: 12 May 2024, 00:22
Antispam: Yes

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

Post by Tapegoji »

Is it possible to have one depends on the other ones with an offset?

for example, I want the potential of boundary 4 to be the potential of boundary 3 - 10 V.
Tapegoji
Posts: 28
Joined: 12 May 2024, 00:22
Antispam: Yes

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

Post by Tapegoji »

I found a solution for adding an offset. It's not in the documentation but I found it in one of Peter presentations.
In the following case. the potential of the boundary 1 will be the potential of boundary 2 minus 20.

Code: Select all

Boundary Condition 1
  Target Boundaries(1) = 2
  Periodic BC = Integer 2
  Periodic BC Potential = Logical True
  Periodic BC Offset Potential = Real -20.0

End

Boundary Condition 2
  Target Boundaries(1) = 9
  Name = "R1_in"
  Current Density =  -1e9
End
raback
Site Admin
Posts: 4862
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

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

Post by raback »

Hi

You might note that given two BC's the "translate" is unique and can be done automatically. However, if you do not define "rotate" or "scale" they are not defined automatically, I think. The reason is that these parameters cannot be uniquely fitted. You could have perfect fit with angles 0 and 180 alike. Hence I recommend setting those keywords (if not trivial), Elmer can figure then out the translation simply by finding a vector that brings the bounding box of each BC to same location while performing the mapping.

-Peter
Tapegoji
Posts: 28
Joined: 12 May 2024, 00:22
Antispam: Yes

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

Post by Tapegoji »

I did notice that when my contact locations are moving the methos fails to work. I need to learn more about rotate and scale options. If you kindly guide me how to find the details. Should I look at the source code?

If you don't mind, can you elaborate more on "perfect fit"?
How is the mapping being done?
Post Reply