removing warnings and errors

This commit is contained in:
James McClure
2021-08-31 07:55:43 -04:00
parent f908e6f8ee
commit 60f4883885
3 changed files with 1667 additions and 1669 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1418,6 +1418,7 @@ extern "C" void ScaLBL_D3Q19_AAodd_GreyscaleColor_CP(int *neighborList, int *Map
rlx_setB = 8.f*(2.f-rlx_setA)/(8.f-rlx_setA); rlx_setB = 8.f*(2.f-rlx_setA)/(8.f-rlx_setA);
mu_eff = (tau_eff-0.5)/3.0;//kinematic viscosity mu_eff = (tau_eff-0.5)/3.0;//kinematic viscosity
mobility_ratio = 1.0;
if (nA/(nA+nB)<Sn_grey && porosity !=1.0){ if (nA/(nA+nB)<Sn_grey && porosity !=1.0){
perm = Kw_grey; perm = Kw_grey;
Swn = 0.0; Swn = 0.0;
@@ -1428,12 +1429,14 @@ extern "C" void ScaLBL_D3Q19_AAodd_GreyscaleColor_CP(int *neighborList, int *Map
Krw_grey = Kw_grey*(1.0-Swn)*(1.0-Swn); // Corey model with exponent = 2, make sure that W cannot shift to zero Krw_grey = Kw_grey*(1.0-Swn)*(1.0-Swn); // Corey model with exponent = 2, make sure that W cannot shift to zero
// recompute the effective permeability // recompute the effective permeability
perm = mu_eff*(Krn_grey*3.0/(tauA-0.5) + Krw_grey*3.0/(tauA-0.5)); perm = mu_eff*(Krn_grey*3.0/(tauA-0.5) + Krw_grey*3.0/(tauA-0.5));
mobility_ratio =(nA*Krn_grey*3.0/(tauA-0.5) - nB*Krw_grey*3.0/(tauB-0.5))/(nA*Krn_grey*3.0/(tauA-0.5) + nB*Krw_grey*3.0/(tauB-0.5)); //mobility_ratio =(nA*Krn_grey*3.0/(tauA-0.5) - nB*Krw_grey*3.0/(tauB-0.5))/(nA*Krn_grey*3.0/(tauA-0.5) + nB*Krw_grey*3.0/(tauB-0.5));
} }
else if (nA/(nA+nB)>Sw_grey && porosity !=1.0){ else if (nA/(nA+nB)>Sw_grey && porosity !=1.0){
perm = Kn_grey; perm = Kn_grey;
Swn = 1.0; Swn = 1.0;
} }
mobility_ratio =(nA*Krn_grey*3.0/(tauA-0.5) - nB*Krw_grey*3.0/(tauB-0.5))/(nA*Krn_grey*3.0/(tauA-0.5) + nB*Krw_grey*3.0/(tauB-0.5));
// Get the 1D index based on regular data layout // Get the 1D index based on regular data layout
ijk = Map[n]; ijk = Map[n];
// COMPUTE THE COLOR GRADIENT // COMPUTE THE COLOR GRADIENT
@@ -2260,12 +2263,14 @@ extern "C" void ScaLBL_D3Q19_AAeven_GreyscaleColor_CP(int *Map, double *dist, do
Krw_grey = Kw_grey*(1.0-Swn)*(1.0-Swn); // Corey model with exponent = 2, make sure that W cannot shift to zero Krw_grey = Kw_grey*(1.0-Swn)*(1.0-Swn); // Corey model with exponent = 2, make sure that W cannot shift to zero
// recompute the effective permeability // recompute the effective permeability
perm = mu_eff*(Krn_grey*3.0/(tauA-0.5) + Krw_grey*3.0/(tauA-0.5)); perm = mu_eff*(Krn_grey*3.0/(tauA-0.5) + Krw_grey*3.0/(tauA-0.5));
mobility_ratio =(nA*Krn_grey*3.0/(tauA-0.5) - nB*Krw_grey*3.0/(tauB-0.5))/(nA*Krn_grey*3.0/(tauA-0.5) + nB*Krw_grey*3.0/(tauB-0.5)); //mobility_ratio =(nA*Krn_grey*3.0/(tauA-0.5) - nB*Krw_grey*3.0/(tauB-0.5))/(nA*Krn_grey*3.0/(tauA-0.5) + nB*Krw_grey*3.0/(tauB-0.5));
} }
else if (nA/(nA+nB)>Sw_grey && porosity !=1.0){ else if (nA/(nA+nB)>Sw_grey && porosity !=1.0){
perm = Kn_grey; perm = Kn_grey;
Swn = 1.0; Swn = 1.0;
} }
mobility_ratio =(nA*Krn_grey*3.0/(tauA-0.5) - nB*Krw_grey*3.0/(tauB-0.5))/(nA*Krn_grey*3.0/(tauA-0.5) + nB*Krw_grey*3.0/(tauB-0.5));
// Get the 1D index based on regular data layout // Get the 1D index based on regular data layout
ijk = Map[n]; ijk = Map[n];
// COMPUTE THE COLOR GRADIENT // COMPUTE THE COLOR GRADIENT

View File

@@ -246,8 +246,10 @@ void ScaLBL_GreyscaleColorModel::AssignComponentLabels()
ERROR("Error: ComponentLabels and ComponentAffinity must be the same length! \n"); ERROR("Error: ComponentLabels and ComponentAffinity must be the same length! \n");
} }
double label_count[NLABELS]; double * label_count;
double label_count_global[NLABELS]; double *label_count_global;
label_count = new double [NLABELS];
label_count_global = new double [NLABELS];
// Assign the labels // Assign the labels
for (size_t idx=0; idx<NLABELS; idx++) label_count[idx]=0; for (size_t idx=0; idx<NLABELS; idx++) label_count[idx]=0;
@@ -258,7 +260,7 @@ void ScaLBL_GreyscaleColorModel::AssignComponentLabels()
int n = k*Nx*Ny+j*Nx+i; int n = k*Nx*Ny+j*Nx+i;
VALUE=id[n]; VALUE=id[n];
// Assign the affinity from the paired list // Assign the affinity from the paired list
for (unsigned int idx=0; idx < NLABELS; idx++){ for (size_t idx=0; idx < NLABELS; idx++){
//printf("idx=%i, value=%i, %i, \n",idx, VALUE,LabelList[idx]); //printf("idx=%i, value=%i, %i, \n",idx, VALUE,LabelList[idx]);
if (VALUE == LabelList[idx]){ if (VALUE == LabelList[idx]){
AFFINITY=AffinityList[idx]; AFFINITY=AffinityList[idx];
@@ -346,6 +348,8 @@ void ScaLBL_GreyscaleColorModel::AssignGreySolidLabels()//apply capillary penalt
AFFINITY=0.f;//all nodes except the specified grey nodes have grey-solid affinity = 0.0 AFFINITY=0.f;//all nodes except the specified grey nodes have grey-solid affinity = 0.0
Sn=99.0; Sn=99.0;
Sw=-99.0; Sw=-99.0;
Kn = 0.0;
Kw = 0.0;
// Assign the affinity from the paired list // Assign the affinity from the paired list
for (unsigned int idx=0; idx < NLABELS; idx++){ for (unsigned int idx=0; idx < NLABELS; idx++){
if (VALUE == LabelList[idx]){ if (VALUE == LabelList[idx]){
@@ -416,11 +420,13 @@ void ScaLBL_GreyscaleColorModel::AssignGreyPoroPermLabels()
ERROR("Error: GreySolidLabels and PorosityList must be the same length! \n"); ERROR("Error: GreySolidLabels and PorosityList must be the same length! \n");
} }
double label_count[NLABELS]; double * label_count;
double label_count_global[NLABELS]; double * label_count_global;
label_count = new double [NLABELS];
label_count_global = new double [NLABELS];
// Assign the labels // Assign the labels
for (int idx=0; idx<NLABELS; idx++) label_count[idx]=0; for (size_t idx=0; idx<NLABELS; idx++) label_count[idx]=0;
for (int k=0;k<Nz;k++){ for (int k=0;k<Nz;k++){
for (int j=0;j<Ny;j++){ for (int j=0;j<Ny;j++){
@@ -429,7 +435,7 @@ void ScaLBL_GreyscaleColorModel::AssignGreyPoroPermLabels()
VALUE=id[n]; VALUE=id[n];
POROSITY=1.f;//default: label 1 or 2, i.e. open nodes and porosity=1.0 POROSITY=1.f;//default: label 1 or 2, i.e. open nodes and porosity=1.0
// Assign the affinity from the paired list // Assign the affinity from the paired list
for (unsigned int idx=0; idx < NLABELS; idx++){ for (size_t idx=0; idx < NLABELS; idx++){
//printf("idx=%i, value=%i, %i, \n",idx, VALUE,LabelList[idx]); //printf("idx=%i, value=%i, %i, \n",idx, VALUE,LabelList[idx]);
if (VALUE == LabelList[idx]){ if (VALUE == LabelList[idx]){
POROSITY=PorosityList[idx]; POROSITY=PorosityList[idx];
@@ -486,7 +492,7 @@ void ScaLBL_GreyscaleColorModel::AssignGreyPoroPermLabels()
// Set Dm to match Mask // Set Dm to match Mask
for (int i=0; i<Nx*Ny*Nz; i++) Dm->id[i] = Mask->id[i]; for (int i=0; i<Nx*Ny*Nz; i++) Dm->id[i] = Mask->id[i];
for (int idx=0; idx<NLABELS; idx++) label_count_global[idx]=Dm->Comm.sumReduce( label_count[idx]); for (size_t idx=0; idx<NLABELS; idx++) label_count_global[idx]=Dm->Comm.sumReduce( label_count[idx]);
//Initialize a weighted porosity after considering grey voxels //Initialize a weighted porosity after considering grey voxels
GreyPorosity=0.0; GreyPorosity=0.0;
@@ -790,7 +796,6 @@ void ScaLBL_GreyscaleColorModel::Run(){
bool USE_MORPH = false; bool USE_MORPH = false;
bool USE_SEED = false; bool USE_SEED = false;
bool USE_DIRECT = false; bool USE_DIRECT = false;
bool USE_MORPHOPEN_OIL = false;
int MAX_MORPH_TIMESTEPS = 50000; // maximum number of LBM timesteps to spend in morphological adaptation routine int MAX_MORPH_TIMESTEPS = 50000; // maximum number of LBM timesteps to spend in morphological adaptation routine
int MIN_STEADY_TIMESTEPS = 100000; int MIN_STEADY_TIMESTEPS = 100000;
int MAX_STEADY_TIMESTEPS = 200000; int MAX_STEADY_TIMESTEPS = 200000;
@@ -931,7 +936,6 @@ void ScaLBL_GreyscaleColorModel::Run(){
//************ MAIN ITERATION LOOP ***************************************/ //************ MAIN ITERATION LOOP ***************************************/
PROFILE_START("Loop"); PROFILE_START("Loop");
//std::shared_ptr<Database> analysis_db; //std::shared_ptr<Database> analysis_db;
bool Regular = false;
auto current_db = db->cloneDatabase(); auto current_db = db->cloneDatabase();
//runAnalysis analysis( current_db, rank_info, ScaLBL_Comm, Dm, Np, Regular, Map ); //runAnalysis analysis( current_db, rank_info, ScaLBL_Comm, Dm, Np, Regular, Map );
//analysis.createThreads( analysis_method, 4 ); //analysis.createThreads( analysis_method, 4 );
@@ -1133,14 +1137,7 @@ void ScaLBL_GreyscaleColorModel::Run(){
double muA = rhoA*(tauA-0.5)/3.f; double muA = rhoA*(tauA-0.5)/3.f;
double muB = rhoB*(tauB-0.5)/3.f; double muB = rhoB*(tauB-0.5)/3.f;
double force_mag = sqrt(Fx*Fx+Fy*Fy+Fz*Fz); double force_mag = sqrt(Fx*Fx+Fy*Fy+Fz*Fz);
double dir_x = Fx/force_mag;
double dir_y = Fy/force_mag;
double dir_z = Fz/force_mag;
if (force_mag == 0.0){ if (force_mag == 0.0){
// default to z direction
dir_x = 0.0;
dir_y = 0.0;
dir_z = 1.0;
force_mag = 1.0; force_mag = 1.0;
} }
double current_saturation = Averages->saturation; double current_saturation = Averages->saturation;