This commit is contained in:
Mark A. Berrill 2014-03-05 17:04:42 -05:00
commit 7f80b2d6f2
7 changed files with 2446 additions and 24 deletions

View File

@ -14,6 +14,8 @@
#include "Color.h"
#include "Communication.h"
#define CBUB
using namespace std;
//*************************************************************************
@ -130,7 +132,7 @@ int main(int argc, char **argv)
int timestepMax, interval;
double tau,Fx,Fy,Fz,tol;
double alpha, beta;
double das, dbs, xIntPos;
double das, dbs, phi_s;
double din,dout;
double wp_saturation;
bool pBC,Restart;
@ -160,7 +162,7 @@ int main(int argc, char **argv)
input >> tau; // Viscosity parameter
input >> alpha; // Surface Tension parameter
input >> beta; // Width of the interface
input >> xIntPos; // Contact angle parameter
input >> phi_s; // value of phi at the solid surface
// input >> das;
// input >> dbs;
// Line 4: wetting phase saturation to initialize
@ -208,7 +210,7 @@ int main(int argc, char **argv)
MPI_Bcast(&beta,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
MPI_Bcast(&das,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
MPI_Bcast(&dbs,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
MPI_Bcast(&xIntPos,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
MPI_Bcast(&phi_s,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
MPI_Bcast(&wp_saturation,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
MPI_Bcast(&pBC,1,MPI_LOGICAL,0,MPI_COMM_WORLD);
MPI_Bcast(&Restart,1,MPI_LOGICAL,0,MPI_COMM_WORLD);
@ -238,6 +240,8 @@ int main(int argc, char **argv)
double Ps = -(das-dbs)/(das+dbs);
double rlxA = 1.f/tau;
double rlxB = 8.f*(2.f-rlxA)/(8.f-rlxA);
double xIntPos;
xIntPos = log((1.0+phi_s)/(1.0-phi_s))/(2.0*beta);
if (nprocs != nprocx*nprocy*nprocz){
printf("Fatal error in processor number! \n");
@ -253,9 +257,10 @@ int main(int argc, char **argv)
printf("beta = %f \n", beta);
printf("das = %f \n", das);
printf("dbs = %f \n", dbs);
printf("phi_s = %f \n", Ps);
printf("gamma_{wn} = %f \n", 6.01603*alpha);
printf("cos theta_c = %f \n", 1.05332*Ps);
printf("Value of phi at solid surface = %f \n", phi_s);
printf("Distance to phi = 0.0: %f \n", xIntPos);
printf("gamma_{wn} = %f \n", 5.796*alpha);
// printf("cos theta_c = %f \n", 1.05332*Ps);
printf("Force(x) = %f \n", Fx);
printf("Force(y) = %f \n", Fy);
printf("Force(z) = %f \n", Fz);
@ -268,6 +273,7 @@ int main(int argc, char **argv)
rank_x, rank_y, rank_z, rank_X, rank_Y, rank_Z,
rank_xy, rank_XY, rank_xY, rank_Xy, rank_xz, rank_XZ, rank_xZ, rank_Xz,
rank_yz, rank_YZ, rank_yZ, rank_Yz );
MPI_Barrier(MPI_COMM_WORLD);
Nz += 2;
@ -360,7 +366,7 @@ int main(int argc, char **argv)
id[n] = 2;
sum++;
}
else if (k<BubbleTop && rank == 0){
else if (k<BubbleTop && rank == 0 && pBC == 0){
id[n] = 1;
sum++;
}
@ -1147,7 +1153,7 @@ int main(int argc, char **argv)
//......................................................................
// Once phase has been initialized, map solid to account for 'smeared' interface
//......................................................................
for (i=0; i<N; i++) SignDist.data[i] -= xIntPos; // Solid appears half a pixel bigger
for (i=0; i<N; i++) SignDist.data[i] -= (1.0); //
//......................................................................
//.......................................................................
sprintf(LocalRankString,"%05d",rank);

View File

@ -0,0 +1,14 @@
#!/bin/bash
#PBS -l walltime=05:00:00
#PBS -l nodes=1:ppn=1:mic
#PBS -W group_list=arcadm
#PBS -q normal_q
#PBS -A blueridgetest
cd $PBS_O_WORKDIR
#mpirun -np 1 ~/save-LBPM-WIA/cpu/ColorLBM-CBUB
mpirun -np 1 ~/install-LBPM-WIA/tests/TestBubble
exit;

6
example/Bubble/Color.in Normal file
View File

@ -0,0 +1,6 @@
1.0
1.0e-2 0.95 0.1 0.9
0.7
0.0 0.0 0.0
0 0 1.0 1.0
20000 1000 1e-5

4
example/Bubble/Domain.in Normal file
View File

@ -0,0 +1,4 @@
1 1 1
80 80 80
229
1.0 1.0 1.0

View File

@ -4,6 +4,7 @@ CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/cylindertest ${CMAKE_CURRENT_BINARY_
# Add the tests
ADD_LBPM_TEST( pmmc_cylinder )
ADD_LBPM_TEST( TestBubble )
ADD_LBPM_TEST( TestCylinderAreas )
ADD_LBPM_TEST( TestSphereCurvature )
ADD_LBPM_TEST_1_2_4( testCommunication )

2388
tests/TestBubble.cpp Normal file

File diff suppressed because it is too large Load Diff

View File

@ -12,8 +12,9 @@
#include "D3Q19.h"
#include "D3Q7.h"
#include "Color.h"
#include "common/Communication.h"
#include "common/Utilities.h"
#include "Communication.h"
#define CBUB
using namespace std;
@ -100,8 +101,6 @@ int main(int argc, char **argv)
MPI_Init(&argc,&argv);
MPI_Comm_rank(MPI_COMM_WORLD,&rank);
MPI_Comm_size(MPI_COMM_WORLD,&nprocs);
// Initialize error handlers
Utilities::setErrorHandlers();
// parallel domain size (# of sub-domains)
int nprocx,nprocy,nprocz;
int iproc,jproc,kproc;
@ -133,7 +132,7 @@ int main(int argc, char **argv)
int timestepMax, interval;
double tau,Fx,Fy,Fz,tol;
double alpha, beta;
double das, dbs, xIntPos;
double das, dbs, phi_s;
double din,dout;
double wp_saturation;
bool pBC,Restart;
@ -163,7 +162,7 @@ int main(int argc, char **argv)
input >> tau; // Viscosity parameter
input >> alpha; // Surface Tension parameter
input >> beta; // Width of the interface
input >> xIntPos; // Contact angle parameter
input >> phi_s; // value of phi at the solid surface
// input >> das;
// input >> dbs;
// Line 4: wetting phase saturation to initialize
@ -211,7 +210,7 @@ int main(int argc, char **argv)
MPI_Bcast(&beta,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
MPI_Bcast(&das,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
MPI_Bcast(&dbs,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
MPI_Bcast(&xIntPos,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
MPI_Bcast(&phi_s,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
MPI_Bcast(&wp_saturation,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
MPI_Bcast(&pBC,1,MPI_LOGICAL,0,MPI_COMM_WORLD);
MPI_Bcast(&Restart,1,MPI_LOGICAL,0,MPI_COMM_WORLD);
@ -241,6 +240,8 @@ int main(int argc, char **argv)
double Ps = -(das-dbs)/(das+dbs);
double rlxA = 1.f/tau;
double rlxB = 8.f*(2.f-rlxA)/(8.f-rlxA);
double xIntPos;
xIntPos = log((1.0+phi_s)/(1.0-phi_s))/(2.0*beta);
if (nprocs != nprocx*nprocy*nprocz){
printf("Fatal error in processor number! \n");
@ -256,9 +257,10 @@ int main(int argc, char **argv)
printf("beta = %f \n", beta);
printf("das = %f \n", das);
printf("dbs = %f \n", dbs);
printf("phi_s = %f \n", Ps);
printf("gamma_{wn} = %f \n", 6.01603*alpha);
printf("cos theta_c = %f \n", 1.05332*Ps);
printf("Value of phi at solid surface = %f \n", phi_s);
printf("Distance to phi = 0.0: %f \n", xIntPos);
printf("gamma_{wn} = %f \n", 5.796*alpha);
// printf("cos theta_c = %f \n", 1.05332*Ps);
printf("Force(x) = %f \n", Fx);
printf("Force(y) = %f \n", Fy);
printf("Force(z) = %f \n", Fz);
@ -271,6 +273,7 @@ int main(int argc, char **argv)
rank_x, rank_y, rank_z, rank_X, rank_Y, rank_Z,
rank_xy, rank_XY, rank_xY, rank_Xy, rank_xz, rank_XZ, rank_xZ, rank_Xz,
rank_yz, rank_YZ, rank_yZ, rank_Yz );
MPI_Barrier(MPI_COMM_WORLD);
Nz += 2;
@ -363,7 +366,7 @@ int main(int argc, char **argv)
id[n] = 2;
sum++;
}
else if (k<BubbleTop && rank == 0){
else if (k<BubbleTop && rank == 0 && pBC == 0){
id[n] = 1;
sum++;
}
@ -1150,7 +1153,7 @@ int main(int argc, char **argv)
//......................................................................
// Once phase has been initialized, map solid to account for 'smeared' interface
//......................................................................
for (i=0; i<N; i++) SignDist.data[i] -= xIntPos; // Solid appears half a pixel bigger
for (i=0; i<N; i++) SignDist.data[i] -= (1.0); //
//......................................................................
//.......................................................................
sprintf(LocalRankString,"%05d",rank);