2015-06-15 17:54:06 -04:00
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <sys/stat.h>
|
|
|
|
|
#include <iostream>
|
|
|
|
|
#include <exception>
|
|
|
|
|
#include <stdexcept>
|
|
|
|
|
#include <fstream>
|
|
|
|
|
|
2015-08-21 16:56:43 -04:00
|
|
|
#include "common/ScaLBL.h"
|
|
|
|
|
#include "common/Communication.h"
|
2018-02-10 20:13:57 -05:00
|
|
|
#include "analysis/TwoPhase.h"
|
2021-01-05 18:43:44 -05:00
|
|
|
#include "common/MPI.h"
|
2018-07-29 07:59:23 -04:00
|
|
|
#include "models/MRTModel.h"
|
2015-06-15 17:54:06 -04:00
|
|
|
//#define WRITE_SURFACES
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Simulator for two-phase flow in porous media
|
|
|
|
|
* James E. McClure 2013-2014
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
|
|
|
{
|
|
|
|
|
// Initialize MPI
|
2021-01-05 18:43:44 -05:00
|
|
|
Utilities::startup( argc, argv );
|
|
|
|
|
Utilities::MPI comm( MPI_COMM_WORLD );
|
|
|
|
|
int rank = comm.getRank();
|
|
|
|
|
int nprocs = comm.getSize();
|
2016-06-04 19:31:44 -04:00
|
|
|
{
|
2018-02-21 11:31:33 -05:00
|
|
|
if (rank == 0){
|
|
|
|
|
printf("********************************************************\n");
|
|
|
|
|
printf("Running Single Phase Permeability Calculation \n");
|
|
|
|
|
printf("********************************************************\n");
|
|
|
|
|
}
|
2019-04-23 16:23:47 -04:00
|
|
|
// Initialize compute device
|
|
|
|
|
int device=ScaLBL_SetDevice(rank);
|
2020-01-22 12:01:29 -05:00
|
|
|
NULL_USE( device );
|
2019-04-23 16:23:47 -04:00
|
|
|
ScaLBL_DeviceBarrier();
|
2021-01-05 18:43:44 -05:00
|
|
|
comm.barrier();
|
2019-04-23 16:23:47 -04:00
|
|
|
|
2018-07-29 07:56:10 -04:00
|
|
|
ScaLBL_MRTModel MRT(rank,nprocs,comm);
|
|
|
|
|
auto filename = argv[1];
|
|
|
|
|
MRT.ReadParams(filename);
|
|
|
|
|
MRT.SetDomain(); // this reads in the domain
|
|
|
|
|
MRT.ReadInput();
|
|
|
|
|
MRT.Create(); // creating the model will create data structure to match the pore structure and allocate variables
|
|
|
|
|
MRT.Initialize(); // initializing the model will set initial conditions for variables
|
|
|
|
|
MRT.Run();
|
2018-08-27 11:40:29 -04:00
|
|
|
MRT.VelocityField();
|
2016-06-04 19:31:44 -04:00
|
|
|
}
|
2020-10-08 11:03:42 -04:00
|
|
|
Utilities::shutdown();
|
2015-06-15 17:54:06 -04:00
|
|
|
}
|