Specify arbitrary direction for magnetic field strength

Numerical methods and mathematical models of Elmer
Post Reply
Nick_99
Posts: 42
Joined: 12 Jul 2023, 10:07
Antispam: Yes

Specify arbitrary direction for magnetic field strength

Post by Nick_99 »

Hi all,

I'd like to know if it is possible to set the magnetic field strength property, for a boundary condition, so that the field emanating from the surface is in an arbitrary direction? For example, I'd like define the field to point in the direction of the vector P in the image below. Is something like this possible?
irD6z.png
irD6z.png (4.13 KiB) Viewed 689 times
Kind regards,
Nick
kevinarden
Posts: 2316
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Specify arbitrary direction for magnetic field strength

Post by kevinarden »

The following keywords may be used in order to handle the flux-related boundary conditions:
Magnetic Field Strength i Real
This keyword can be used to define the components hi of the vector h so that the boundary
conditions (18.57) and (18.59) may be imposed.
being the normal vector associated with the common interface.

Magnetic Field Strength 1 = Real 1.0
Magnetic Field Strength 2 = Real 10.0
Magnetic Field Strength 3 = Real 1.0

should result in a vector
Nick_99
Posts: 42
Joined: 12 Jul 2023, 10:07
Antispam: Yes

Re: Specify arbitrary direction for magnetic field strength

Post by Nick_99 »

Oh wow that's some basic calculus I forgot! Thanks Kevin :)
Nick_99
Posts: 42
Joined: 12 Jul 2023, 10:07
Antispam: Yes

Re: Specify arbitrary direction for magnetic field strength

Post by Nick_99 »

Ok so I have a follow-up question. If I'm understanding the manual correctly (page 122 just below EQ 18.56), it is saying that magnetic field strength xyz is specifying the tangential components? Also, what coordinate system is this made with respect to? Does xyz correspond to the global xyz system or is it relative to something else?

If it helps, I'm trying to make a uniform H-field, inside of a cube, in an arbitrary direction. At the moment, I can make a uniform H-field inside of a cube using the following BCs. I just really struggled to do it because I'm not understanding with what coordinate system the mag field strength is referenced to. When I look at the result, the field is in the direction of the z-axis and its perfectly uniform. I just don't get why I'm having to specify the y-components (BC1 and BC2) to do that.

Code: Select all

Boundary Condition 1
  Target Boundaries(1) = 1
  Name = "Front"
  Magnetic Field Strength 2 = Real 50000
End

Boundary Condition 2
  Target Boundaries(1) = 2
  Name = "Back"
  Magnetic Field Strength 2 = Real -50000
End

Boundary Condition 3
  Target Boundaries(1) = 5
  Name = "Left"
  Magnetic Field Strength 3 = Real 50000
End

Boundary Condition 4
  Target Boundaries(1) = 6
  Name = "Right"
  Magnetic Field Strength 3 = Real 50000
End

! Set the tangential components of the vector potential field to zero.
Boundary Condition 5
  Target Boundaries(2) = 3 4 
  Name = "Top_and_Bottom"
  AV {e} = Real 0
End
Attachments
case.sif
(3.76 KiB) Downloaded 31 times
model.geo
(68 Bytes) Downloaded 34 times
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Specify arbitrary direction for magnetic field strength

Post by raback »

Hi

The coordinate system is standard cartesian one.

The field cannot be directly imposed but instead a small system is solved and the magnetic field strength is transformed to a BC for the vector potential. Here is a caveat since the BCs can only be set in the direction of the edges of the boundary. Tangential vector potential relates to normal component of magnetic field strength.

-Peter
Nick_99
Posts: 42
Joined: 12 Jul 2023, 10:07
Antispam: Yes

Re: Specify arbitrary direction for magnetic field strength

Post by Nick_99 »

Hi Peter,

Alright, thanks very much.

Edit: I've sat fiddling with the BCs but am still not able to create a uniform H-field at an arbitrary angle in 3D. Would you perhaps have some insight for me as to how I can do it other than brute forcing all the combinations :lol:

Cheers,
Nick
Nick_99
Posts: 42
Joined: 12 Jul 2023, 10:07
Antispam: Yes

Re: Specify arbitrary direction for magnetic field strength

Post by Nick_99 »

Hi all,

I'm still struggling to get this to work :(

Does anyone have any suggestions or examples?
kevinarden
Posts: 2316
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Specify arbitrary direction for magnetic field strength

Post by kevinarden »

If the field is defined tangent to the boundary in the Cartesian why not just put the cube at the angle to the artisan system?

SetFactory("OpenCASCADE");
Box(1) = {-50, -50, -50, 100, 100, 100};
//+
Rotate {{0, 1, 0}, {0, 0, 0}, Pi/10} {
Duplicata { Volume{1}; }
}
//+
Recursive Delete {
Volume{1};
}
Post Reply