Whitney AV Solver: 3D periodic boundaries possible?

General discussion about Elmer
Post Reply
crobar
Posts: 49
Joined: 30 Mar 2014, 14:50
Antispam: Yes

Whitney AV Solver: 3D periodic boundaries possible?

Post by crobar »

Another question about the Whitney AV solver. Is it possible use periodic (sometimes called cyclic) boundaries in 3D?

Many common magnetic systems have symmetry which allows you to model only a small portion of the system to get the results you need. The idea is that the nodes on one boundary are essentially the same nodes as on the other boundary. Has anyone any experience doing this with Elmer, even in another type of problem. Can an appropriate mesh be made in Salome?
raback
Site Admin
Posts: 4823
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Whitney AV Solver: 3D periodic boundaries possible?

Post by raback »

Hi

Yes, this is possible. Elmer uses the mortar finite element technique to ensure continuity of solution even for nonconformal meshes. There is actually not much literature on how to do this for edge elements... There are at least three test cases where this has been applied.

Code: Select all

RotatingBCMagnetoDynamics
RotatingBCMagnetoDynamics2
RotatingBCMagnetoDynamicsGeneric
These tests happen to be rotating as well but there are symmetry conditions also.

-Peter
crobar
Posts: 49
Joined: 30 Mar 2014, 14:50
Antispam: Yes

Re: Whitney AV Solver: 3D periodic boundaries possible?

Post by crobar »

raback wrote:Hi

Yes, this is possible. Elmer uses the mortar finite element technique to ensure continuity of solution even for nonconformal meshes. There is actually not much literature on how to do this for edge elements... There are at least three test cases where this has been applied.

Code: Select all

RotatingBCMagnetoDynamics
RotatingBCMagnetoDynamics2
RotatingBCMagnetoDynamicsGeneric
These tests happen to be rotating as well but there are symmetry conditions also.

-Peter
Thanks, are these for 3D or 2D? I've realised I wasn't clear in that I want 3D which means having two matching faces (surfaces), not just edges in 2D. I'll have a look at the test cases.
vencels
Posts: 66
Joined: 20 Sep 2016, 17:05
Antispam: Yes
Location: Latvia
Contact:

Re: Whitney AV Solver: 3D periodic boundaries possible?

Post by vencels »

Hi

My pseudo 2D problem has two bodies - wire which has current flowing in z direction (given as body force) and air around. I am trying to solve this 2D problem with 3D solver WhitneyAVHarmonicSolver by setting periodic BC's.
When I use "Mortar BC" then the problem does not converge, when I use "Periodic BC" then I get segmentation fault.

Any ideas where the problem might be?

Image

Code: Select all

Header
  CHECK KEYWORDS Warn
  Mesh DB "." "mesh"
  Include Path ""
  Results Directory ""
End

Simulation
  Max Output Level = 12
  Coordinate System = Cartesian
  Coordinate Mapping(3) = 1 2 3
  Angular Frequency = 628.32

  Simulation Type = Transient
  Timestepping Method = BDF
  BDF Order = 2
  Timestep Sizes = 0.001
  Timestep Intervals = 2
  Steady State Max Iterations = 1


  Solver Input File = case.sif
  Post File = case.vtu
  Output Intervals(1) = 1
End

Constants
  Gravity(4) = 0 -1 0 9.82
  Stefan Boltzmann = 5.67e-08
  Permittivity of Vacuum = 8.8542e-12
  Permeability of Vacuum = 1.257e-6
  Boltzmann Constant = 1.3807e-23
  Unit Charge = 1.602e-19
End

Body 1
  Target Bodies(1) = 1
  Name = "air"
  Equation = 1
  Material = 1
End

Body 2
  Target Bodies(1) = 2
  Name = "wire"
  Equation = 1
  Material = 2
  Body Force = 1
End

Solver 1
  Equation = "MGDynamics"
  Variable = "AV[AV re:1 AV im:1]"
  Procedure = "MagnetoDynamics" "WhitneyAVHarmonicSolver"

  Linear System Symmetric = True

  Linear System Solver = "Iterative"
  Linear System Preconditioning = None
  Linear System Residual Output = 50
  Linear System Max Iterations = 5000
  Linear System Iterative Method = BiCGStabl
  Linear System Convergence Tolerance = 1.0e-6

  BicgStabl Polynomial Degree = 4
  Optimize Bandwidth = False

  Edge Basis = Logical True
  Apply Mortar BCs = Logical True
End

Equation 1
  Name = "MGDyn"
  Active Solvers(1) = 1
  Magnetic Induction = Logical True
End

Material 1
  Name = "Air"
  Electric Conductivity = 1e-6
  Relative Permittivity = 1
  Relative Permeability = 1
End

Material 2
  Name = "Wire"
  Electric Conductivity = 1e3
  Relative Permittivity = 1
  Relative Permeability = 1
End

Body Force 1
  Name = "Current"
  Current Density im 3 = Real 1
End

Boundary Condition 1
  Target Boundaries(1) = 5
  Name = "farfield"
  P {e} = real 0
  P = real 0
End

Boundary Condition 2
  Name = "air_back"
  Target Boundaries(1) = 3

  Mortar BC = 3

  !Periodic BC = Integer 3
  !Periodic BC Explicit = Logical True
  !Periodic BC P = Logical True
End

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

Boundary Condition 4
  Name = "wire_back"
  Target Boundaries(1) = 6

  Mortar BC = 5

  !Periodic BC = Integer 5
  !Periodic BC Explicit = Logical True
  !Periodic BC P = Logical True
End

Boundary Condition 5
  Name = "wire_front"
  Target Boundaries(1) = 8
End
Segmentation fault when using "Periodic BC":

Code: Select all

	at /home/vencels/Projects/Elmer/elmerfem/fem/src/MeshUtils.F90:4137
#4  0x7fc6bb48521b in __meshutils_MOD_createinterfacemeshes
	at /home/vencels/Projects/Elmer/elmerfem/fem/src/MeshUtils.F90:3703
#5  0x7fc6bb44a9de in __meshutils_MOD_periodicprojector
Attachments
wire_in_air_2D.zip
wire_in_air
(197.51 KiB) Downloaded 333 times
raback
Site Admin
Posts: 4823
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Whitney AV Solver: 3D periodic boundaries possible?

Post by raback »

Hi

Periodic BCs is on older approach where a strong projector is found for nodal degrees of freedom in style x_s=Px_m. For Hcurl elements such construction is not possible - we should make Elmer go Fatal on those accations. Instead we use a weak mortar type of condition where Qx_s=Px_m (s and m refer to slave and master dofs). Also for the mortar projectors there are several alternatives. The one that can exactly integrate over nonconforming meshes is enforced by "Level Projector = True". The idea there is to find the element intersections in 2D plane.

You could have better luck with setting in style of below:

Code: Select all

Boundary Condition bc_id
  Name = "bc_name"
  Target Boundaries(1) = 10
  Mortar BC = 7
  Level Projector = Logical True 
  Level Projector Generic = Logical True
You may also have a problems in BCs. If your primary variable is "AV" also the infinity BCs should be for "AV ...".

Perhaps you could have a look at mgdyn_harmonic_wire. It is difficult to say what the sufficient linear system tolerance is but it is well known that the Hcurl elements have a harder time converging and you may have to accept results that are barely converged whereas for similar case with nodal basis functions you would easily converge close to machine precision.

-Peter
raback
Site Admin
Posts: 4823
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Whitney AV Solver: 3D periodic boundaries possible?

Post by raback »

Hi

You could try with the attached sif file. Also it has an issues in combination of complex linear solvers and additive mortar constraints but this can be eliminated.

-Peter
Attachments
case.sif
Converging periodic BCs
(4.26 KiB) Downloaded 386 times
Post Reply