on every golden scale
This commit is contained in:
20
example/Piston/poiseuille.db
Normal file
20
example/Piston/poiseuille.db
Normal file
@@ -0,0 +1,20 @@
|
||||
MRT {
|
||||
tau = 1.0
|
||||
F = 0, 0, 1.0e-5
|
||||
Restart = false
|
||||
pBC = 0
|
||||
din = 1.0
|
||||
dout = 1.0
|
||||
timestepMax = 2000
|
||||
tol = 1e-5
|
||||
flux = 0.0
|
||||
}
|
||||
|
||||
Domain {
|
||||
nproc = 1, 1, 1 // Number of processors (Npx,Npy,Npz)
|
||||
n = 16, 16, 16 // Size of local domain (Nx,Ny,Nz)
|
||||
n_spheres = 1 // Number of spheres
|
||||
L = 1, 1, 1 // Length of domain (x,y,z)
|
||||
BC = 0 // Boundary condition type
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ void ScaLBL_MRTModel::ReadParams(string filename){
|
||||
|
||||
// Color Model parameters
|
||||
timestepMax = mrt_db->getScalar<int>( "timestepMax" );
|
||||
tauA = mrt_db->getScalar<double>( "tau" );
|
||||
tau = mrt_db->getScalar<double>( "tau" );
|
||||
Fx = mrt_db->getVector<double>( "F" )[0];
|
||||
Fy = mrt_db->getVector<double>( "F" )[1];
|
||||
Fz = mrt_db->getVector<double>( "F" )[2];
|
||||
@@ -52,6 +52,7 @@ void ScaLBL_MRTModel::SetDomain(){
|
||||
Mask = std::shared_ptr<Domain>(new Domain(domain_db,comm)); // mask domain removes immobile phases
|
||||
Nx+=2; Ny+=2; Nz += 2;
|
||||
N = Nx*Ny*Nz;
|
||||
Distance.resize(Nx,Ny,Nz);
|
||||
for (int i=0; i<Nx*Ny*Nz; i++) Dm->id[i] = 1; // initialize this way
|
||||
//Averages = std::shared_ptr<TwoPhase> ( new TwoPhase(Dm) ); // TwoPhase analysis object
|
||||
MPI_Barrier(comm);
|
||||
@@ -77,7 +78,7 @@ void ScaLBL_MRTModel::ReadInput(){
|
||||
//.......................................................................
|
||||
sprintf(LocalRankString,"%05d",rank);
|
||||
sprintf(LocalRankFilename,"%s%s","SignDist.",LocalRankString);
|
||||
ReadBinaryFile(LocalRankFilename, Averages->SDs.data(), N);
|
||||
ReadBinaryFile(LocalRankFilename, Distance.data(), N);
|
||||
MPI_Barrier(comm);
|
||||
if (rank == 0) cout << "Domain set." << endl;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <stdexcept>
|
||||
#include <fstream>
|
||||
|
||||
#include "common/ScaLBL.h"
|
||||
#include "common/Communication.h"
|
||||
#include "common/MPI_Helpers.h"
|
||||
#include "ProfilerApp.h"
|
||||
@@ -42,15 +43,13 @@ public:
|
||||
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;
|
||||
std::shared_ptr<TwoPhase> Averages;
|
||||
|
||||
// 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;
|
||||
std::shared_ptr<Database> mrt_db;
|
||||
|
||||
IntArray Map;
|
||||
DoubleArray Distance;
|
||||
int *NeighborList;
|
||||
double *fq;
|
||||
double *Velocity;
|
||||
@@ -66,4 +65,4 @@ private:
|
||||
|
||||
//int rank,nprocs;
|
||||
void LoadParams(std::shared_ptr<Database> db0);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -30,10 +30,11 @@ int main(int argc, char **argv)
|
||||
printf("********************************************************\n");
|
||||
}
|
||||
|
||||
int i,j,k,n;
|
||||
ScaLBL_MRTModel MRT(rank,nprocs,comm);
|
||||
|
||||
auto filename = argv[1];
|
||||
MRT.ReadParams(filename);
|
||||
MRT.SetDomain();
|
||||
MRT.SetDomain(); // this reads in the domain
|
||||
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();
|
||||
|
||||
Reference in New Issue
Block a user