How to specify current direction for a 3D rod that with turns

Numerical methods and mathematical models of Elmer
srinathshiv
Posts: 12
Joined: 11 Sep 2018, 01:05
Antispam: Yes

How to specify current direction for a 3D rod that with turns

For MGDynamics Solver under body force section, there are three current density components in x,y and z.
Current Density 1, Current Density 2 and Current Density 3

For current in z direction for a straight rod
Current Density 1 = 0
Current Density 2 = 0
Current Density 3 = 1e3
untitled.geo
How to specify current direction for the above geometry. Like it starts flowing in y direction, then flows in x direction followed by y direction again in opposite direction.

Thanks.

mzenker
Posts: 1914
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: How to specify current direction for a 3D rod that with turns

Hi,

you can make the current variable in time, like

Code: Select all

``````Current density 1 = Variable Time
Real
0 1
1 0
2 1
3 0
End
``````
for the x component being 1 at t = 0 s and t = 2 s.
See Solver manual, Section 2.3 "Keyword syntax", Paragraph "Defining parameters depending on field variables" for more information.

HTH,
Matthias

raback
Posts: 3420
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: How to specify current direction for a 3D rod that with turns

Hi

For current density you can

1) Use StatCurrentSolver or CoilSolver to precompute a current density field, or
2) Use MATC, table (example of Matthias), UDF to give it as a function of position. For circular coils analytical functions involving SIN and COS are typically used...

-Peter

annier
Posts: 1111
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: How to specify current direction for a 3D rod that with turns

Hi srinathshiv,
And to write MATC expression for trigonometric function, an example is provided as following:

Code: Select all

``````Current density 1 = Variable  time
Real MATC "1+sin(0.2*tx)" ``````
which,calculates and returns j_1= 1+sin(0.2t).

For more details the MATC guide can be referred to:
http://www.nic.funet.fi/pub/sci/physics ... Manual.pdf

Yours Sincerely,
Anil Kunwar
Anil Kunwar
Department of Materials Engineering, KU Leuven, Belgium

srinathshiv
Posts: 12
Joined: 11 Sep 2018, 01:05
Antispam: Yes

Re: How to specify current direction for a 3D rod that with turns

Hi Guys,

Thanks for your reply. I still couldn't change current density with respect to time.
I also tried with co-ordinate scaling 1.

 Using Body Force:

Code: Select all

``````Body Force 1
Name="current density"
Current Density 1 = Variable time
Real MATC "1+sin(0.2*tx)"
! Current Density = 1e8
Current Density 2 = 0
Current Density 3 = 0
End
``````
My current density is still set in x-direction and is not sensitive to time.

Using Boundary:

Code: Select all

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

Coil End = Logical True

AV {e} 1 = Real 0.0
AV {e} 2 = Real 0.0

AV = Real 0.9e-3
End``````
When I set AV variable on the end surface, I can see the current density changing through the geometry as expected. But the magnetic field is messed up and I couldn't see them circling around the current.
Attachments
boundary_currentDesnity.png
bodyForce_currentDensity.png
bodyForce.sif

mzenker
Posts: 1914
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: How to specify current direction for a 3D rod that with turns

Hi,

in your sif file you do a steady state simulation. In that case, the time has no meaning...

HTH,
Matthias

srinathshiv
Posts: 12
Joined: 11 Sep 2018, 01:05
Antispam: Yes

Re: How to specify current direction for a 3D rod with turns

Hi,

Thanks everyone. I can change the current, but when I set the current to zero immediately, it's still flowing based on its previous value.

When I set the boundary AV variables, the current flow is exactly what I want, but the magnetic field is felt only on the boundaries. I'll attach the current flow for boundary stimulation which is my requirement.
 Is it the nature of boundary stimulation or is it possible to get the magnetic field on body as well ?
Also how does elmer does the current flow so elegantly, because I have to implement the current flow in such a way.

The problem with body force is that, I couldn't model the current flow as I want. I'll attach an image (octagon.png) which has my expected current flow model. I know elmer stores co-ordinates and time variables, but is it possible to get the co-ordinates at previous timestep, so that I can compare current co-ordinates and previous co-ordinates.
 Can someone explain is it possible to model current in such a way using body force?

octagon_boundary.tar contains sif, geometry and a screenshot of current flow for boundary stimulation.
octagon.png contains my model with expected current flow.

I'm also willing to write a fortran function to model the current flow.

Thanks.
Attachments
octagon_boundary.tar