Jeff-Hugh / GenPorMed

Generate random porous media with Quartet Structure Generation Set (QSGS) method.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About The Project

This project code can generate random porous media with Quartet Structure Generation Set (QSGS) method. QSGS was first proposed by Wang and his collaborators1. Then he further enriched this method at 20072 and 20093.

References

[1] Wang, M., Wang, J., Pan, N., & Chen, S. (2007). Mesoscopic predictions of the effective thermal conductivity for microscale random porous media. Physical Review E - Statistical, Nonlinear, and Soft Matter Physics, 75(3), 036702. (https://doi.org/10.1103/PhysRevE.75.036702)
[2] Wang, M., Meng, F., & Pan, N. (2007). Transport properties of functionally graded materials. Journal of Applied Physics, 102(3), 1–7. (https://doi.org/10.1063/1.2767629)
[3] Wang, M., & Kang, Q. (2009). Electrokinetic transport in microchannels with random roughness. Analytical Chemistry, 81(8), 2953–2961. (https://doi.org/10.1021/ac802569n)

Run the code

The most of this project is based on the C++ standard library.

The method output2png of Class Porous2D and Porous3D can generate PNG file directly, which is base on the GnuPlot and gnuplot-iostream. If you need this function, make sure to install GnuPlot and Boost C++ library on your system. If you don't need, just comment the related code.

The method output2tecplot of Class Porous2D and Porous3D can generate plt file for Tecplot and GenerateSTL.py program.

How to run

  1. Clone the repo
    git clone https://github.com/Jeff-Hugh/GenPorMed.git
  1. Compile

    Make sure the boost path in CMakeLists.txt is correct in your system.

    cmake ./
    make
or just use command
    g++ Porous2D.cpp Porous3D.cpp run.cpp -lboost_system -lboost_thread -lboost_iostreams -std=c++11 -fopenmp -o run
  1. Run
    ./run
  1. If you want to generate the STL file, you should use the function output2tecplot of Porous2D to output a file like lattice.dat. Python program, numpy and pandas Python packages should also be installed. Then run the py file.
    pip install numpy pandas
    python GenerateSTL.py

License

Distributed under the GPL v3.0 License.

Examples

2D porous figure porosity = 0.5

3D porous figure porosity = 0.5

Please cite this repo

@software{Li_GenPorMed_2024,
author = {Li, Jianhui},
month = aug,
title = {{GenPorMed}},
url = {https://github.com/Jeff-Hugh/GenPorMed},
version = {1.1},
year = {2024}
}

About

Generate random porous media with Quartet Structure Generation Set (QSGS) method.

License:GNU General Public License v3.0


Languages

Language:C++ 88.5%Language:Python 10.8%Language:CMake 0.7%