Files
LBPM/models/ColorModel.h

98 lines
2.6 KiB
C
Raw Normal View History

2018-06-11 15:19:05 -04:00
/*
Copyright 2013--2018 James E. McClure, Virginia Polytechnic & State University
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
2018-05-16 14:40:38 -04:00
/*
Implementation of color lattice boltzmann model
*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <iostream>
#include <exception>
#include <stdexcept>
#include <fstream>
#include "common/Communication.h"
#include "analysis/TwoPhase.h"
#include "analysis/runAnalysis.h"
#include "common/MPI_Helpers.h"
#include "ProfilerApp.h"
#include "threadpool/thread_pool.h"
class ScaLBL_ColorModel{
public:
2018-05-18 17:24:17 -04:00
ScaLBL_ColorModel(int RANK, int NP, MPI_Comm COMM);
2018-05-16 14:46:11 -04:00
~ScaLBL_ColorModel();
2018-05-16 14:40:38 -04:00
// functions in they should be run
2018-05-16 15:08:47 -04:00
void ReadParams(string filename);
2018-05-17 10:34:36 -04:00
void ReadParams(std::shared_ptr<Database> db0);
2018-05-19 17:28:39 -04:00
void SetDomain();
2018-05-16 14:40:38 -04:00
void ReadInput();
void Create();
void Initialize();
void Run();
2018-05-18 17:24:17 -04:00
void WriteDebug();
2018-05-16 14:40:38 -04:00
2018-05-16 15:08:47 -04:00
bool Restart,pBC;
2018-05-16 14:40:38 -04:00
int timestep,timestepMax;
2018-05-16 15:08:47 -04:00
int BoundaryCondition;
2018-05-16 14:40:38 -04:00
double tauA,tauB,rhoA,rhoB,alpha,beta;
double Fx,Fy,Fz,flux;
double din,dout,inletA,inletB,outletA,outletB;
int Nx,Ny,Nz,N,Np;
2018-05-18 17:24:17 -04:00
int rank,nprocx,nprocy,nprocz,nprocs;
2018-05-16 14:40:38 -04:00
double Lx,Ly,Lz;
2018-05-16 15:15:01 -04:00
std::shared_ptr<Domain> Dm; // this domain is for analysis
std::shared_ptr<Domain> Mask; // this domain is for lbm
std::shared_ptr<ScaLBL_Communicator> ScaLBL_Comm;
2018-07-02 13:32:25 -04:00
std::shared_ptr<ScaLBL_Communicator> ScaLBL_Comm_Regular;
2018-05-16 14:40:38 -04:00
std::shared_ptr<TwoPhase> Averages;
2018-05-17 09:55:28 -04:00
// input database
std::shared_ptr<Database> db;
std::shared_ptr<Database> domain_db;
std::shared_ptr<Database> color_db;
std::shared_ptr<Database> analysis_db;
2018-05-16 14:40:38 -04:00
IntArray Map;
2018-07-02 13:32:25 -04:00
char *id;
int *NeighborList;
int *dvcMap;
double *fq, *Aq, *Bq;
double *Den, *Phi;
double *ColorGrad;
double *Velocity;
double *Pressure;
private:
MPI_Comm comm;
2018-05-16 14:40:38 -04:00
2018-06-13 10:09:55 -04:00
int dist_mem_size;
int neighborSize;
// filenames
char LocalRankString[8];
char LocalRankFilename[40];
char LocalRestartFile[40];
2018-05-16 15:08:47 -04:00
//int rank,nprocs;
2018-05-17 10:34:36 -04:00
void LoadParams(std::shared_ptr<Database> db0);
2018-05-19 17:28:39 -04:00
void AssignComponentLabels(double *phase);
2018-05-16 14:40:38 -04:00
};