Basilisk CFD
Adaptive Cartesian mesh PDE framework
Loading...
Searching...
No Matches
iforce.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void event_defaults (void)
 Interfacial forces are a source term in the right-hand-side of the evolution equation for the velocity of the centered Navier–Stokes solver i.e.
 
void event_acceleration (void)
 The calculation of the acceleration is done by this event, overloaded from its definition in the centered Navier–Stokes solver.
 

Variables

 attribute
 

Function Documentation

◆ event_acceleration()

void event_acceleration ( void  )

The calculation of the acceleration is done by this event, overloaded from its definition in the centered Navier–Stokes solver.

Event: acceleration (i++)

We check for all VOF interfaces for which \(\phi\) is allocated. The corresponding volume fraction fields will be stored in list.

To avoid undeterminations due to round-off errors, we remove values of the volume fraction larger than one or smaller than zero.

On trees we need to make sure that the volume fraction gradient is computed exactly like the pressure gradient. This is necessary to ensure well-balancing of the pressure gradient and interfacial force term. To do so, we apply the same prolongation to the volume fraction field as applied to the pressure field.

Finally, for each interface for which \(\phi\) is allocated, we compute the interfacial force acceleration

\[ \phi\mathbf{n}\delta_s/\rho \approx \alpha\phi\nabla f \]

We need to compute the potential phif on the face, using its values at the center of the cell. If both potentials are defined, we take the average, otherwise we take a single value. If all fails we set the potential to zero: this should happen only because of very pathological cases e.g. weird boundary conditions for the volume fraction.

On trees, we need to restore the prolongation values for the volume fraction field.

Finally we free the potential fields and the list of volume fractions.

Definition at line 49 of file iforce.h.

References _i, a, alpha, clamp(), f, fm, fraction_refine(), free(), scalar::i, list, list_add(), nodata, p, phi, SEPS, set_prolongation(), vector::x, and x.

Here is the call graph for this function:

◆ event_defaults()

void event_defaults ( void  )

Interfacial forces are a source term in the right-hand-side of the evolution equation for the velocity of the centered Navier–Stokes solver i.e.

Event: defaults (i = 0)

it is an acceleration. If necessary, we allocate a new vector field to store it.

Event: defaults (i = 0)

The default density field is set to unity (times the metric).

We reset the multigrid parameters to their default values.

If the viscosity is non-zero, we need to allocate the face-centered viscosity field.

We also initialize the list of tracers to be advected with the VOF function \(f\) (or its complementary function).

We set limiting.

On trees, we ensure that limiting is also applied to prolongation and refinement.

We add the interface and the density to the default display.

We switch to a pure minmod limiter by default for increased robustness.

With the MUSCL scheme we use the CFL depends on the dimension of the problem.

On trees we need to replace the default bilinear refinement/prolongation with linear so that reconstructed values also use slope limiting.

The restriction/refine attributes of the charge density are those of a tracer otherwise the conservation is not guaranteed.

By default the permittivity is unity and other quantities are zero.

Definition at line 33 of file iforce.h.

References _i, a, vector::x, and x.

Variable Documentation

◆ attribute

attribute
Initial value:
{
scalar phi[]
The electric potential and the volume charge density are scalars while the permittivity and conductiv...
Definition implicit.h:34

Interfacial forces

We assume that the interfacial acceleration can be expressed as

\[ \phi\mathbf{n}\delta_s/\rho \]

with \(\mathbf{n}\) the interface normal, \(\delta_s\) the interface Dirac function, \(\rho\) the density and \(\phi\) a generic scalar field. Using a CSF/Peskin-like approximation, this can be expressed as

\[ \phi\nabla f/\rho \]

with \(f\) the volume fraction field describing the interface.

The interfacial force potential \(\phi\) is associated to each VOF tracer. This is done easily by adding the following field attributes.

Definition at line 22 of file iforce.h.