Files
LBPM/models/ColorModel.h

83 lines
1.9 KiB
C
Raw Normal View History

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
};