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

It is used to define the source term \(f_\varphi\) of the level set equations. We refer to the section Extension to multiphase flow problem for more information on the formulation of the Navier-Stokes equations in SFEMaNS for multiphase problem. We remind there is one source term per level set.

This function defines the source term for one given interface, one given Fourier mode, one given component (cosine or sine) on all the nodes 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. TYPE is the component of the source term that is computed (cosine or sine). It is an integer between one and two.
  2. rr is a real valued tabular that contains two columns with dimensions (2,level-set_mesh%np). The tabular rr(1,:) contains the radial cylindrical coordinate of all the nodes of the finite element mesh level_set_mesh. Respectively, rr(2,:) contains the vertical coordinates of these nodes.
  3. m is the Fourier mode \(m\) considered. It is an integer.
  4. interface_nb is the number of the interface considered. It is an integer.
  5. t is the time at which the source term is computed. It is a real number.

The output of this function is a real valued tabular vv of dimension SIZE(rr,2) which is equal to the number of nodes in level_set_mesh.


  1. For physical applications, these source terms should be set to zero. Indeed the transport of the interface by the velocity is an advection equation. So it does not involve source term.
  2. This function has been added to consider manufactured solutions that are not solution of the advection equation.


Here is an exemple where the source term is set to zero.

vv = 0.d0

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