# VECFEM3 Reference Manual: equation

Type: format

## NAME

equation - data format for the definition of the functional equation for VECFEM.

## PURPOSE

In the data set equation the user defines the functional equation to be solved by VECFEM. Using the parameters defined in the resource file it is transformed into a FORTRAN source code for the solution of the problem, see vembuild. The equation may be steady or nonsteady.

In the case of a steady problem, the NK-valued solution u=(u<i>) is selected from a space H of smooth, NK-valued functions. The equation can be given in the formulation of a steady functional equation:

    [1] for all v in H with v(i)|D<i>=0 for all i=1,..,NK:

            F{u}(v)=0

        and for all i=1,...,NK : u<i>|D<i>=b<i>

or in the formulation of a steady variational equation

    [2]     F{u}=minimal

        over all u in H with u<i>|D<i>=b<i> for all i=1,..,NK.

In both cases the condition 'u<i>|D<i>=b<i> for all i=1,..,NK' is called the Dirichlet condition, where D<i> is a subset of the domain of u<i>. b<i> is a smooth function on D<i> which must not depend on the solution u. F is a real-valued functional which depends arbitrarily on the searched solution u in H and in the case [1] linearly on the NK-valued test function v=(v<i>) in H.

In the case of a nonsteady problem, the NK-valued solution u=(u<i>) depends on the time t, t0<=t<=tend, and for all t it is selected from a space H of smooth, NK-valued functions. The equation can be given in the formulation of a nonsteady functional equation:

    [3] for all v in H with v(i)|D<i>=0 for all i=1,..,NK:

            F{t,ut,u}(v)=0 for all t0<t<tend,

        for all i=1,...,NK : u<i>(t)|D<i>=b<i>(t)  for all t0<t<tend

        and for all i=1,...,NK : u<i>(t0)=u0<i>.

The condition 'u<i>(t)|D<i>=b<i>(t) for all i=1,..,NK' is called the Dirichlet condition, where D<i> is a subset of the domain of u<i>. For all t0<t<tend, b<i>(t) is a smooth function on D<i> which must not depend on the solution u. The condition 'u<i>(t0)=u0<i> for all i=1,..,\INK' is called the initial condition, where u0 is a given function in H. F is a real-valued functional which depends arbitrarily on the searched solution u in H, its derivative with respect to the time t and the time t itself, and linearly on the NK-valued test function v=(v<i>) in H.

## SYNOPSIS

The script for the definition of the functional equation has three sections. In the first section parameters are defined, in the second one the Dirichlet conditions are specified and in the third one the functional F is described. Lines starting with '#' are comment lines. Spaces are insignificant. Upper- and lower-case letters are equivalent.

Allowed expressions are real constants, reserved symbols, the parameters declared in the parameter section and operator evaluations. The following operators are available:

OPERATOR NAME | MEANING | REMARKS
<expr1> + <expr2> | sum |
<expr1> - <expr2> | difference |
<expr1> * <expr2> | product |
<expr1> / <expr2> | quotient |
<expr1> ^ <expr2> | power function |
sqrt(<expr1>) | square root |
max(<expr1>,<expr2>) | maximal value |
min(<expr1>,<expr2>) | minimal value |
abs(<expr1>) | absolute value function |
exp(<expr1>) | exponential function |
ln(<expr1>) | natural logarithm |
sin(<expr1>) | sine |
sinh(<expr1>) | hyperbolic sine |
arcsin(<expr1>) | inverse sine |
cos(<expr1>) | cosine |
cosh(<expr1>) | hyperbolic cosine |
arccos(<expr1>) | inverse cosine |
tan(<expr1>) | tangent |
tanh(<expr1>) | hyperbolic tangent |
arctan(<expr1>) | inverse tangent |

In this table <expr1> and <expr2> are allowed expressions. Reserved symbols and their meanings are given in the following table:

SYMBOL | MEANING
t | time t
x<j> | j-coordinate of location x
tau<j><k> | j-coordinate of k-th normalized area tangential direction
tau<j> | j-coordinate of normalized line tangential direction
u<i> | i-th component of solution u
ut<i> | derivative of i-th component of solution u with respect to t
u<i>x<j> | derivative of i-th component of solution u with respect to j-th space direction x<j>
ut<i>x<j> | derivative of i-th component of the t-derivative of solution u with respect to j-th space direction x<j>
u<i>tau<k> | derivative of i-th component of solution u with respect to k-th area tangential direction tau<.><k>
ut<i>tau<k> | derivative of i-th component of the t-derivative of solution u with respect to k-th area tangential direction tau<.><k>
u<i>tau | derivative of i-th component of solution u with respect to line tangential direction tau<.>
ut<i>tau | derivative of i-th component of the t-derivative of solution u with respect to line tangential direction tau<.>
v<i> | i-th component of test function v
v<i>x<j> | derivative of i-th component of test function v with respect to j-th space direction x<j>
v<i>tau<k> | derivative of i-th component of test function v with respect to k-th area tangential direction tau<.><k>
v<i>tau | derivative of i-th component of test function v with respect to line tangential direction tau<.>
prevalue | value set by the mesh generator

where i=1,...,NK, j=1,2,3 and k=1,2 ('<k>' means that <k> has to be replaced by the actual value of k). The rules of priority of operations and parentheses are the usual rules (e.g. in FORTRAN).

### parameter

A Set of parameters can be introduced (e.g. material constants). The statement

    <parameter>=<expr>

assigns the allowed expression <expr> to the parameter <parameter>. The name of the parameter may be a sequence of letters and digits starting with a letter. Reserved symbols and the function names must not be a substring of the declared parameter. The succession of the parameter declarations is free, but a recursive definition is not allowed. So for example the declaration of the first parameter can use the second parameter, but then the second parameter must not use the first parameter.

### Initial Values

The initial condition for component i (i=1,...NK) is prescribed by the statement

    u0<i>=<expr0>

where <expr0> is an allowed expression. After the insertion of the parameters the prescribed value for the initial condition must only depend on real constants, the available operators and the symbols x<i>. If there is no statement declaring a initial condition for component i, the statement 'u0<i>=0' is assumed. The initial solution is modified by VECFEM so that the Dirichlet conditions are fulfilled at the start time t0. In the case of steady problems, 'u0<i>=...' can be used to define an initial guess of the iteration solution algorithm.

### Dirichlet Conditions

The Dirichlet condition for component i (i=1,...NK) is prescribed by the statement

    u<i>=<exprd>

where <exprd> is an allowed expression. The support D<i> of the Dirichlet conditions is specified by the FEM mesh. After the insertion of the parameters the prescribed value for the Dirichlet conditions must only depend on real constants, the available operators and the symbols x<i>, t and prevalue, which is the real value assigned to component i by the FEM mesh. If there is no statement declaring a Dirichlet condition for component i, but the D<i> is nonvoid, the statement 'u<i>=0' is assumed.

### Functional Equations

The functional equations [1] and [3] are described by the statement:

    volume{<exprv>}+area{<expra>}+line{<exprl>}+point{<exprp>}=0

or for the variational problem [2]

    volume{<exprv>}+area{<expra>}+line{<exprl>}+point{<exprp>}=minimize

where <exprv> denotes the kernel of the volume integration, <expra> the kernel of the area integration, <exprl> the kernel of the line integration and <exprp> the terms of the sum over specified points.

For the 3-dimensional case DIM=3, the integration kernels <exprv>, <expra>, <exprl> and <exprp> are allowed expressions. After the insertion of the parameters, the kernels must only depend on real constants, the available operators and the following symbols:

SYMBOL | <exprv> | <expra> | <exprl> | <exprp>
x<j> | [1],[2],[3] | [1],[2],[3] | [1],[2],[3] | [1],[2],[3]
tau<j><k> | - | [1],[2],[3] | - | -
tau<j> | - | - | [1],[2],[3] | -
u<i> | [1],[2],[3] | [1],[2],[3] | [1],[2],[3] | [1],[2],[3]
ut<i> | [3] | [3] | [3] | [3]
u<i>x<j> | [1],[2],[3] | - | - | -
ut<i>x<j> | [3] | - | - | -
u<i>tau<k> | - | [1],[2],[3] | - | -
ut<i>tau<k> | - | [3] | - | -
u<i>tau | - | - | [1],[2],[3] | -
ut<i>tau | - | - | [3] | -
v<i> | [1],[3] | [1],[3] | [1],[3] | [1],[3]
v<i>x<j> | [1],[3] | - | - | -
v<i>tau<k> | - | [1],[3] | - | -
v<i>tau | - | - | [1],[3] | -

where [1] denotes an allowed dependency for the formulation [1], [2] an allowed dependency for the variational formulation [2] and [3] an allowed dependency for the variational formulation [3]. Symbols which are not listed must not be used for 3-dimensional problems in any case.

For the 2-dimensional case DIM=2, the integration kernels <expra>, <exprl> and <exprp> are allowed expressions. The volume integration is not allowed. After the insertion of the parameters, the kernels must only depend on real constants, the available operators and the following symbols:

SYMBOL | <expra> | <exprl> | <exprp>
x<j> | [1],[2],[3] | [1],[2],[3] | [1],[2],[3]
tau<j> | - | [1],[2] | -
u<i> | [1],[2],[3] | [1],[2],[3] | [1],[2],[3]
ut<i> | [3] | [3] | [3]
u<i>x<j> | [1],[2],[3] | - | -
ut<i>x<j> | [3] | - | -
ut<i>tau | - | [3] | -
v<i> | [1],[3] | [1],[3] | [1],[3]
v<i>x<j> | [1],[3] | - | -
v<i>tau | - | [1],[3] | -

where [1] denotes an allowed dependency for the formulation [1], [2] an allowed dependency for the variational formulation [2] and [3] an allowed dependency for the variational formulation [3]. Symbols which are not listed must not be used for 2-dimensional problems in any case.

For the 1-dimensional case DIM=1, the integration kernels <exprl> and <exprp> are allowed expressions. The volume and area integrations are not allowed. After the insertion of the parameters, the kernels must only depend on real constants, the available operators and the following symbols:

SYMBOL | <exprl> | <exprp>
x<j> | [1],[2],[3] | [1],[2],[3]
u<i> | [1],[2],[3] | [1],[2],[3]
ut<i> | [3] | [3]
u<i>x<j> | [1],[2],[3] | -
ut<i>x<j> | [3] | -
v<i> | [1],[3] | [1],[3]
v<i>x<j> | [1],[3] | -

where [1] denotes an allowed dependency for the formulation [1], [2] an allowed dependency for the variational formulation [2] and [3] an allowed dependency for the variational formulation [3]. Symbols which are not listed must not be used for 1-dimensional problems in any case.

## DISCRETIZATION

The domains of integration are specified by the elements in the finite element mesh, where only order two elements are allowed. The portions D<i> of the domain where the Dirichlet condition of component i has to be satisfied are specified by the list of the mesh nodes in D<i>. The hexahedrons, prisms and tetrahedron elements describe the domain of the volume integration, the triangle and quadrilateral elements the domain of the area integration and the line elements the domain of the line integration. The point elements (mostly these are the nodes where node forces are specified) give the points which are considered in sums over points. The mesh has to be continuous, i.e. if the elements used for the subdivision of the volume are reduced to the area, they are the elements for the subdivision of the area itself (analogously for the line elements and the point elements). If you use tangential derivatives you have to consider the following rules: The vector tau<.>1 points from the first node of the element to the second one and the vector tau<.>2 points from the first node of the element to the third one in the case of a triangle element and to the fourth one in the case of a quadrilateral element. The vector tau<.>, which is the tangential direction at the line, points from the first node of the element to the second one:

            line            quadrilateral             triangle

                           4------7------3         3
                           |             |         | \
                           |             |         |   \
                           | ^           |         | ^   \
                           8 |           6         6 |     5
                           | tau<.>2     |         | tau<.>2 \
                           | |           |         | |         \
         --tau<.>-->       | --tau<.>1-> |         | --tau<.>1-> \
       1------3------2     1------5------2         1-------4------2

## EXAMPLES

See also vemexamples. For the computation of a temperature distribution via the 2-dimensional Poisson equation the equation file has the following form, see vembuild. Here the variational form of the Poisson equation is used. The thermal conductivity will depend on the location:

    #
    #  chr=0 for x1<=1 and chr=1 x1>1
    #
     chr=1./(1.+exp(-100*(x1-1.))

    #
    #     / 900.          x1<=1.
    #  k=|         for           = thermal conductivity
    #     \   1.          x1>1.
    #
        k= chr * 900. + (1-chr) * 1.
    #
    #  no heat generation:
    #
        qb=0
    #
    #  convection boundary condition:
    #
        qs= (u1 - 20) ^ 2
    #
    #  the prescribed temperature is given by the input file:
    #
        u1=prevalue
    #
    #  and here is the variational problem:
    #
       volume { k/2 * ( u1x1^2 + u1x2^2 ) - qb*u1 } +
       area { qs/2 } = minimal

The second example is the time-dependent 3-dimensional Navier-Stokes equation, see vembuild. The components 1, 2 and 3 are the velocity and the fourth component is the pressure:

    #
    #   the Reynolds number:
    #
         Re=10.
    #
    #   the input and output profile is a parabolic profile :
    #
         u1=(1.-x1)*x1
         u2=0.
         u3=0.
         u4=1.
    #
    #   the initial solution :
    #
         u01=0.
         u02=0.
         u03=0.
         u04=1.
    #
        volume{
    #
    #        the first momentum equation
    #
         v1*u1t+v1x1*u1x1+v1x2*u1x2+v1x3*u1x3 +
                Re*v1*(u1*u1x1+u2*u1x2+u3*u1x3)+
                v1x1*u4 +
    #
    #        the second momentum equation
    #
         v2*u2t+v2x1*u2x1+ v2x2*u2x2+ v2x3*u2x3 +
                Re*v2*(u1*u2x1+u2*u2x2+u3*u2x3)+
                v2x2*u4 +
    #
    #        the third momentum equation
    #
         v3*u3t+v3x1*u3x1+ v3x2*u3x2+ v3x3*u3x3 +
                Re*v3*(u1*u3x1+u2*u3x2+u3*u3x3)+
                v3x3*u4 +
    #
    #        the equation of continuity
    #
                -v4*(u1x1+u2x2+u3x3)   }=0

## REFERENCES

[FAQ].

## SEE

VECFEM, vemexamples, xvem.

## COPYRIGHTS

Program by L. Grosz and S. Scheffrahn , 1994-1996. Copyrights by Universitaet Karlsruhe 1989-1996. All rights reserved. More details see VECFEM.

by L. Grosz, Auckland , 6. June, 2000.