[Getdp] Problems with mixed periodic and Dirichlet boundary conditions
de Rosny Julien
julien.derosny at espci.fr
Thu Nov 26 16:47:00 CET 2015
Hello,
I would like to simulate the wave propagation inside a waveguide with a
periodic structure inside it.
I simplified the problem with the simulation of the homogeneous
Helmholtz equ. with Dirichlet boundary conditions on the top & bottom
and periodic on the left and right.
To that end, I set the following constrains :
Constraint{
{ Name CL;
Case{
// periodic BND cond. between TOP & Bottom
{Region L1 ;
Type LinkCplx ; RegionRef L3;
Coefficient Complex[1,0];
Function Vector[$X,$Y+Sqrt[2],$Z] ;
}
// periodic BND cond. between left & right
// {Region L4 ;
// Type LinkCplx ; RegionRef L2;
// Coefficient Complex[1,0];
// Function Vector[$X+1,$Y,$Z] ;
// }
//{ Region L1; Type Assign; Value 000. ;}
// { Region L3; Value 000. ;}
// Dirichelt BND condition on the bottom and top
{ Region L2; Type Assign; Value 0000. ;}
{ Region L4; Type Assign; Value 0000. ;}
}
}
}
But it gives wrong results (not periodic on top/bottom and not null on
left/right borders). See attached files.
The code works well if now I only use Dirichlet or periodic boundary
constrains for the 4 sides.
Any idea what is wrong?
Thanks.
Regards.
Julien de Rosny
--
Julien de Rosny
Directeur de recherche CNRS
Institut Langevin -UMR 7587
ESPCI - CNRS
1 rue Jussieu
75231 Paris Cedex 05
tel : +33 1 180963052
-------------- next part --------------
Group{
S = Region[100]; //rectangle
L1= Region[{103}]; // bottom bnd
L2= Region[{104}]; //right bnd
L3= Region[{105}]; //top bnd
L4= Region[{106}]; // left bnd
Domain=Region[{S,L1,L2,L3,L4}];
DPEC=Region[{L1,L3}];
}
Constraint{
{ Name CL;
Case{
// periodic BND cond. between TOP & Bottom
{Region L1 ;
Type LinkCplx ; RegionRef L3;
Coefficient Complex[1,0];
Function Vector[$X,$Y+Sqrt[2],$Z] ;
}
// periodic BND cond. between left & right
// {Region L4 ;
// Type LinkCplx ; RegionRef L2;
// Coefficient Complex[1,0];
// Function Vector[$X+1,$Y,$Z] ;
// }
//{ Region L1; Type Assign; Value 000. ;}
// { Region L3; Value 000. ;}
// Dirichelt BND condition on the bottom and top
{ Region L2; Type Assign; Value 0000. ;}
{ Region L4; Type Assign; Value 0000. ;}
}
}
}
// =========
// JACOBIAN
// =========
Jacobian {
{ Name JVol ; Case { { Region All ; Jacobian Vol ; } } }
{ Name JSur ; Case { { Region All ; Jacobian Sur ; } } }
}
// ======================
// INTEGRATION PARAMETERS
// ======================
Integration {
{ Name I1 ;
Case {
{ Type Gauss ;
Case {
{ GeoElement Point ; NumberOfPoints 1 ; }
{ GeoElement Line ; NumberOfPoints 4 ; }
{ GeoElement Triangle ; NumberOfPoints 6 ; }
{ GeoElement Quadrangle ; NumberOfPoints 7 ; }
{ GeoElement Tetrahedron ; NumberOfPoints 15 ; }
{ GeoElement Hexahedron ; NumberOfPoints 34 ; }
}
}
}
}
}
// ==============
// FUNCTION SPACE
// ==============
FunctionSpace{
{Name H_grad; Type Form0;
BasisFunction{
{Name uuuuu; NameOfCoef ui; Function BF_Node;
Support Domain;Entity NodesOf[All];}
}
Constraint {
{ NameOfCoef ui; EntityType EdgesOf ; NameOfConstraint CL; }
}
}
}//End FunctionSpace
// ============
// FORMULATIONS
// ============
Formulation {
// Formulation for a Dirichlet boundary condition
{ Name Helmholtz; Type FemEquation;
Quantity{
{ Name u ; Type Local; NameOfSpace H_grad;}
}
Equation{
//Helmholtz equation
Galerkin{[Dof{Grad u}, {Grad u}];
In S; Jacobian JVol; Integration I1;}
Galerkin{DtDtDof[Dof{u}, {u}];
In S; Jacobian JVol; Integration I1;}
}
}
}//End Formulation
Resolution{
{Name Scattering;
System{ {Name A; NameOfFormulation Helmholtz; Type Complex; } }
Operation{
GenerateSeparate[A];
EigenSolve[A, 10, .1, 0,$EigenvalueReal > 0];
SaveSolutions[A] ;
}
}
} // End Resolution
PostProcessing{
{Name Wave; NameOfFormulation Helmholtz;
Quantity {
{Name u; Value {Local { [{u}] ; In S; Jacobian JVol; }}}
} // End Postprocessing.
}}
PostOperation{
{Name Wave; NameOfPostProcessing Wave ;
Operation {
Print [u, OnElementsOf Domain, File "u.pos"];
}
}
} // End PostOperation
-------------- next part --------------
lc=0.01;
Lx=1/2;
Ly=1/2*Sqrt[2];
Point(1) = {-Lx,-Ly,0,lc};
Point(2) = {+Lx,-Ly,0,lc};
Point(3) = {+Lx,+Ly,0,lc};
Point(4) = {-Lx,+Ly,0,lc};
Line(1) = {1,2};
Line(2) = {2,3};
Line(3) = {3,4};
Line(4) = {4,1};
Line Loop(5) ={1,2,3,4};
Plane Surface(6)= {5};
Physical Surface(100)={6};
Physical Line(103)={1};
Physical Line(104)={2};
Physical Line(105)={-3};
Physical Line(106)={-4};