GithubHelp home page GithubHelp logo

multiphase's Introduction

A multi-phase flow solver

Tianju Xue, Yiheng Tao, and Jiarong Wu
APC 524, Fall 2018, Princeton University
January 15, 2019

In this final project, we developed a solver that could be used to solve for problems relevant to mutli-phase flow in porous media. There are 5 folders (namely: solver, eigen, test, plot, and doc) and this README file in the submission bundle. The folder solver contains the header files and source files we created to develop the solver, and the files relavent to the three test cases. The folder eigen is an external library we employed in our solver to solve the system of linear equations. (Notice that the external library is not tracked by git. For the code to run, the user must first download Eigen and put the folder under the main directory.) The folder test contains files we wrote to test the code along the development process. The folder plot includes two Python files, which we used to plot the comparison between numerical and analytical solutions in the test cases. Finally, the folder doc contains the Doxyfile that we used to do documentation.

We designed three test cases, which can be used to evaluate the solver. In the first test case, the solver solves the Poisson's Equation. In the second test case, the solver solves a multiphase flow problem. In the third test case, the solver solves a geological CO2 injection problem with realistic parameters. The results of test cases #1 and #3 are presented in the final report.

To run a case, go to /solver and type make to start compiling the code. The output executable file is RUN. Use command ./RUN <CASE_FLAG> <ADAPT_FLAG>. If the parameter number is not correct, a prompt USAGE: ./RUN <problem type> <adaptive option> will show on the screen. FLAG = 0, 1, 2 indicates test case #1, #2, #3, respectively, andADAPT_FLAG = 0 or 1 indicates using adaptive mesh or not. Notice that the adaptive mesh has not be implemented for case 1 and 2, so now it can be only used with FLAG = 0. While running, the screen will show the current time step and the total time step as an indication of current progress. The solver will generate output files in progression and, at the end of simulation, the solver will put the output files to /solver/output. Those output files can be viweded using the software Paraview for further analyses.

Additional instruction to assess the files we wrote for testing and profiling. The testing was done using googletest. And we use gprof for the profiling.

For testing: If using Ubuntu, simply go to /test and use make to compile the test code. If using other operating system, an already compiled Google Test library that's compatible with your own OS is needed and should be put under the /test directory. The Makefileshould be change accordingly with your compiled library name in the linking line like $(CXX) $(CXXFLAGS) $(CFLAGS) $^ <library> -o $@ $(TESTFLAGS) instead of $(CXX) $(CXXFLAGS) $(CFLAGS) $^ libgtest.a -o $@ $(TESTFLAGS).

For profiling purpose:

  1. Insert -pg flag when compiling (already done in the given /solver/Makefile)
  2. In a terminal, use command gprof -a RUN gmon.out > <target plain txt file> to get the output flat file and call graph.

multiphase's People

Contributors

tianjuxue avatar jiarong-wu avatar taoyh5 avatar

Watchers

 avatar

multiphase's Issues

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.