## Periodic BC Rotate

Numerical methods and mathematical models of Elmer
denis.cohen
Posts: 55
Joined: 15 Dec 2010, 13:50

### Periodic BC Rotate

Hi,
I have this geometry (see image) and need to enforce a periodic boundary (between inlet and outlet). There is a 30 degrees rotation along the z axis (vertical, out of image) to bring the inlet back onto the outlet. The problem is 3d.
How do I enforce this poeriodic bc in my sif files? what I tried did not work. Here is my attempt:

Code: Select all

``````! Periodic BC
Boundary Condition 4
Name = "ice outlet"
Target Boundaries = 5
Periodic BC = 6
Periodic BC Rotate(3) = Real 0.0 0.0 -30
Periodic BC Velocity 1  = Logical True
Periodic BC Velocity 2  = Logical True
Periodic BC Velocity 3  = Logical True
Periodic BC Pressure  = Logical True

End

! Periodic BC
Boundary Condition 6
Name = "ice inlet"
Target Boundaries = 3
End
``````
I have tried rad and degrees.

Any help?

Thanks

Denis
Attachments
geom_annotated.png

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

### Re: Periodic BC Rotate

Hi

It should be degrees as you suggest. What might be the problem is that your conditions ensure periodicity for components. However, when the rotation is 30 degs the components are not periodic one-by-one. Instead you also have to rotate the direction of the velocity vector also by 30 degs. To do that you could try to use the "Normal-Tangential Velocity = Logical True". This will ensure that you switch to a coordinate system where the periodicity of the vectors are also true component-wise. It may be that they actually become antiperiodic since the local coordinate system is may have normals pointing in the oppositive directions...

-Peter

denis.cohen
Posts: 55
Joined: 15 Dec 2010, 13:50

### Re: Periodic BC Rotate

Hi Peter,

Thanks for the tip. It now works.
However, in this 3d problem, there are issues at the edges of the different boundaries.
The velocity is not enforced properly (see attachment with views of velocity vectors).
This gives some not very physical values of velocities at edges and corners.
How can I resolve that?

I attach my sif file.

Thanks

Denis
Attachments
screenshot.png
nocav.sif

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

### Re: Periodic BC Rotate

Hi

The different BCs are conflicting which makes the elimination process tricky.

You could try to use Lagrange Coefficients rather than elimination by setting in the BC section

Code: Select all

``````Periodic BC Use Lagrange Coefficient = Logical True
``````
-Peter

denis.cohen
Posts: 55
Joined: 15 Dec 2010, 13:50

### Re: Periodic BC Rotate

Hi Peter,

Periodic BC Use Lagrange Coefficient = Logical True

and the code crashed with this:

Code: Select all

``````FlowSolve: -------------------------------------
FlowSolve:  NAVIER-STOKES ITERATION           1
FlowSolve: -------------------------------------
FlowSolve:
FlowSolve: Starting Assembly...
FlowSolve: Assembly:
: ...Saving bulk values for: navier-stokes
FlowSolve: Assembly done
SlidCoef_Contact: GL may move by default
SlidCoef_Contact: If you want to fix the Grounding Line, put the keyword "Grounding line moves" to False
SlidCoef_Contact: far inland nodes have the possibility to detach by default
SlidCoef_Contact: to avoid detachment (when bedrock is well below sea level),
SlidCoef_Contact: use the keyword "non detachment inland distance" to the distance you wish
SlidCoef_Contact: This works with the DistanceSolver
Flow Solution                                                                                                                    F
DefUtils::DefaultDirichletBCs: Setting Dirichlet boundary conditions
DefUtils::DefaultDirichletBCs: Dirichlet boundary conditions set
FlowSolve: Dirichlet conditions done
SolveWithLinearRestriction:
ListToCRSMatrix: Number of entries in coupled matrix:  3905648
ListToCRSMatrix: Matrix format changed from List to CRS
SolveWithLinearRestriction: CollectionMatrix done
SolveWithLinearRestriction: CollectionVector done
ComputeChange:  Computed Norm:                       NaN
ERROR:: ComputeChange: Norm of solution exceeded given bounds
``````
Is there another solution?

Denis

Vaclav
Posts: 4
Joined: 09 Oct 2015, 14:31
Antispam: Yes
Location: Czech Republic

### Re: Periodic BC Rotate

Dear All,
before all, thanks to the development team of Elmer for this amazing software.
I am playing with it about one month and I am not so much experienced in structural
analysis. I am primarily focused on CFD.

I am working on modal analysis of a ventilator. Since it is periodic, I am working only on a part of it,
as can be seen on attached pictures. The periodic boundaries are colored as red.
ventilator.png (249.29 KiB) Viewed 3827 times
I encountered the following problem with periodic BC's on account of rotation.
Maybe I just interpret the results wrong way. The problem is that the results show the discontinuous
fields of displacement. Consequently, if I want to display the two or more periodic parts side by side,
the adjacent part are not connected (see the attached picture for "displacement mode 3").
displacementmode3.png (117.06 KiB) Viewed 3827 times
I tried the setups found in examples and the tips here on forum, but I did not succeed.

Is there anything that I missed, or do I interpret the results wrong?

Vaclav

My *.sif file looks like:
caseModal.sif
I am using Elmer 7.0

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

### Re: Periodic BC Rotate

Hi

You have very nice looking mesh.

The displacement field may be periodic but it is not periodic componentwise. Hence in order to account for periodicity for vector field you should work with normal-tangential coordinate system on the boundaries - as you intended. As the normal points in opposing directions this might in fact make it anti-periodic.

The periodic BCs utilizes node-to-surface mapping which is not optimal. You could have better accuracy with surface-to-surface mapping (aka mortar finite elements). The you could use perhaps the "radial projector" mapping which first sets the nodes to (r,z) plane and then creates a mapping matrix. It assumes rotation around z-axis but perhaps you have that anyways. Grep for some examples among the tests using "radial projector" as keyword.

I would recommend using fresh Elmer since bug reports from such an old version are not considered as they may have been corrected since.

-Peter

Vaclav
Posts: 4
Joined: 09 Oct 2015, 14:31
Antispam: Yes
Location: Czech Republic

### Re: Periodic BC Rotate

Hi guys,

before all thank to Peter for his previous answer. The use of mortar BCs helped , but only partially . The eigen analysis always ended with:

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
Backtrace for this error:
#0 0x7FBCECC2D407
#1 0x7FBCECC2DA1E"
etc ... etc ...

First, I solved the case as posted above only for displacement, stress, strain etc. I tried direct solvers, iterative solvers. Also I tried different meshes, different angle velocities of ventilator, serial or parallel computation, different mpi environment, and I always achieved results that in my opinion made sense. Amazing! Example here:
displacement01.png (95.5 KiB) Viewed 3753 times
But I was never able to achieve any results for eigen analysis when the mortar conditions were applied. I tried it the whole last 14 days with different setups of case.
For any solver, any mesh, any mortar bc setups, it always ended with this:

SolveWithLinearRestriction: CollectionMatrix done
SolveWithLinearRestriction: CollectionVector done
SolveWithLinearRestriction: Now going for the coupled linear system
EigenSolve: Arpack reverse communication calls: 1

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0 0x7FBCECC2D407
#1 0x7FBCECC2DA1E
#2 0x7FBCEB88417F
#3 0x7FBCF0A7DF25
#4 0x7FBCF0B67F44
#5 0x7FBCF0AE1CFC
#6 0x7FBCF0B2B2F1
#7 0x7FBCF0B21DF1
#8 0x7FBCF0B27119
#9 0x7FBCF0C49693
#10 0x7FBCD968A39E
#11 0x7FBCF0B341D6
#12 0x7FBCF0B449BE
#13 0x7FBCF0B45A9C
#14 0x7FBCF0B48468
#15 0x7FBCF0CCB98F
#16 0x7FBCF0CD0907
#17 0x40129E in solver at Solver.F90:69

I would be very thankful for any advices, because right now I do not know what to change or try next. Yeah, I can still omit the periodicity
and prepare the whole mesh, but I hope it is the really last choice.
When the mortar conditions were off, the eigen analysis worked (but the case had no sense obviously, since the periodicity was off)
I am little bit thinking that maybe some library of Arpack must be preloaded as "export LD_PRELOAD="something",
but which one?

I am using latest Elmer on two computers under Debian 7.9 and Debian 8.1. I am getting the same problem on both computers.
When I run ctest after installation of Elmer, the 99 % - 100 % of test passed.

Thank you in advance for any hints,
Vaclav

The case is attached as "ventilator.tar.gz". The archive includes logs from various computation.
ventilator.tar.gz

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

### Re: Periodic BC Rotate

Hi Vaclav

This may be the 1st time that a combination of Mortar conditions and Eigen analysis is carried out simultaneously. Now it seems that the code does seem to make something sensible at the start as it 1st tries to build the constrained matrix.

However, already here things may go wrong since for eigen analysis you might also need to increase the size of the mass matrix (or deal with the fact that it is smaller than the consrained stiffness matrix). You see the eigen analysis requires both M and K while for other analysis types K already includes the time discretization and hence the linear system only includes K.

When you go to solve I would suspect that there could be still some problems later when collecting the results. There is no collection for the eigenvalues of the original system.

To conclude, it cannot work without some modifcations to the code. The modifications might not be so many but they do require some deeper insight how things currently work. Even after implementation the combined saddle-point & eigen-analysis problem could be tricky.

-Peter

Vaclav
Posts: 4
Joined: 09 Oct 2015, 14:31
Antispam: Yes
Location: Czech Republic

### Re: Periodic BC Rotate

Thank you, Peter, for clarification.

Vaclav