Symmetric coordinates and User defined Solvers

Numerical methods and mathematical models of Elmer
Post Reply
Franz Pichler
Posts: 196
Joined: 29 Sep 2011, 12:25
Antispam: Yes

Symmetric coordinates and User defined Solvers

Post by Franz Pichler »

Hello everybody,

I have a question regarding axi symmetricproblems.

When i activate the "axisymmetric" coordinates in the sif file what else do i have to care of in my solver.
Thinking of simple diffusion for example.
Somehow i thought sll the information is enclosed in the integration points and elements but know i found the following section in the statcurrentsolver:

Code: Select all

!------------------------------------------------------------------------------
!      Coordinatesystem dependent info
!------------------------------------------------------------------------------
          stat = ElementInfo( Element, Nodes,ug,vg,wg, &
               SqrtElementMetric,Basis,dBasisdx )

          s = 1
          IF ( CurrentCoordinateSystem() /= Cartesian ) THEN
             x = SUM( Nodes % x(1:n)*Basis(1:n) )
             y = SUM( Nodes % y(1:n)*Basis(1:n) )
             z = SUM( Nodes % z(1:n)*Basis(1:n) )
             s = 2*PI
          END IF

          CALL CoordinateSystemInfo( Metric,SqrtMetric,Symb,dSymb,x,y,z )

          s = s * SqrtMetric * SqrtElementMetric * S_Integ(tg)

Does this mean i have to add a block like that to my solver?
or does

Code: Select all

      stat = ElementInfo( Element, Nodes, IP % U(t), IP % V(t), &
       IP % W(t), detJ, Basis, dBasisdx )

s = IP % s(t) * DetJ
do the same trick?

More generally is there anything i have to change in my solver if i would like to switch to an axis symmetric problem?

best regards

Franz
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Symmetric coordinates and User defined Solvers

Post by raback »

Hi Franz,

The coordinate system is not automatically dealt with. The problem is that the operators are different in different coordinate systems.

There are basically two ways to do this:
1) Deal with the cartesian and non-cartesian (often limited just to axisymmetric) separately. The cartesian coordinate system is the simplest one and easier to implement.
2) Deal with all coordinate systems at the same time. Then you have to involve the metric tensor as done in the code sniplet. This may be more tedious to implement since most people are not so confortable with metric tensors and the formulations that use them. Therefore you will see the approach 1) taken more frequently. It is also faster than to be prepared for all different coordinate systems.

In axisymmetric coordinate system the 2*PI is basically not needed since both sides of a PDE may be divided by that. However, if we need quantities like surface charge then they will be 2*PI off if this is not considered.

If you want to extend your solver that already works for cartesian cases to axisymmetric ones it may be easiest to just consider the axsiymmetric case and study how the operator changes there. See, for example,
http://en.wikipedia.org/wiki/Del_in_cyl ... oordinates

-Peter
Franz Pichler
Posts: 196
Joined: 29 Sep 2011, 12:25
Antispam: Yes

Re: Symmetric coordinates and User defined Solvers

Post by Franz Pichler »

Hello Peter,

Thanks for the answer.

Okay so as i understand the metric information gathered by "CALL CoordinateSystemInfo( Metric,SqrtMetric,Symb,dSymb,x,y,z )" is taken care of the coordinate trasnformation for cylindrical coordinates

so for example simple diffusion in cartesian coordinates: (nabla dot(kappa nabla T)=f) where kappa is heat conductivity
trasnformed to cylindrical coordinates with axisymmetric assumption is : (1/r * nabla dot(r * kappa nabla T)=f)

in weak formulation
int (kappa nabla T nabla psi) =int(f*psi ) + boundaryint( FLUX*psi) <= cartesian
int (r* kappa nabla T nabla psi) =int(r*f*psi ) + boundaryint( r*FLUX*psi) <=cylindrical

if i use the metric information from above in my axisymmetric case:

1) is the "r" businiess dealt with?
2) do i have to recalculate my conductivity by factor 2*pi*r or something like that?

sorry for the formulas,there is no latex in such a forum right?

best regards

Franz Pichler
Post Reply