Interactive open-source fluid solver Aphros Explorer running in the web browser. The interactive version illustrates the full solver Aphros for scientific flow simulations.
The domain is filled by a mixture of two liquids with different densities and viscosities. Effects of gravity and surface tension are included. Many parameters can be changed dynamically. Various boundary conditions can be set on the edges of the domain or a solid body. Visualization and controls are parameterized through a plain text configuration.
The input configuration is defined using commands
[FROMSLIDER] set TYPE NAME VALUE
where TYPE is int, double, vect or string. Expressions $VAR_NAME and ${VAR_NAME} are expanded to the value of the variable VAR_NAME that must be already defined. Lines that depend on expansions of variables defined by sliders need to start with FROMSLIDER.
Examples:
set int i 0
set double d 1.5
set vect v 1 2 3
set string s text
set string s_m "
line1
line2 $s
"
set string sub $i $v $s
FROMSLIDER set vect gravity $g 0
intenable_embed (0, 1)enable_advection (0, 1)hypre_periodic_x, hypre_periodic_y (0, 1)sharpen (0, 1)steps_per_framestokes (0, 1)doublecfl, cfla, cflstcfl=0.8, cfla=0.8, and cflst=1
extentmu1, mu2rho1, rho2sigmaspawn_rvectforce0 0.
gravity0 0.
stringadvection_solver (vof, vofm)vof) and multilayer volume-of-fluid for coalescence prevention (vofm). Default is vof
bc_patheb_list_pathinit_vf, list_pathsliderstitleAphros Explorer.
visualprint_varsBase configuration file together with additional configuration list other available parameters and their default values.
The Apply button sends the input configuration to the solver. Changes of some parameters have an immediate effect (density, viscosity, surface tension, and gravity). Others will only be considered after the next restart (boundary conditions, shape of the solid body, initial fields, and choice of advection solver). To restart the simulation, click on any button that selects the mesh size (16, 32, 64, 128) including the one currently selected.
Mouse click on the canvas creates a circle of radius spawn_r filled with component 2.
Sliders are defined by parameter sliders and appear under the canvas.
Parameter visual defines a list of scalar fields to visualize.
set string visual "
FIELD {
set vect values VALUES
set vect colors COLORS
set vect opacities OPACITIES
}
...
"
Valid values of FIELD:
pressurevorticityembed fractionvolume fractionvelocity magnitudevelocity xx of velocity
velocity yy of velocity
Fields are rendered sequentially, with the colormap and opacities defined by
VALUES,COLORS,OPACITIES.Predefined colors that expand to RGB components, based on palette:
set string Cred 1 0.12 0.35
set string Cgreen 0 0.8 0.42
set string Cblue 0 0.6 0.87
set string Cpurple 0.686 0.345 0.729
set string Cyellow 1 0.776 0.118
set string Corange 0.949 0.522 0.133
set string Cwhite 1 1 1
set string Cblack 0 0 0
set string Cgray 0.627 0.694 0.729
Example with the x-component of velocity overlayed by the volume fraction:
set string visual "
velocity x {
set vect values -1 0 1
set vect colors $Cblue $Cwhite $Cred
}
volume fraction {
set vect values 0 1
set vect colors $Cgreen $Cgreen
set vect opacities 0 0.5
}
"
Primitives are used to specify initial and boundary conditions. Valid values of PRIMITIVE:
sphere CX CY 0 RX [RY=RX]CX,CY with principal semi-axes RX,RY
box CX CY 0 RX [RY=RX]CX,CY with half-size RX,RY
Primitives also accept modifiers, negation (-) and intersection (&), used to subtract the primitive from the current shape. See the documentation of the full solver for more details.
Examples:
sphere 0 0 0 1
sphere 0 1 0 1 2
box 0 0 0 1
box 0 1 0 1 2
&-sphere 0 0 0 0.5
Parameter init_vf defines the initial volume fraction field. Valid values of init_vf:
zerolistlist_path
Parameter list_path defines a list of primitives
set string list_path "inline
PRIMITIVE
...
"
The initial volume fraction is 1 inside the primitives and 0 elsewhere.
Flows in complex geometries around solid bodies are activated by
set int enable_embed 1
Parameter eb_list_path defines a list of primitives that compose the solid body
set string eb_list_path "inline
PRIMITIVE
...
"
Parameter bc_path defines boundary conditions
set string bc_path "inline
BCTYPE {
PRIMITIVE
...
}
...
"
The boundary conditions are set to BCTYPE on domain edges and edges of solid bodies that fall inside the primitives. Valid values of BCTYPE:
wall VX VY 0VX,VY
slipwallinlet VX VY 0VX,VY
outletinletpressure PP
outletpressure PP
Example setting walls with velocity (1,0) at y=0 and y=1 and walls with zero velocity elsewhere:
set string bc_path "inline
wall 0 0 0 {
box 0 0 0 100
}
wall 1 0 0 {
box 0 0 0 100 1e-6
box 0 1 0 100 1e-6
}
"
Parameter sliders defines a list of sliders
set string sliders "
SLIDER
...
"
where SLIDER describes one slider
VAR MIN MAX [LABEL=VAR]
that sets a variable named VAR with the range between MIN and MAX. Initially, the slider takes the value from the current configuration if VAR defined and the default (MIN+MAX)/2 otherwise. Variables set by sliders are expanded in the input configuration. Lines that depend on such expansions need to start with FROMSLIDER.
Examples:
set double g 5 # initial value
set string sliders "
rho1 1 10 density 1
sigma 0 1 surface tension
g 0 10 gravity
"
FROMSLIDER set vect gravity 0 -$g