Files
LBPM/models/MRTModel.h

76 lines
1.6 KiB
C
Raw Normal View History

2018-05-19 19:42:58 -04:00
/*
* Multi-relaxation time LBM Model
*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <iostream>
#include <exception>
#include <stdexcept>
#include <fstream>
2018-05-19 19:54:46 -04:00
#include "common/ScaLBL.h"
2018-05-19 19:42:58 -04:00
#include "common/Communication.h"
2021-01-05 13:51:32 -05:00
#include "common/MPI.h"
2018-07-28 16:01:24 -04:00
#include "analysis/Minkowski.h"
2018-05-19 19:42:58 -04:00
#include "ProfilerApp.h"
class ScaLBL_MRTModel{
public:
2021-01-05 18:43:44 -05:00
ScaLBL_MRTModel(int RANK, int NP, const Utilities::MPI& COMM);
2018-05-19 19:42:58 -04:00
~ScaLBL_MRTModel();
// functions in they should be run
void ReadParams(string filename);
void ReadParams(std::shared_ptr<Database> db0);
void SetDomain();
void ReadInput();
void Create();
void Initialize();
void Run();
2018-08-27 11:40:29 -04:00
void VelocityField();
2018-05-19 19:42:58 -04:00
bool Restart,pBC;
int timestep,timestepMax;
int BoundaryCondition;
double tau,mu;
double Fx,Fy,Fz,flux;
double din,dout;
2019-05-09 01:01:15 +02:00
double tolerance;
2018-05-19 19:42:58 -04:00
int Nx,Ny,Nz,N,Np;
int rank,nprocx,nprocy,nprocz,nprocs;
double Lx,Ly,Lz;
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;
// input database
std::shared_ptr<Database> db;
std::shared_ptr<Database> domain_db;
2018-05-19 19:54:46 -04:00
std::shared_ptr<Database> mrt_db;
2018-05-19 19:42:58 -04:00
IntArray Map;
2018-05-19 19:54:46 -04:00
DoubleArray Distance;
2018-05-19 19:42:58 -04:00
int *NeighborList;
double *fq;
double *Velocity;
double *Pressure;
2018-07-28 16:01:24 -04:00
2018-07-28 16:11:54 -04:00
//Minkowski Morphology;
2018-05-19 19:42:58 -04:00
2018-08-27 11:40:29 -04:00
DoubleArray Velocity_x;
DoubleArray Velocity_y;
DoubleArray Velocity_z;
2018-05-19 19:42:58 -04:00
private:
2021-01-05 18:43:44 -05:00
Utilities::MPI comm;
2018-08-27 11:40:29 -04:00
2018-05-19 19:42:58 -04:00
// filenames
char LocalRankString[8];
char LocalRankFilename[40];
char LocalRestartFile[40];
//int rank,nprocs;
void LoadParams(std::shared_ptr<Database> db0);
2018-05-19 19:54:46 -04:00
};