LBPM/models/MRTModel.h

95 lines
2.5 KiB
C
Raw Normal View History

2018-06-11 14:19:05 -05:00
/*
Copyright 2013--2018 James E. McClure, Virginia Polytechnic & State University
2020-10-12 05:08:29 -05:00
Copyright Equnior ASA
2018-06-11 14:19:05 -05:00
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-19 18:42:58 -05: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 18:54:46 -05:00
#include "common/ScaLBL.h"
2018-05-19 18:42:58 -05:00
#include "common/Communication.h"
2021-01-05 12:51:32 -06:00
#include "common/MPI.h"
2018-07-28 15:01:24 -05:00
#include "analysis/Minkowski.h"
2018-05-19 18:42:58 -05:00
#include "ProfilerApp.h"
class ScaLBL_MRTModel {
2018-05-19 18:42:58 -05:00
public:
ScaLBL_MRTModel(int RANK, int NP, const Utilities::MPI &COMM);
~ScaLBL_MRTModel();
2018-05-19 18:42:58 -05:00
// 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();
void VelocityField();
bool Restart, pBC;
int timestep, timestepMax;
2022-02-02 10:15:00 -06:00
int ANALYSIS_INTERVAL;
int BoundaryCondition;
double tau, mu;
double Fx, Fy, Fz, flux;
double din, dout;
double tolerance;
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;
2018-05-19 18:42:58 -05:00
// input database
std::shared_ptr<Database> db;
std::shared_ptr<Database> domain_db;
2018-05-19 18:54:46 -05:00
std::shared_ptr<Database> mrt_db;
2020-03-24 08:37:22 -05:00
std::shared_ptr<Database> vis_db;
2018-05-19 18:42:58 -05:00
IntArray Map;
2018-05-19 18:54:46 -05:00
DoubleArray Distance;
2018-05-19 18:42:58 -05:00
int *NeighborList;
double *fq;
double *Velocity;
double *Pressure;
2018-07-28 15:11:54 -05:00
//Minkowski Morphology;
2018-08-27 10:40:29 -05:00
DoubleArray Velocity_x;
DoubleArray Velocity_y;
DoubleArray Velocity_z;
2018-05-19 18:42:58 -05:00
private:
2021-01-05 17:43:44 -06:00
Utilities::MPI comm;
// filenames
2018-05-19 18:42:58 -05:00
char LocalRankString[8];
char LocalRankFilename[40];
char LocalRestartFile[40];
2018-05-19 18:42:58 -05:00
//int rank,nprocs;
void LoadParams(std::shared_ptr<Database> db0);
2018-05-19 18:54:46 -05:00
};