Skip to content
Snippets Groups Projects
Commit 726809aa authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

Impose homogeneous Dirichlet condition on the top and right surfaces, instead...

Impose homogeneous Dirichlet condition on the top and right surfaces, instead of homogeneous Neumann. It's a bit more natural, amd it matches the small example in the getdp documentation.
parent 066e4c75
No related branches found
No related tags found
No related merge requests found
Pipeline #5495 passed
...@@ -35,12 +35,13 @@ ...@@ -35,12 +35,13 @@
(called "Electrode" below) and to 0 V on the ground. A homogeneous Neumann (called "Electrode" below) and to 0 V on the ground. A homogeneous Neumann
boundary condition (zero flux of the displacement field, i.e. n.d = 0) is boundary condition (zero flux of the displacement field, i.e. n.d = 0) is
imposed on the left boundary of the domain to account for the symmetry of the imposed on the left boundary of the domain to account for the symmetry of the
problem, as well as on the top and right boundaries that truncate the problem. The domain is truncated on the top and right with a homogeneous
simulation domain. */ Dirichlet boundary condition (v = 0), assumed to be imposed sufficiently far
away from the microstrip. */
Group { Group {
/* One starts by giving explicit meaningful names to the Physical regions /* One starts by giving explicit meaningful names to the Physical regions
defined in the "microstrip.msh" mesh file. This model comprises only defined in the "microstrip.msh" mesh file. This model comprises only
2 volume regions and 2 surface regions. */ 2 volume regions and 2 surface regions. */
Air = Region[101]; Air = Region[101];
...@@ -48,6 +49,7 @@ Group { ...@@ -48,6 +49,7 @@ Group {
Ground = Region[120]; Ground = Region[120];
Electrode = Region[121]; Electrode = Region[121];
SurfInf = Region[130];
/* We now define abstract regions to be used below in the definition of the /* We now define abstract regions to be used below in the definition of the
scalar electric potential formulation: scalar electric potential formulation:
...@@ -61,9 +63,9 @@ Group { ...@@ -61,9 +63,9 @@ Group {
Since there are no non-homogeneous Neumann conditions in this particular Since there are no non-homogeneous Neumann conditions in this particular
example, Sur_Neu_Ele is defined as empty. example, Sur_Neu_Ele is defined as empty.
Note that volume elements are those that correspond to the higher dimension Note that volume elements are those that correspond to the higher dimension
of the model at hand (2D elements here), surface elements correspond to the of the model at hand (2D elements here), surface elements correspond to the
higher dimension of the model minus one (1D elements here). higher dimension of the model minus one (1D elements here).
*/ */
...@@ -82,7 +84,7 @@ Function { ...@@ -82,7 +84,7 @@ Function {
} }
Constraint { Constraint {
/* The Dirichlet boundary condition is also defined piecewise. /* The Dirichlet boundary condition is also defined piecewise.
The constraint "Dirichlet_Ele" is invoked in the FunctionSpace The constraint "Dirichlet_Ele" is invoked in the FunctionSpace
below. */ below. */
...@@ -90,6 +92,7 @@ Constraint { ...@@ -90,6 +92,7 @@ Constraint {
Case { Case {
{ Region Ground; Value 0.; } { Region Ground; Value 0.; }
{ Region Electrode; Value 1.e-3; } { Region Electrode; Value 1.e-3; }
{ Region SurfInf; Value 0; }
} }
} }
} }
...@@ -131,7 +134,7 @@ FunctionSpace { ...@@ -131,7 +134,7 @@ FunctionSpace {
{ Name sn; NameOfCoef vn; Function BF_Node; { Name sn; NameOfCoef vn; Function BF_Node;
Support Dom_Hgrad_v_Ele; Entity NodesOf[ All ]; } Support Dom_Hgrad_v_Ele; Entity NodesOf[ All ]; }
// using "NodesOf[All]" instead of "NodesOf[Dom_Hgrad_v_Ele]" is an // using "NodesOf[All]" instead of "NodesOf[Dom_Hgrad_v_Ele]" is an
// optimization, which avoids explicitly building the list of // optimization, which avoids explicitly building the list of
// all the nodes // all the nodes
} }
Constraint { Constraint {
...@@ -234,7 +237,7 @@ Formulation { ...@@ -234,7 +237,7 @@ Formulation {
expressions than the second one. In our case it should be expressed in expressions than the second one. In our case it should be expressed in
terms of the FE expansion of "v" at the present system solution, i.e. when terms of the FE expansion of "v" at the present system solution, i.e. when
the coefficients vn_k in the expansion of "v = Sum_k vn_k sn_k" are the coefficients vn_k in the expansion of "v = Sum_k vn_k sn_k" are
unknown. This is indicated by prefixing the braces with "Dof" (degrees of unknown. This is indicated by prefixing the braces with "Dof" (degrees of
freedom), which leads to the following density: freedom), which leads to the following density:
[ epsilon[] * Dof{d v} , {d v} ], [ epsilon[] * Dof{d v} , {d v} ],
...@@ -252,7 +255,7 @@ Formulation { ...@@ -252,7 +255,7 @@ Formulation {
a so-called linear term that contributes to the right-hand side of the a so-called linear term that contributes to the right-hand side of the
linear system. linear system.
Both choices are commonly used in different contexts, and we shall often Both choices are commonly used in different contexts, and we shall often
come back in subsequent tutorials. */ come back in subsequent tutorials. */
{ Name Electrostatics_v; Type FemEquation; { Name Electrostatics_v; Type FemEquation;
...@@ -270,13 +273,13 @@ Formulation { ...@@ -270,13 +273,13 @@ Formulation {
Integral { [ nd[] , {v} ]; Integral { [ nd[] , {v} ];
In Sur_Neu_Ele; Jacobian Sur; Integration Int; } In Sur_Neu_Ele; Jacobian Sur; Integration Int; }
All the terms in the Equation environment are added, All the terms in the Equation environment are added,
and an implicit "= 0" is considered at the end. */ and an implicit "= 0" is considered at the end. */
} }
} }
} }
/* In the Resolution environment we specify what to do with a weak formulation: /* In the Resolution environment we specify what to do with a weak formulation:
here we simply generate a linear system, solve it and save the solution (.res file) here we simply generate a linear system, solve it and save the solution (.res file)
to disk. */ to disk. */
......
...@@ -85,11 +85,13 @@ Function { ...@@ -85,11 +85,13 @@ Function {
} }
Constraint { Constraint {
/* The Dirichlet boundary condition on the local electric potential is no /* The Dirichlet boundary condition on the local electric potential is only
longer used. The microstrip and the ground are herein treated as electrodes, used for the homogeneous condition on the top and right boundaries. The
whose voltage is imposed with the "SetGlobalPotential" constraint below. */ microstrip and the ground are now treated as electrodes, whose voltage is
imposed with the "SetGlobalPotential" constraint below. */
{ Name Dirichlet_Ele; Type Assign; { Name Dirichlet_Ele; Type Assign;
Case { Case {
{ Region SurfInf; Value 0; }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment