fix compiler warnings
This commit is contained in:
parent
c463c5182e
commit
f0f9d6405e
@ -2104,7 +2104,7 @@ double FlowAdaptor::UpdateFractionalFlow(ScaLBL_ColorModel &M){
|
|||||||
void FlowAdaptor::Flatten(ScaLBL_ColorModel &M){
|
void FlowAdaptor::Flatten(ScaLBL_ColorModel &M){
|
||||||
|
|
||||||
int Np = M.Np;
|
int Np = M.Np;
|
||||||
double dA, dB, phi;
|
double dA, dB;
|
||||||
|
|
||||||
double *Aq_tmp, *Bq_tmp;
|
double *Aq_tmp, *Bq_tmp;
|
||||||
|
|
||||||
|
@ -63,7 +63,6 @@ void ScaLBL_FreeLeeModel::getData_RegularLayout(const double *data, DoubleArray
|
|||||||
// Gets data (in optimized layout) from the HOST and stores in regular layout
|
// Gets data (in optimized layout) from the HOST and stores in regular layout
|
||||||
// Primarly for debugging
|
// Primarly for debugging
|
||||||
int i,j,k,idx;
|
int i,j,k,idx;
|
||||||
int n;
|
|
||||||
|
|
||||||
// initialize the array
|
// initialize the array
|
||||||
regdata.fill(0.f);
|
regdata.fill(0.f);
|
||||||
@ -72,7 +71,6 @@ void ScaLBL_FreeLeeModel::getData_RegularLayout(const double *data, DoubleArray
|
|||||||
for (k=0; k<Nz; k++){
|
for (k=0; k<Nz; k++){
|
||||||
for (j=0; j<Ny; j++){
|
for (j=0; j<Ny; j++){
|
||||||
for (i=0; i<Nx; i++){
|
for (i=0; i<Nx; i++){
|
||||||
n=k*Nx*Ny+j*Nx+i;
|
|
||||||
idx=Map(i,j,k);
|
idx=Map(i,j,k);
|
||||||
if (!(idx<0)){
|
if (!(idx<0)){
|
||||||
value=data[idx];
|
value=data[idx];
|
||||||
|
@ -150,7 +150,6 @@ void ScaLBL_GreyscaleModel::ReadInput(){
|
|||||||
// Generate the signed distance map
|
// Generate the signed distance map
|
||||||
// Initialize the domain and communication
|
// Initialize the domain and communication
|
||||||
Array<char> id_solid(Nx,Ny,Nz);
|
Array<char> id_solid(Nx,Ny,Nz);
|
||||||
int count = 0;
|
|
||||||
// Solve for the position of the solid phase
|
// Solve for the position of the solid phase
|
||||||
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++){
|
||||||
@ -167,7 +166,6 @@ void ScaLBL_GreyscaleModel::ReadInput(){
|
|||||||
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++){
|
||||||
for (int i=0;i<Nx;i++){
|
for (int i=0;i<Nx;i++){
|
||||||
int n=k*Nx*Ny+j*Nx+i;
|
|
||||||
// Initialize distance to +/- 1
|
// Initialize distance to +/- 1
|
||||||
SignDist(i,j,k) = 2.0*double(id_solid(i,j,k))-1.0;
|
SignDist(i,j,k) = 2.0*double(id_solid(i,j,k))-1.0;
|
||||||
}
|
}
|
||||||
@ -199,11 +197,13 @@ void ScaLBL_GreyscaleModel::AssignComponentLabels(double *Porosity, double *Perm
|
|||||||
ERROR("Error: ComponentLabels and PorosityList must be the same length! \n");
|
ERROR("Error: ComponentLabels and PorosityList must be the same length! \n");
|
||||||
}
|
}
|
||||||
|
|
||||||
double label_count[NLABELS];
|
|
||||||
double label_count_global[NLABELS];
|
|
||||||
// Assign the labels
|
// Assign the labels
|
||||||
|
double *label_count;
|
||||||
for (int idx=0; idx<NLABELS; idx++) label_count[idx]=0;
|
double *label_count_global;
|
||||||
|
label_count = new double [NLABELS];
|
||||||
|
label_count_global = new double [NLABELS];
|
||||||
|
|
||||||
|
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++){
|
||||||
@ -211,7 +211,7 @@ void ScaLBL_GreyscaleModel::AssignComponentLabels(double *Porosity, double *Perm
|
|||||||
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]){
|
||||||
POROSITY=PorosityList[idx];
|
POROSITY=PorosityList[idx];
|
||||||
@ -242,7 +242,7 @@ void ScaLBL_GreyscaleModel::AssignComponentLabels(double *Porosity, double *Perm
|
|||||||
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]){
|
||||||
PERMEABILITY=PermeabilityList[idx];
|
PERMEABILITY=PermeabilityList[idx];
|
||||||
@ -267,7 +267,7 @@ void ScaLBL_GreyscaleModel::AssignComponentLabels(double *Porosity, double *Perm
|
|||||||
// 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;
|
||||||
for (unsigned int idx=0; idx<NLABELS; idx++){
|
for (unsigned int idx=0; idx<NLABELS; idx++){
|
||||||
@ -598,7 +598,7 @@ void ScaLBL_GreyscaleModel::Run(){
|
|||||||
//double mass_loc,mass_glb;
|
//double mass_loc,mass_glb;
|
||||||
|
|
||||||
//parameters for domain average
|
//parameters for domain average
|
||||||
int64_t i,j,k,n,imin,jmin,kmin,kmax;
|
int64_t imin,jmin,kmin,kmax;
|
||||||
// If external boundary conditions are set, do not average over the inlet and outlet
|
// If external boundary conditions are set, do not average over the inlet and outlet
|
||||||
kmin=1; kmax=Nz-1;
|
kmin=1; kmax=Nz-1;
|
||||||
//In case user forgets to specify the inlet/outlet buffer layers for BC>0
|
//In case user forgets to specify the inlet/outlet buffer layers for BC>0
|
||||||
@ -691,23 +691,22 @@ void ScaLBL_GreyscaleModel::Run(){
|
|||||||
//double absperm = h*h*mu*Mask->Porosity()*flow_rate / force_mag;
|
//double absperm = h*h*mu*Mask->Porosity()*flow_rate / force_mag;
|
||||||
double absperm = h*h*mu*GreyPorosity*flow_rate / force_mag;
|
double absperm = h*h*mu*GreyPorosity*flow_rate / force_mag;
|
||||||
|
|
||||||
if (rank==0){
|
if (rank==0){
|
||||||
printf(" AbsPerm = %.5g [micron^2]\n",absperm);
|
printf(" AbsPerm = %.5g [micron^2]\n",absperm);
|
||||||
bool WriteHeader=false;
|
bool WriteHeader=false;
|
||||||
FILE * log_file = fopen("Permeability.csv","r");
|
FILE * log_file = fopen("Permeability.csv","r");
|
||||||
if (log_file != NULL)
|
if (log_file != NULL)
|
||||||
fclose(log_file);
|
fclose(log_file);
|
||||||
else
|
else
|
||||||
WriteHeader=true;
|
WriteHeader=true;
|
||||||
log_file = fopen("Permeability.csv","a");
|
log_file = fopen("Permeability.csv","a");
|
||||||
if (WriteHeader)
|
if (WriteHeader)
|
||||||
fprintf(log_file,"timestep Fx Fy Fz mu Vs As Hs Xs vax vay vaz AbsPerm \n",
|
fprintf(log_file,"timestep Fx Fy Fz mu Vs As Hs Xs vax vay vaz AbsPerm \n");
|
||||||
timestep,Fx,Fy,Fz,mu,h*h*h*Vs,h*h*As,h*Hs,Xs,vax,vay,vaz,absperm);
|
|
||||||
|
|
||||||
fprintf(log_file,"%i %.8g %.8g %.8g %.8g %.8g %.8g %.8g %.8g %.8g %.8g %.8g %.8g\n",timestep, Fx, Fy, Fz, mu,
|
fprintf(log_file,"%i %.8g %.8g %.8g %.8g %.8g %.8g %.8g %.8g %.8g %.8g %.8g %.8g\n",timestep, Fx, Fy, Fz, mu,
|
||||||
h*h*h*Vs,h*h*As,h*Hs,Xs,vax,vay,vaz, absperm);
|
h*h*h*Vs,h*h*As,h*Hs,Xs,vax,vay,vaz, absperm);
|
||||||
fclose(log_file);
|
fclose(log_file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (timestep%visualization_interval==0){
|
if (timestep%visualization_interval==0){
|
||||||
|
Loading…
Reference in New Issue
Block a user