SFEMaNS  version 4.1 (work in progress)
Reference documentation for SFEMaNS
 All Classes Files Functions Variables Groups Pages
The function level_set_exact

It can be used by the function init_level_set to initialize the level set functions.

This functions defines a level set for one given interface, one given Fourier mode, one given component (cosine or sine) on a number of nodes, denoted nb_node, of the finite element mesh. We denote by level_set_mesh the finite element mesh used to approximate the level set.

Inputs and outputs

The inputs of this function are the following:

  1. interface_nb is the label of the interface considered. It is an integer between one and the number of fluids minus one.
  2. TYPE is the component of the level set is computed (cosine or sine). It is an integer between one and two.
  3. rr is a real valued tabular that contains two columns with dimensions (2,nb_node). The tabular rr(1,:) contains the radial cylindrical coordinate of each nodes considered. Respectively, rr(2,:) contains the vertical coordinates of these nodes. We note that the integer nb_node is generally equal to the total number of node level_set_mesh%np.
  4. m is the Fourier mode \(m\) considered. It is an integer.
  5. t is the time at which this term is computed. It is a real number.

The output of this function is a real valued tabular vv of dimension SIZE(rr,2).

Exemple

Here is an exemple where we consider a problem with one level set (so two fluids). The initial interface is \(z=1\). We define a level set \(\varphi\) that depends of the vertical coordinates as follows:

\begin{align} \varphi(z)= \frac{1}{2}(1+\tanh(\frac{z-1}{0.05})). \end{align}

One can note that \(\varphi\) is close to zero for z smaller than 0.9, close to one for z larger than 1.1 and equal to 0.5 for z equal to 1.

The corresponding code lines are written as follows.

IF (interface_nb==1) THEN
IF (TYPE==1.AND.m==0) THEN
vv = 0.5d0*(1.d0+TANH((z-1.d0)/0.05d0))
ELSE
vv = 0.d0
END IF
ELSE
CALL error_petsc('problem in level_set_exact: there is more than one level set')
END IF
RETURN

We refer to the sections Examples with manufactured solutions and Examples on physical problems for more examples.