troubleshoot bug with flooding protocol

This commit is contained in:
James McClure 2021-06-23 13:21:38 -04:00
parent 252faa584b
commit 66ac708cfb

View File

@ -198,6 +198,7 @@ void ScaLBL_ColorModel::ReadParams(string filename){
domain_db->putScalar<int>( "BC", BoundaryCondition );
}
else if (protocol == "core flooding"){
if (rank == 0) printf("Using core flooding protocol \n");
if (BoundaryCondition != 4){
BoundaryCondition = 4;
if (rank==0) printf("WARNING: protocol (core flooding) supports only volumetric flux boundary condition \n");
@ -205,11 +206,12 @@ void ScaLBL_ColorModel::ReadParams(string filename){
domain_db->putScalar<int>( "BC", BoundaryCondition );
if (color_db->keyExists( "capillary_number" )){
double capillary_number = color_db->getScalar<double>( "capillary_number" );
if (rank==0) printf(" set flux to achieve Ca=%f \n", capillary_number);
double MuB = rhoB*(tauB - 0.5)/3.0;
double IFT = 6.0*alpha;
double CrossSectionalArea = (double) (nprocx*(Nx-2)*nprocy*(Ny-2));
flux = Dm->Porosity()*CrossSectionalArea*IFT*capillary_number/MuB;
if (rank==0) printf(" protocol (core flooding): set flux=%f to achieve Ca=%f \n",flux, capillary_number);
//double CrossSectionalArea = (double) (nprocx*(Nx-2)*nprocy*(Ny-2));
flux = Dm->Porosity()*nprocx*(Nx-2)*nprocy*(Ny-2)*IFT*capillary_number/MuB;
if (rank==0) printf(" flux=%f \n",flux);
}
color_db->putScalar<double>( "flux", flux );
}