added tolerance to MRT
This commit is contained in:
parent
9136b9fc20
commit
52995e2b8a
@ -21,10 +21,19 @@ void ScaLBL_MRTModel::ReadParams(string filename){
|
|||||||
domain_db = db->getDatabase( "Domain" );
|
domain_db = db->getDatabase( "Domain" );
|
||||||
mrt_db = db->getDatabase( "MRT" );
|
mrt_db = db->getDatabase( "MRT" );
|
||||||
|
|
||||||
|
tau = 1.0;
|
||||||
|
timestepMax = 100000;
|
||||||
|
tolerance = 0.01;
|
||||||
|
Fx = Fy = 0.0;
|
||||||
|
Fz = 1.0e-5;
|
||||||
|
|
||||||
// Color Model parameters
|
// Color Model parameters
|
||||||
if (mrt_db->keyExists( "timestepMax" )){
|
if (mrt_db->keyExists( "timestepMax" )){
|
||||||
timestepMax = mrt_db->getScalar<int>( "timestepMax" );
|
timestepMax = mrt_db->getScalar<int>( "timestepMax" );
|
||||||
}
|
}
|
||||||
|
if (mrt_db->keyExists( "tolerance" )){
|
||||||
|
tolerance = mrt_db->getScalar<int>( "timestepMax" );
|
||||||
|
}
|
||||||
if (mrt_db->keyExists( "tau" )){
|
if (mrt_db->keyExists( "tau" )){
|
||||||
tau = mrt_db->getScalar<double>( "tau" );
|
tau = mrt_db->getScalar<double>( "tau" );
|
||||||
}
|
}
|
||||||
@ -197,7 +206,9 @@ void ScaLBL_MRTModel::Run(){
|
|||||||
if (rank==0) printf("Beginning AA timesteps...\n");
|
if (rank==0) printf("Beginning AA timesteps...\n");
|
||||||
if (rank==0) printf("********************************************************\n");
|
if (rank==0) printf("********************************************************\n");
|
||||||
timestep=0;
|
timestep=0;
|
||||||
while (timestep < timestepMax) {
|
double error = 1.0;
|
||||||
|
double flow_rate_previous = 0.0;
|
||||||
|
while (timestep < timestepMax || error < tolerance) {
|
||||||
//************************************************************************/
|
//************************************************************************/
|
||||||
timestep++;
|
timestep++;
|
||||||
ScaLBL_Comm->SendD3Q19AA(fq); //READ FROM NORMAL
|
ScaLBL_Comm->SendD3Q19AA(fq); //READ FROM NORMAL
|
||||||
@ -259,6 +270,9 @@ void ScaLBL_MRTModel::Run(){
|
|||||||
}
|
}
|
||||||
double flow_rate = (vax*dir_x + vay*dir_y + vaz*dir_z);
|
double flow_rate = (vax*dir_x + vay*dir_y + vaz*dir_z);
|
||||||
|
|
||||||
|
error = fabs(flow_rate - flow_rate_previous) / flow_rate;
|
||||||
|
flow_rate_previous = flow_rate;
|
||||||
|
|
||||||
//if (rank==0) printf("Computing Minkowski functionals \n");
|
//if (rank==0) printf("Computing Minkowski functionals \n");
|
||||||
Morphology.ComputeScalar(Distance,0.f);
|
Morphology.ComputeScalar(Distance,0.f);
|
||||||
//Morphology.PrintAll();
|
//Morphology.PrintAll();
|
||||||
|
@ -36,6 +36,7 @@ public:
|
|||||||
double tau,mu;
|
double tau,mu;
|
||||||
double Fx,Fy,Fz,flux;
|
double Fx,Fy,Fz,flux;
|
||||||
double din,dout;
|
double din,dout;
|
||||||
|
double tolerance;
|
||||||
|
|
||||||
int Nx,Ny,Nz,N,Np;
|
int Nx,Ny,Nz,N,Np;
|
||||||
int rank,nprocx,nprocy,nprocz,nprocs;
|
int rank,nprocx,nprocy,nprocz,nprocs;
|
||||||
|
Loading…
Reference in New Issue
Block a user