GithubHelp home page GithubHelp logo

franjcf / hybridporousinterfoam Goto Github PK

View Code? Open in Web Editor NEW
90.0 10.0 35.0 80.02 MB

OpenFOAM solver for performing single- and two-phase flow simulations on hybrid-scale porous media.

License: GNU General Public License v3.0

Shell 0.09% C 1.48% C++ 98.34% Python 0.08%
openfoam porous-media-flow porous-media multiphase fractures coastal-engineering micro-ct cfd capillary-pressure relative-permeability

hybridporousinterfoam's Introduction

Simulation of Multiphase Flow in Hybrid-Scale Porous Media

This solver simulates single- and two-phase flow in porous media that contains two characteristic length scales: a large scale solid-free domain where flow is solved through the Volume-Of-Fluid Method, and a small scale porous domain where flow is solved through two-phase Darcy's Law. Both domains are coupled and are solved simultaneously with a single momentum equation and within a single mesh.

The most recent version also includes a simplified solver that can be used exclusively to model single-phase flow in hybrid scale porous media.

This repository was created by Francisco J. Carrillo and Cyprien Soulaine with the support of Ian C. Bourg.

Conceptual Representation of the Modeling Framework:


General Information

  • This toolbox is compatible with OpenFOAM 7.0 and later.
  • This toolbox needs only a standard OpenFOAM installation (see www.openfoam.org)
  • Read the LICENCE_OPENFOAM file for information about OpenFOAM and this toolbox Copyrights.

Installation

First, make sure to source the OpenFOAM file, as shown in the following example code:

source /opt/openfoam7x/etc/bashrc

Then, in the "hybridPorousInterFoam" directory, run:

./Allwmake

This compiles the libraries "lporousInterfaceProperties.so", "lporousModels.so","lporousTwoPhaseProperties.so" and "lporousImmiscibleIncompressibleTwoPhaseMixture.so" in the standard OpenFOAM user directory : $FOAM_USER_LIBBIN;

The executable solvers "hybridPorousInterFoam" (for multiphase flow) and "hybridPorousPimpleFoam" (for single-phase flow) are also compiled in the standard OpenFOAM user directory $FOAM_USER_APPBIN.


To remove temporary files, dynamic libraries, and executables, run:

./Allwclean 

Running the Tutorials

To test if the solver was installed correctly, you can run all the included tutorial cases by typing the following code within the "tutorials" subdirectory:

python runTutorials.py

Note that this will only run each case for a single time step. Still, it might take a while. Also make sure to use python2 to run the associated script.


Each tutorial directory contains "run" and "clean" files to test installation and validate the solver. To run a particular tutorial for more than a single time step just replace "writeNow" with "endTime" within its "system/controlDict" file. Then you can run said tutorial by typing:

./run

or equivalently:

hybridPorousInterFoam (for multiphase flow cases)
hybridPorousPimpleFoam (for single-phase flow cases)

To clean the directory:

./clean

List of Included Cases

Case Template

  • A basic template that includes all the neccesary files to run a succesfull simulation. Each variable and parameter within the "0/" directory and the "constant/transportProperties" file is labeled and explained.

Darcy Flow Cases

  • Test cases related to the verification of the solver in a domain completely occupied by porous media (Replicatino of the 1-D Buckley-Leverett analytical solution and determination of a capillarity-gravity equilibirum)


Free Flow Cases

  • Test cases related to the verification of the solver in a domain where there is no porous media or just a porous boundary (capillary-driven flows, contact angle implementations, Bretherton thin film-dynamics)


Example Applications

  • Sample cases that show the multi-scale nature of this solver by simulating multiphase systems with a combination of porous and free-fluid regions (i.e. fractures, coastal barriers, drainage, imbibition, and a porous reservoirs). Some of these contain additional single-phase cases for use with the single-phase solver.

Wave Propagation in Coastal Barriers:

|

Drainage and Imbibition in Porous Fractures:

|

Viscous Fingering in Oil Reservoirs:

List of Included Libraries

porousInterfaceProperties

  • Implementation of a constant contact angle interface condition at the porous media-fluid interface.

porousImmicscibleIncompressibleTwoPhaseMixture

  • Implementation of an immicisble incompressible two-phase fluid class that allows for the use of porousInterfaceProperties

porousTwoPhaseProperties:

  • Defenition of two-phase fluid properties that allows for the use of porousInterfaceProperties

porousModels/phaseModels ( adapted )

  • Incompressible phase model for porous media flows (constant density and viscosity)

porousModels/capillarityModels ( adapted )

  • Capillary pressure models (Brooks and Corey, Van Genuchten, Linear)

porousModels/relativePermeabilityModels ( adapted )

  • Relative permeability models (Brooks and Corey, Van Genuchten)

Note on Adapted Libraries

  • The libraries marked as "adapted" were obtained from the open-sourced porousMultiphaseFoam source code published in Horgue P. et al. (2015). Said code can be used to efficiently model full Darcy-scale flows.

Citing the Toolbox

If you use this solver, please cite the following paper (theory) and the code (implementation):

Paper: Carrillo F.J., Bourg, I. C., Soulaine, C., Multiphase flow modeling in multiscale porous media: An open-source micro-continuum approach, J. Comput. Phys. (2020), https://doi.org/10.1016/j.jcpx.2020.100073

Code: https://doi.org/10.5281/zenodo.3724707 (DOI: 10.5281/zenodo.3724707)

Authors' Publications

  1. Carrillo, F. J., Bourg, I. C., 2019. A darcy-brinkman-biot approach to modeling the hydrology and mechanics of porous media containing758 macropores and deformable microporous regions. Water Resources Research 55, 8096–8121
  2. Soulaine, C., Gjetvaj, F., Garing, C., Roman, S., Russian, A., Gouze, P., Tchelepi, H., May 2016. The impact of sub-resolution porosity of918 x-ray microtomography images on the permeability. Transport in Porous Media 113 (1), 227–243.919
  3. Soulaine, C., Roman, S., Kovscek, A., Tchelepi, H. A., 2017. Mineral dissolution and wormholing from a pore-scale perspective. Journal of920 Fluid Mechanics 827, 457–483.921 URL https://www.cambridge.org/core/product/identifier/S0022112017004992/type/journal_article922
  4. Soulaine, C., Roman, S., Kovscek, A., Tchelepi, H. A., 2018. Pore-scale modelling of multiphase reactive flow. Application to mineral923 dissolution with production of CO2. Journal of Fluid Mechanics 855, 616–645.924 Soulaine, C., Tchelepi, H.A., 2016.Micro-continuumapproachforpore-scalesimulationofsubsurface processes.TransportIn PorousMedia925 113, 431–456
  5. Soulaine, C., Creux, P., Tchelepi, H. A., 2019. Micro-continuum framework for pore-scale multiphase fluid transport in shale formations.916 31 Transport in Porous Media.
  6. Horgue, P., Soulaine, C., Franc, J., Guibert, R., Debenest, G., 2015. An open-source toolbox for multiphase flow in porous media. Computer Physics Communications 187 (0), 217– 226
  7. The referenced Darcy-Scale toolbox can be found here: https://github.com/phorgue/porousMultiphaseFoam

hybridporousinterfoam's People

Contributors

franjcf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hybridporousinterfoam's Issues

EXE = $(FOAM_APPBIN)/SRFPimpleFoam OF8

Problem Solution: Error resolved by correcting title command to EXE = $(FOAM_USER_APPBIN)/SRFPimpleFoam in OpenFoamV8/HybridPorousPimpleFoam/SRFPimpleFoam/Make/files

To reproduce issue: Enter the command hybridPorousInterFoam in any of the tutorial case or anywhere.

Build: 8-9b73cf21a682
OS: WSL1-Ubuntu 18.04

No running in OF7 and OF8

Dear Francisco Carrillo:
thanks a lot for developing these new solvers for OpenFoam. For soil simulations I would be much interested to use them.
(Linux Ubuntu LTS 20.04)
With compiling everything went well in my OF7 and OF8 version, which I have both installed and source independently.
As well in OF7 (in OF8 I did not try) your python-script works well and gives OK to all tutorial cases.
Nevertheless neither in OF 8 nor in OF 7 running of the solvers functions.
OF8 error message:
gidadmin@vgeodatenkiste:~/OpenFOAM/hybridPorousInterFoam-master/tutorials/Example_Applications/Coastal_Barrier/coastal_Barrier$ hybridPorousInterFoam

--> FOAM FATAL IO ERROR:
keyword is undefined in dictionary "/opt/openfoam8/etc/controlDict/DimensionedConstants/SICoeffs/universal"

file: /opt/openfoam8/etc/controlDict/DimensionedConstants/SICoeffs/universal from line 922 to line 924.

From function const Foam::entry& Foam::dictionary::lookupEntry(const Foam::word&, bool, bool) const
in file db/dictionary/dictionary.C at line 797.

FOAM exiting

double free or corruption (!prev)
Abgebrochen (Speicherabzug geschrieben)

OF7 error message:
Segmentation fault /core dump
free(): invalid pointer

For OF8 I looked up the files of the error message, but could not get any idea, what to do.
Help or hints by you would be much appriciated!

Johannes Merklein

Questions about viscous terms

Dear authors:

Hello and thank you for providing such an excellent open source toolkit! I learned a lot from this kit.

I have a question about the code in the toolkit (using OpenFoam version V8), and there is a piece of code in the UEqn.H file

fvVectorMatrix UEqn
(
(1./eps)(fvm::ddt(rho, U) + fvm::div(rhoPhiByEps, U) + MRF.DDt(rho, U))
+ (1./eps)
(turbulence->divDevTau(rho, U)) // Why is it multiplied by 1/eps?
+ fvm::Sp(Drag,U)
==
fvOptions(rho, U)
);

This code is a finite volume discrete assembly of the macroscopic momentum equation multiplied by a system of linear algebraic equations, which I think is the corresponding equation (refer to the formula (21) in the paper “Multiphase flow modeling in multiscale porous media:An open-source micro-continuum approach”).

$\frac{1}{\phi}(\frac{\partial \rho\bar{\pmb{v}}}{\partial t} + \nabla\cdot(\frac{\rho}{\phi}\bar{\pmb{v}}\bar{\pmb{v}})) = -\nabla\bar{p} + \rho\pmb{g} + \nabla\cdot\bar{S} - \mu k^{-1}\bar{\pmb{v}} + \pmb{F}_c$

One of the things I am confused about is why the viscous term $\nabla\cdot\bar{S}$ is multiplied by 1/eps in the code (shown below), because the equation (21) does not multiply this coefficient, is there any key information I am missing?
(1./eps)*(turbulence->divDevTau(rho, U))

I am looking forward to your reply and best wishes : )

issue compiling librairies

Hello,

I am using Windows 10, Ubuntu 20.04 LTS, OpenFoamV7 and Paraview 5.9.1.
I get errors when compiling the librairies with command "./Allwmake" :
Error

Have you ever encountered this problem?

Regards.

Segmentation fault (core dumped) - OF7

Problem Description: Error in hybridPorousInterFoam solver itself.

To reproduce issue: Enter the command hybridPorousInterFoam in any of the tutorial case or anywhere.

Build: 7-1ff648926f77
OS: WSL2-Ubuntu 18.04

setting pressure in tutorial

Dear Franjct,
I see your setting in tutorial for pressure. Why you chosen the compressible for your simulation. Is it can run with incompressible flow?

gravity in porous media

Hello, I found that the gravity setting is only effective when eps is 0.999, but not in porous media. I would like to know how to consider gravity in porous media, thank you

Support for OpenFoam9

Dear authors,

Thanks for providing this toolkit. I was planning to use it for my simulations cases, but realized the repository comes only with the source codes for OpenFoam7 and 8. Is it planned to expand to OpenFoam9 or would you recommend that I downgrade to OpenFoam8?

Thanks for any suggestions!

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.