[Getdp] Global quantities when using axisymmetric coordinates

Tobias Nähring i_inbox at tn-home.de
Fri Aug 31 08:37:04 CEST 2007


Dear Mr. Geuzaine,

I think my first mail got lost (It does not appear in the mailing list.)
So I have a second try...

First of all: Thank you for the wonderful tool GetDP! It has already
served me well in Magnetics.

I've got a question about the usage of global quantities in connection
with the axisymmetric coordinates.

With the help of the problem definition below I've computed the flux
of the homogeneous solution of the Laplacian in

(1) a circular cylinder with radius 1 and length 1, with essential boundary
    conditions at the top (v = 1) and the bottom (v = 0) and natural 
boundary conditions on the
    cylinder surface
(2) a square with side length 1 and essential boundary conditions at
    two opposite sides (v = 1) and (v = 0) and natural boundary 
conditions on the other
    two sides

For the square the flux is 1.0 as expected.

For the cylinder I've expected a flux of pi but I get 1/2.
To explore the dependency on the radius I've enlarged the radius to
2. Then I get a flux of 2. That indicates that the flux is
proportional to the area of the bottom surface (as expected).

Am I really only missing a factor 2*pi here?
That means: can I also rely on the factor 2*pi for the flux if I use more
complicated axisymmetric geometries?

Thank you very much in advance for some answer.

With best regards,
Tobias Naehring

/**********************************************************************
  File:        homogen.geo
  Author:    Tobias Nähring
  Date:        07-08-25

  Test of global quantities with Sur- or VolAxi-Integration method.
 */

R=1; //< Radius of the cylinder.
// R=2; //< For checking the dependency on the radius.
d = 1.0; //< Distance of the plates.


veryFine = 0.01;
fine = 0.1;
coarse = 1;

Point(1) = {0,0,0,fine};
Point(2) = {R,0,0,fine};
Point(3) = {R,d,0,fine};
Point(4) = {0,d,0,fine};

For i In {1:3}
  Line(i) = {i,i+1};
EndFor

Line(4) = {4,1};

Line Loop (5) = {1:4};

Plane Surface (6) = {5};

Physical Surface (1) = {6};

Physical Line(2) = {1};
Physical Line(3) = {3};

// End of file homogen.geo
//////////////////////////////////////////////////////////////////////

/*
  File:        homogen.pro
  Author:    Tobias Nähring
  Date:        07-08-25

  Homogeneous solution of the Laplacian.
  Two similar problems solved with the same pro-file:
  (1) Circular cylinder with boundary conditions at the top and the bottom
  (2) Rectangular 2D-domain with boundary conditions at two opposite 
boundary lines.

  The boundaries are named bd and bdGnd.
  */

Group {
    dom = Region[1];
    bdGnd = Region[2];
    bd = Region[3];
}

Constraint {
    {
        Name Bc; Type Assign;
        Case
            {
                { Region bd; Value 0.0; }
            }
    }
    {
        Name BcGnd; Type Assign;
        Case
            {
                { Region bdGnd; Value 1.0; } // We need potential 1 on 
ground for the flux computation.
            }
    }
}

FunctionSpace {
    {
        Name funSp;  Type Form0;
        BasisFunction {
            {
                Name bf;
                NameOfCoef v;
                Function BF_Node;
                Support dom;
                Entity NodesOf[All, Not bdGnd];
            }
            {
                /* I thought I read somewbere in the documentation that 
I could also use the name bf here.
                   But that gives wrong results.
                 */
                Name bfGnd;
                NameOfCoef vGnd;
                Function BF_GroupOfNodes;
                Support dom;
                Entity GroupsOfNodesOf[bdGnd];
            }
        }
        GlobalQuantity {
            {
                Name vGlobGnd;
                Type AliasOf;
                NameOfCoef vGnd;
            }
            {
                Name fluxGlobGnd;
                Type AssociatedWith;
                NameOfCoef vGnd;
            }
        }
        Constraint {
            {
                NameOfCoef v;
                EntityType NodesOf;
                NameOfConstraint Bc;
            }
            {
                NameOfCoef vGlobGnd;
                EntityType GroupsOfNodesOf;
                NameOfConstraint BcGnd;
            }

        }
    }
}

// Standard choice from the documentation:
Integration {
    {
        Name Int_1;
        Case {
            {
                Type Gauss;
                    Case
                        {
                            { GeoElement Point       ; NumberOfPoints  1 ; }
                            { GeoElement Line        ; NumberOfPoints  3 ; }
                            { GeoElement Triangle    ; NumberOfPoints  4 ; }
                            { GeoElement Quadrangle  ; NumberOfPoints  4 ; }
                            { GeoElement Tetrahedron ; NumberOfPoints  4 ; }
                            { GeoElement Hexahedron  ; NumberOfPoints  6 ; }
                            { GeoElement Prism       ; NumberOfPoints  6 
; }
                        }
            }
        }
    }
}

Jacobian
{
    {
        Name Jac;
        /*
          Choose here between the circular cylinder and the
          rectangular 2D-domain:
         */
        // Case {{Region All; Jacobian Sur;}}
        Case {{Region All; Jacobian VolAxi;}}
    }
}

Formulation {
    {
        Name form; Type FemEquation;
        Quantity {
            {
                Name v; Type Local;
                NameOfSpace funSp;
            }
            {
                Name vGlobGnd; Type Global;
                NameOfSpace funSp[vGlobGnd];
            }
            {
                Name fluxGlobGnd; Type Global;
                NameOfSpace funSp[fluxGlobGnd];
            }
        }
        Equation
            {
                Galerkin
                    {
                        [ Dof{Grad v} , {Grad v} ];
                        In dom;
                        Jacobian Jac;
                        Integration Int_1;
                    }
                GlobalTerm
                    {
                        [-Dof{fluxGlobGnd}, {vGlobGnd}];
                        In bdGnd;
                    }
            }
    }
}

Resolution
{
    {
        Name runSolver;
        System
            {
                {Name sys; NameOfFormulation form;}
            }
        Operation
            { Generate[sys]; Solve[sys]; SaveSolution[sys];}
    }
}

PostProcessing
{
    // The first one is just for verification of the homogeneous field:
    {
        Name postProPotField; NameOfFormulation form;
        Quantity
            {
                {Name v; Value {Local { [{v}]; In dom; Jacobian Jac; }}}
            }
    }
    // THIS IS THE INTERESTING ONE:
    {
        Name postProResistance; NameOfFormulation form;
        Quantity
            {
                {Name resistance; Value {Term {[{fluxGlobGnd}]; In 
bdGnd; }}}
            }
    }
}

PostOperation {
    // The first one is just for checking:
    {
        Name postOpGmsh;
        NameOfPostProcessing postProPotField;
        Operation
            {
                Print[ v, OnElementsOf dom, File "cylPlane.pos" ];
            }
    }
    // THIS IS THE INTERESTING ONE:
    {
        Name postOpResistance;
        NameOfPostProcessing postProResistance;
        Operation
            {
                Print[ resistance, OnRegion bdGnd, Format Table, File 
"homogen.pos" ];
            }
    }
}
// End of file homogen.pro
//////////////////////////////////////////////////////////////////////