Examples

Image

In this example we consider the micromodel described in the configuration file section.

The image is available in the examples folder in the Github page with the default name ‘microsystem.png’. The configuration file corresponds to the one in the configuration file section and it is saved as ‘parameters.txt’ (the default name for the configuration file). Since ‘image’ is the default entry for the simulation setup (i.e., the flow is from top to bottom), and assuming that the command ‘gmsh’ in the terminal executes Gmsh, then to run the whole framework (meshing, flow, and tracer) it is enough to add the ‘-t all’ command line to the pymm executable:

pymm -t all

The execution time was ca. 20 minutes and the following are screenshots of the simulation results:

_images/pressure.png
_images/velocity.png
_images/tracer.png

Simulation results of the (top) pressure, (middle) velocity, and (bottom) tracer concentration.

Device

Here we consider the same image and configuration file as in the Image example, but we are interested now on the device setup (the flow is from the top-left corner to the bottom-right corner of the device). Then we add the corresponding flag to the pymm executable:

pymm -t all -m device

The execution time was ca. 35 minutes and the following are screenshots of the simulation results:

_images/device_pressure.png
_images/device_velocity.png
_images/device_tracer.png

Simulation results of the (top) pressure, (middle) velocity, and (bottom) tracer concentration.

Online

In this example we consider a micromodel available online in Fig. 2a in Joekar-Niasar et al. 2009.

The image was extracted by screenshot and saved with the name ‘online.png’ (1068x1068 pixels). The configuration file was saved as ‘configuration.txt’ and contained the following text:

 1"""Set the framework parameters"""
 2600e-6      #Image-related, length of the microsystem [m]
 3600e-6      #Image-related, height of the microsystem [m]
 41.8e-6      #Image-related, depth of the microsystem [m]
 5160         #Image-related, threshold for converting the image to binary
 61.0         #Image-related, rescaled factor for the input image
 750          #Image-related, minimum size of the grain clusters
 81.0         #Image-related, tolerance to approximate the border as polygon
 91.0         #Image-related, tolerance to approximate the grains as polygon
101.0         #Figure-related, line width to show the contours in the produced figures
116e-6        #Device-related, width of the top and bottom channels in the micromodel device [m]
121e-6        #Mesh-related, mesh size [m]
131e-6        #Fluid-related, kinematic viscosity [Dynamic viscosity/fluid_density, m2/s]
141e-12       #Tracer-related, diffusion coefficient [m2/s]
152.0e-3      #Simulation-related, inlet boundary condition (Pressure/fluid_density, [Pa/(kg/m3)])
16120.0       #Simulation-related, end time for the tracer simulation [s]
171.0         #Simulation-related, time interval to write the tracer results [s]
181e-7        #Solver-related, convergence criterium for the pressure solution in the numerical scheme for the Stokes simulation
191e-8        #Solver-related, convergence criterium for the velocity solution in the numerical scheme for the Stokes simulation
2010000       #Solver-related, maximum number of iterations for the Stokes simulation in case the convergence criteria have not been reached
211.0         #Solver-related, time step in the numerical scheme for the Tracer simulation [s]

Here we used a version of Gmsh built from source, then we gave the path to the executable via the ‘-g’ flag. Since we are interested in the flow and tracer simulations, then we add the flag ‘-t all’. Then, the following command was exectued in the terminal:

pymm -i online.png -p configuration.txt -m device -t all -gmsh /home/AD.NORCERESEARCH.NO/dmar/Github/gmsh/build/gmsh

The execution time was ca. 15 minutes and the following are screenshots of the simulation results:

_images/online_pressure.png
_images/online_velocity.png
_images/online_tracer.png

Simulation results of the (top) pressure, (middle) velocity, and (bottom) tracer concentration.