Modified TestBubble so that input files can be used, but test will not fail if input files are not there
This commit is contained in:
1 parent
e4e75725d9
commit
9a42a7593c
1 file changed
+54
-56
+54
-56
@@ -153,65 +153,63 @@ int main(int argc, char **argv)
|
||||
//.............................................................
|
||||
// READ SIMULATION PARMAETERS FROM INPUT FILE
|
||||
//.............................................................
|
||||
//ifstream input("Color.in");
|
||||
|
||||
// Line 3: model parameters (tau, alpha, beta, das, dbs)
|
||||
//input >> tau; // Viscosity parameter
|
||||
//input >> alpha; // Surface Tension parameter
|
||||
//input >> beta; // Width of the interface
|
||||
//input >> phi_s; // value of phi at the solid surface
|
||||
|
||||
tau=1.0; alpha=1e-3; beta=0.95, phi_s=0.0;
|
||||
|
||||
// Line 4: wetting phase saturation to initialize
|
||||
//input >> wp_saturation;
|
||||
// Line 5: External force components (Fx,Fy, Fz)
|
||||
//input >> Fx;
|
||||
//input >> Fy;
|
||||
//input >> Fz;
|
||||
|
||||
wp_saturation=Fx=Fy=Fz=0;
|
||||
|
||||
// Line 6: Pressure Boundary conditions
|
||||
//input >> Restart;
|
||||
//input >> pBC;
|
||||
//input >> din;
|
||||
//input >> dout;
|
||||
|
||||
Restart=0; pBC=0;
|
||||
din=dout=1.0;
|
||||
|
||||
// Line 7: time-stepping criteria
|
||||
//input >> timestepMax; // max no. of timesteps
|
||||
//input >> interval; // error interval
|
||||
//input >> tol; // error tolerance
|
||||
timestepMax=100;
|
||||
interval=100;
|
||||
tol=1e-6;
|
||||
das = 0.1; dbs = 0.9; // hard coded for density initialization
|
||||
// should be OK to remove these parameters
|
||||
// they should have no impact with the
|
||||
// current boundary condition
|
||||
ifstream input("Color.in");
|
||||
if (input.good()){
|
||||
input >> tau; // Viscosity parameter
|
||||
input >> alpha; // Surface Tension parameter
|
||||
input >> beta; // Width of the interface
|
||||
input >> phi_s; // value of phi at the solid surface
|
||||
input >> wp_saturation;
|
||||
input >> Fx;
|
||||
input >> Fy;
|
||||
input >> Fz;
|
||||
input >> InitialCondition;
|
||||
input >> BoundaryCondition;
|
||||
input >> din;
|
||||
input >> dout;
|
||||
input >> timestepMax; // max no. of timesteps
|
||||
input >> interval; // restart interval
|
||||
input >> tol; // error tolerance
|
||||
}
|
||||
else {
|
||||
printf("WARNING: No valid Color.in file, using hard-coded values \n");
|
||||
tau=1.0; alpha=1e-3; beta=0.95, phi_s=0.0;
|
||||
wp_saturation=Fx=Fy=Fz=0;
|
||||
Restart=0; pBC=0;
|
||||
din=dout=1.0;
|
||||
timestepMax=100;
|
||||
interval=100;
|
||||
tol=1e-6;
|
||||
das = 0.1; dbs = 0.9; // hard coded for density initialization
|
||||
// should be OK to remove these parameters
|
||||
// they should have no impact with the
|
||||
// current boundary condition
|
||||
}
|
||||
//.......................................................................
|
||||
// Reading the domain information file
|
||||
//.......................................................................
|
||||
//ifstream domain("Domain.in");
|
||||
//domain >> nprocx;
|
||||
//domain >> nprocy;
|
||||
//domain >> nprocz;
|
||||
//domain >> Nx;
|
||||
//domain >> Ny;
|
||||
//domain >> Nz;
|
||||
//domain >> nspheres;
|
||||
//domain >> Lx;
|
||||
//domain >> Ly;
|
||||
//domain >> Lz;
|
||||
//.......................................................................
|
||||
// Set the domain for single processor test
|
||||
nprocx=nprocy=nprocz=1;
|
||||
Nx=Ny=Nz=50;
|
||||
nspheres=1;
|
||||
Lx=Ly=Lz=1;
|
||||
ifstream domain("Domain.in");
|
||||
if (domain.good()){
|
||||
domain >> nprocx;
|
||||
domain >> nprocy;
|
||||
domain >> nprocz;
|
||||
domain >> Nx;
|
||||
domain >> Ny;
|
||||
domain >> Nz;
|
||||
domain >> nspheres;
|
||||
domain >> Lx;
|
||||
domain >> Ly;
|
||||
domain >> Lz;
|
||||
}
|
||||
else {
|
||||
//.......................................................................
|
||||
// Set the domain for single processor test
|
||||
printf("WARNING: No valid Domain.in file, using hard-coded values \n");
|
||||
nprocx=nprocy=nprocz=1;
|
||||
Nx=Ny=Nz=50;
|
||||
nspheres=1;
|
||||
Lx=Ly=Lz=1;
|
||||
}
|
||||
|
||||
}
|
||||
// **************************************************************
|
||||
|
||||
Reference in new issue
Block a user