# GfsMetric

### From Gerris

GfsMetric is used to define an orthogonal curvilinear coordinate system and its associated metric.

The syntax is:

[ GfsVariable ] { x = f(rx,ry,rz) y = g(rx,ry,rz) }

where `(x,y)`

are the coordinates in physical space and `(rx,ry,rz)`

are the coordinates in computational space.

Note that it is up to the user to specify transformations which guarantee the orthogonality of the coordinate system (for example using conformal mapping).

Once this metric is defined, all coordinates (e.g. references to `(x,y)`

in functions etc...) are defined in physical space. The computational space coordinates can still be accessed using `(rx,ry,rz)`

.

On the other hand, the components of vector quantities (such as velocity `(U,V)`

) are defined using the normalised basis of the computational space. This convention matches that used for standard non-Cartesian coordinate systems. For example, the Navier-Stokes equation in cylindrical coordinates are usually written in terms of the radial and tangential velocity components (i.e. using the basis of the computational domain) and the tangential velocity component also has dimension of a linear velocity (i.e. length per unit of time) and not that of an angular velocity (i.e. angle per unit of time).

### Examples

Metric M { x = tanh(4.*rx)/tanh(4./2.)/2. y = tanh(4.*ry)/tanh(4./2.)/2. }

`
`

`
`

Metric M { y = tanh(4.*ry)/tanh(4./2.)/2. }

`
`

`
`

Metric M { x = 10.*sinh(rx/2. + 1.)/(cosh(rx/2. + 1.) - cos (M_PI*ry/4.)) y = 10.*sin(M_PI*ry/4.)/(cosh(rx/2. + 1.) - cos (M_PI*ry/4.)) }

`
`

`
`

Metric M { x = (rx/4. + 0.375)*cos(ry) y = (rx/4. + 0.375)*sin(ry) }

`
`

`
`

Metric M { x = sinh(rx/2. + 1.)/(cosh(rx/2. + 1.) - cos (M_PI*ry/4.)) y = sin(M_PI*ry/4.)/(cosh(rx/2. + 1.) - cos (M_PI*ry/4.)) }

`
`