GithubHelp home page GithubHelp logo

multiform-uon / porousmicrotransport Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gerlero/porousmicrotransport

1.0 1.0 0.0 209 KB

OpenFOAM solvers for flow and transport in porous media in paper-based microfluidics

License: GNU General Public License v3.0

Shell 3.64% C++ 90.26% Python 5.38% Dockerfile 0.72%

porousmicrotransport's Introduction

porousMicroTransport

CI OpenFOAM versions Docker Docker image

porousMicroTransport is a set of additional solvers and related libraries for OpenFOAM developed for the purposes of simulating flow and transport in porous media, with an emphasis on paper-based microfluidics

Installation

Requirements

porousMicroTransport requires OpenFOAM, as distributed by OpenCFD (openfoam.com). Compatible OpenFOAM versions are v2012, v2106, v2112, v2206 and v2212.

Versions produced by the OpenFOAM Foundation (openfoam.org) (e.g. OpenFOAM 9, OpenFOAM 10) are not compatible.

porousMicroTransport is provided as source code and must be compiled before use.

Download

Download the source code of porousMicroTransport, or clone this repository with Git:

git clone https://github.com/gerlero/porousMicroTransport.git

Compile and install

To build and install porousMicroTransport, just invoke the top-level Allwmake script:

cd porousMicroTransport
./Allwmake -j

If necessary, activate/source the correct OpenFOAM environment before running Allwmake.

Test

Optionally, you can verify the installation of porousMicroTransport by running the included test suite (requires Python 3).

tests/runtests.sh

Docker image

Alternatively, you can use the Docker image of porousMicroTransport. This image is based on the official OpenFOAM Docker image and includes porousMicroTransport precompiled and ready to use. If you have Docker installed, you can run the image in a new container with:

docker run -it microfluidica/porousmicrotransport:main

Solvers

moistureDiffusivityFoam

(Unsaturated) capillarity-driven flow in a porous medium, governed by the moisture diffusivity equation1:

$$\frac{\partial\theta}{\partial t} - \nabla\cdot\left[D\nabla\theta\right] = 0$$

where $\theta$ is the moisture content and $D$ is a saturation-dependent diffusivity as defined by an unsaturated flow model.

porousMicroTransportFoam

Transport by steady flow of any number of species in a porous medium, with optional reactions between the species. For each species (concentration $C$), the governing equation is:

$$\frac{\partial\theta C}{\partial t} + \nabla\cdot\left[UC\right] - \nabla\cdot\left[\theta D_{eff}\nabla C\right] = \theta R$$

where $D_{eff}$ is an effective diffusivity tensor—which models the effects of molecular diffusion and mechanical dispersion—and $R$ is a reaction term (see below).

moistureDiffusivityTransportFoam

Capillary flow + reactive transport in a porous medium, coupling the moisture diffusivity equation for flow with the previous transport equation.

Case layout

The layout of porousMicroTransport cases follows many conventions of porousMultiphaseFoam, especially in field names and entries in the transportProperties dictionary. This allows for easy conversion of cases from porousMultiphaseFoam to porousMicroTransport (and to some extent, vice versa).

Common fields

These variable fields are defined in the time directories:

  • theta: moisture content (scalar). Optional for porousMicroTransportFoam

  • U: Darcy velocity (vector). Optional for flow solvers

Common porous medium properties

Defined as scalar fields in constant or as dictionary entries in transportProperties:

  • eps or thetamax: porosity

  • K: intrinsic permeability. Flow solvers only

Phase properties

Flow solvers only.

Set these in a phase.theta subdictionary in transportProperties:

  • rho: density

  • mu: dynamic viscosity

Moisture content options

Flow solvers only.

Defined as scalar fields in constant or as dictionary entries in transportProperties:

  • thetamin: minimum (a.k.a. residual) moisture content

  • thetamax: maximum moisture content (usually equal to the porosity)

Unsaturated flow models

Flow solvers only.

Supported models of unsaturated flow are:

  • BrooksAndCorey: Brooks and Corey2 model

    • In coefficient dictionary BrooksAndCoreyCoeffs: pc0, alpha, n, l (optional)
  • VanGenuchten: Van Genuchten3 model

    • In coefficient dictionary VanGenuchtenCoeffs: pc0, m or n, l (optional)
  • LETxs: LETx + LETs model4

    • In coefficient dictionary LETxsCoeffs: pc0, Lw, Ew, Tw, Ls, Es, Ts
  • LETd: LETd5 model

    • In coefficient dictionary LETdCoeffs: pc0, L, E, T

To choose a model for your simulation, set the unsaturatedFlowModel entry in transportProperties. Then set the model-specific parameters in the corresponding coefficient subdictionary.

Transported species

Transport solvers only.

A species list in transportProperties contains the names of all transported species.

Each species must also define its own scalar concentration field (named the same as the species).

For each species, the following entries are required in transportProperties:

  • Dm: molecular diffusivity ($D_M$)

  • dispersionModel: selection of a dispersion model (see below)

  • Coefficient dictionary for the selected dispersion model

Dispersion models

Transport solvers only.

Supported dispersion models for the species are:

  • alphaDispersion: (an)isotropic mechanical dispersion with transverse and longitudinal coefficients. Defines the effective diffusivity of the species as:

    $$D_{eff} = \left(\frac{D_M}{\tau} + \alpha_T|V|\right)I + \left(\alpha_L - \alpha_T\right)\frac{VV}{|V|}$$

    where $I$ is the identity tensor and $V$ is the true velocity of the fluid ($=U/\theta$)

    • In coefficient dictionary alphaDispersionCoeffs:

      • alphaT: transverse dispersion coefficient ($\alpha_T$)
      • alphaL: longitudinal dispersion coefficient ($\alpha_L$)
      • tau: tortuosity ($\tau$)

Reactions

Transport solvers only.

Reactions are defined in a reactions subdictionary in transportProperties. The reactions dictionary contains a list of subdictionaries, each of which defines a single reaction. A reaction can have an arbitrary name and should contain the following entries:

  • reaction: reaction equation. E.g. "A^2 + B = 2C + D", where A, B, C and D are names of defined species

  • kf: forward rate constant

  • kr: optional reverse rate constant (for reversible reactions)

Tutorials

Sample cases are available in the tutorials directory.

Related projects

  • porousMultiphaseFoam6: toolbox for OpenFOAM for modeling multiphase flow and transport. As previously stated, porousMicroTransport is mostly compatible with porousMultiphaseFoam in terms of case definitions, and can be installed alongside it.

  • electroMicroTransport7: toolbox for OpenFOAM dedicated to electromigrative separations. It includes support for modeling separations in paper-based media, and can also be installed alongside porousMicroTransport.

Footnotes

  1. Bear, J., Cheng, A.H.-D.: Modeling Groundwater Flow and Contaminant Transport. Springer Dordrecht (2010)

  2. Brooks, R., Corey, T.: Hydraulic properties of porous media. Hydrol. Pap. Colo. State Univ., 24, 37 (1964)

  3. Van Genuchten, M.Th.: A closed-form equation for predicting the hydraulic conductivity of unsaturated soils. Soil Sci. Soc. Am. J., 44, 892–898 (1980)

  4. Lomeland, F.: Overview of the LET family of versatile correlations for flow functions. In: Proceedings of the International Symposium of Core Analysts, pp. SCA2018-056 (2018)

  5. Gerlero, G.S., Valdez, A.R., Urteaga, R., Kler, P.A.: Validity of Capillary Imbibition Models in Paper-Based Microfluidic Applications. Transp. Porous Media, 141, 359-378 (2022)

  6. Horgue, P., Renard, F., Gerlero, G.S., Guibert, R., Debenest, G.: porousMultiphaseFoam v2107: An open-source tool for modeling saturated/unsaturated water flows and solute transfers at watershed scale. Comput. Phys. Comm., 273, 108278 (2022)

  7. Gerlero, G.S., Marquez Damián, S., Kler, P.A.: electroMicroTransport v2107: Open-source toolbox for paper-based electromigrative separations. Comput. Phys. Comm., 269, 108143 (2021)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.