update I/O format options to include hdf5
This commit is contained in:
@@ -754,7 +754,6 @@ double ScaLBL_ColorModel::Run(int returntime){
|
||||
timestep = INITIAL_TIMESTEP;
|
||||
TRIGGER_FORCE_RESCALE = true;
|
||||
if (rank == 0) printf(" Capillary number missed target value = %f (measured value was Ca = %f) \n ",capillary_number, Ca);
|
||||
|
||||
}
|
||||
|
||||
if (RESCALE_FORCE == true && SET_CAPILLARY_NUMBER == true && CURRENT_TIMESTEP > RESCALE_FORCE_AFTER_TIMESTEP){
|
||||
@@ -925,198 +924,7 @@ void ScaLBL_ColorModel::Run(){
|
||||
if (analysis_db->keyExists( "analysis_interval" )){
|
||||
analysis_interval = analysis_db->getScalar<int>( "analysis_interval" );
|
||||
}
|
||||
/*
|
||||
int IMAGE_INDEX = 0;
|
||||
int IMAGE_COUNT = 0;
|
||||
std::vector<std::string> ImageList;
|
||||
bool SET_CAPILLARY_NUMBER = false;
|
||||
bool RESCALE_FORCE = false;
|
||||
bool MORPH_ADAPT = false;
|
||||
bool USE_MORPH = false;
|
||||
bool USE_SEED = 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 MIN_STEADY_TIMESTEPS = 100000;
|
||||
int MAX_STEADY_TIMESTEPS = 200000;
|
||||
int RESCALE_FORCE_AFTER_TIMESTEP = 0;
|
||||
int RAMP_TIMESTEPS = 0;//50000; // number of timesteps to run initially (to get a reasonable velocity field before other pieces kick in)
|
||||
int CURRENT_MORPH_TIMESTEPS=0; // counter for number of timesteps spent in morphological adaptation routine (reset each time)
|
||||
int CURRENT_STEADY_TIMESTEPS=0; // counter for number of timesteps spent in morphological adaptation routine (reset each time)
|
||||
int morph_interval = 100000;
|
||||
int morph_timesteps = 0;
|
||||
double morph_delta = 0.0;
|
||||
double seed_water = 0.0;
|
||||
double capillary_number = 0.0;
|
||||
double tolerance = 0.01;
|
||||
double Ca_previous = 0.f;
|
||||
double initial_volume = 0.0;
|
||||
double delta_volume = 0.0;
|
||||
double delta_volume_target = 0.0;
|
||||
|
||||
double KRA_MORPH_FACTOR=0.5;
|
||||
double volA_prev = 0.0;
|
||||
double log_krA_prev = 1.0;
|
||||
double log_krA_target = 1.0;
|
||||
double log_krA = 1.0;
|
||||
double slope_krA_volume = 0.0;
|
||||
if (color_db->keyExists( "vol_A_previous" )){
|
||||
volA_prev = color_db->getScalar<double>( "vol_A_previous" );
|
||||
}
|
||||
if (color_db->keyExists( "log_krA_previous" )){
|
||||
log_krA_prev = color_db->getScalar<double>( "log_krA_previous" );
|
||||
}
|
||||
if (color_db->keyExists( "krA_morph_factor" )){
|
||||
KRA_MORPH_FACTOR = color_db->getScalar<double>( "krA_morph_factor" );
|
||||
}
|
||||
|
||||
if (color_db->keyExists( "capillary_number" )){
|
||||
capillary_number = color_db->getScalar<double>( "capillary_number" );
|
||||
SET_CAPILLARY_NUMBER=true;
|
||||
}
|
||||
if (color_db->keyExists( "rescale_force_after_timestep" )){
|
||||
RESCALE_FORCE_AFTER_TIMESTEP = color_db->getScalar<int>( "rescale_force_after_timestep" );
|
||||
RESCALE_FORCE = true;
|
||||
}
|
||||
if (color_db->keyExists( "timestep" )){
|
||||
timestep = color_db->getScalar<int>( "timestep" );
|
||||
}
|
||||
if (BoundaryCondition != 0 && BoundaryCondition != 5 && SET_CAPILLARY_NUMBER==true){
|
||||
if (rank == 0) printf("WARINING: capillary number target only supported for BC = 0 or 5 \n");
|
||||
SET_CAPILLARY_NUMBER=false;
|
||||
}
|
||||
if (analysis_db->keyExists( "seed_water" )){
|
||||
seed_water = analysis_db->getScalar<double>( "seed_water" );
|
||||
if (rank == 0) printf("Seed water in oil %f (seed_water) \n",seed_water);
|
||||
}
|
||||
if (analysis_db->keyExists( "morph_delta" )){
|
||||
morph_delta = analysis_db->getScalar<double>( "morph_delta" );
|
||||
if (rank == 0) printf("Target volume change %f (morph_delta) \n",morph_delta);
|
||||
}
|
||||
if (analysis_db->keyExists( "morph_interval" )){
|
||||
morph_interval = analysis_db->getScalar<int>( "morph_interval" );
|
||||
USE_MORPH = true;
|
||||
}
|
||||
if (analysis_db->keyExists( "use_morphopen_oil" )){
|
||||
USE_MORPHOPEN_OIL = analysis_db->getScalar<bool>( "use_morphopen_oil" );
|
||||
if (rank == 0 && USE_MORPHOPEN_OIL) printf("Volume change by morphological opening \n");
|
||||
USE_MORPH = true;
|
||||
}
|
||||
if (analysis_db->keyExists( "tolerance" )){
|
||||
tolerance = analysis_db->getScalar<double>( "tolerance" );
|
||||
}
|
||||
|
||||
if (analysis_db->keyExists( "min_steady_timesteps" )){
|
||||
MIN_STEADY_TIMESTEPS = analysis_db->getScalar<int>( "min_steady_timesteps" );
|
||||
}
|
||||
if (analysis_db->keyExists( "max_steady_timesteps" )){
|
||||
MAX_STEADY_TIMESTEPS = analysis_db->getScalar<int>( "max_steady_timesteps" );
|
||||
}
|
||||
if (analysis_db->keyExists( "max_morph_timesteps" )){
|
||||
MAX_MORPH_TIMESTEPS = analysis_db->getScalar<int>( "max_morph_timesteps" );
|
||||
}
|
||||
|
||||
auto protocol = color_db->getWithDefault<std::string>( "protocol", "none" );
|
||||
if (protocol == "image sequence"){
|
||||
// Get the list of images
|
||||
USE_DIRECT = true;
|
||||
ImageList = color_db->getVector<std::string>( "image_sequence");
|
||||
IMAGE_INDEX = color_db->getWithDefault<int>( "image_index", 0 );
|
||||
IMAGE_COUNT = ImageList.size();
|
||||
morph_interval = 10000;
|
||||
USE_MORPH = true;
|
||||
USE_SEED = false;
|
||||
}
|
||||
else if (protocol == "seed water"){
|
||||
morph_delta = -0.05;
|
||||
seed_water = 0.01;
|
||||
USE_SEED = true;
|
||||
USE_MORPH = true;
|
||||
}
|
||||
else if (protocol == "open connected oil"){
|
||||
morph_delta = -0.05;
|
||||
USE_SEED = false;
|
||||
USE_MORPH = true;
|
||||
USE_MORPHOPEN_OIL = true;
|
||||
}
|
||||
else if (protocol == "shell aggregation"){
|
||||
morph_delta = -0.05;
|
||||
USE_MORPH = true;
|
||||
USE_SEED = false;
|
||||
}
|
||||
else if (protocol == "fractional flow"){
|
||||
USE_MORPH = false;
|
||||
USE_SEED = false;
|
||||
}
|
||||
else if (protocol == "centrifuge"){
|
||||
USE_MORPH = false;
|
||||
USE_SEED = false;
|
||||
}
|
||||
else if (protocol == "core flooding"){
|
||||
USE_MORPH = false;
|
||||
USE_SEED = false;
|
||||
if (SET_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("********************************************************\n");
|
||||
if (protocol == "image sequence"){
|
||||
printf(" using protocol = image sequence \n");
|
||||
printf(" min_steady_timesteps = %i \n",MIN_STEADY_TIMESTEPS);
|
||||
printf(" max_steady_timesteps = %i \n",MAX_STEADY_TIMESTEPS);
|
||||
printf(" tolerance = %f \n",tolerance);
|
||||
std::string first_image = ImageList[IMAGE_INDEX];
|
||||
printf(" first image in sequence: %s ***\n", first_image.c_str());
|
||||
}
|
||||
else if (protocol == "seed water"){
|
||||
printf(" using protocol = seed water \n");
|
||||
printf(" min_steady_timesteps = %i \n",MIN_STEADY_TIMESTEPS);
|
||||
printf(" max_steady_timesteps = %i \n",MAX_STEADY_TIMESTEPS);
|
||||
printf(" tolerance = %f \n",tolerance);
|
||||
printf(" morph_delta = %f \n",morph_delta);
|
||||
printf(" seed_water = %f \n",seed_water);
|
||||
}
|
||||
else if (protocol == "open connected oil"){
|
||||
printf(" using protocol = open connected oil \n");
|
||||
printf(" min_steady_timesteps = %i \n",MIN_STEADY_TIMESTEPS);
|
||||
printf(" max_steady_timesteps = %i \n",MAX_STEADY_TIMESTEPS);
|
||||
printf(" tolerance = %f \n",tolerance);
|
||||
printf(" morph_delta = %f \n",morph_delta);
|
||||
}
|
||||
else if (protocol == "shell aggregation"){
|
||||
printf(" using protocol = shell aggregation \n");
|
||||
printf(" min_steady_timesteps = %i \n",MIN_STEADY_TIMESTEPS);
|
||||
printf(" max_steady_timesteps = %i \n",MAX_STEADY_TIMESTEPS);
|
||||
printf(" tolerance = %f \n",tolerance);
|
||||
printf(" morph_delta = %f \n",morph_delta);
|
||||
}
|
||||
else if (protocol == "fractional flow"){
|
||||
printf(" using protocol = fractional flow \n");
|
||||
printf(" min_steady_timesteps = %i \n",MIN_STEADY_TIMESTEPS);
|
||||
printf(" max_steady_timesteps = %i \n",MAX_STEADY_TIMESTEPS);
|
||||
printf(" tolerance = %f \n",tolerance);
|
||||
}
|
||||
else if (protocol == "centrifuge"){
|
||||
printf(" using protocol = centrifuge \n");
|
||||
printf(" driving force = %f \n",Fz);
|
||||
if (Fz < 0){
|
||||
printf(" Component B displacing component A \n");
|
||||
}
|
||||
else if (Fz > 0){
|
||||
printf(" Component A displacing component B \n");
|
||||
}
|
||||
}
|
||||
else if (protocol == "core flooding"){
|
||||
printf(" using protocol = core flooding \n");
|
||||
printf(" capillary number = %f \n", capillary_number);
|
||||
}
|
||||
printf("No. of timesteps: %i \n", timestepMax);
|
||||
fflush(stdout);
|
||||
}
|
||||
*/
|
||||
//************ MAIN ITERATION LOOP ***************************************/
|
||||
comm.barrier();
|
||||
PROFILE_START("Loop");
|
||||
@@ -1293,26 +1101,5 @@ void ScaLBL_ColorModel::WriteDebug(){
|
||||
fwrite(PhaseField.data(),8,N,VELZ_FILE);
|
||||
fclose(VELZ_FILE);
|
||||
|
||||
/* ScaLBL_Comm->RegularLayout(Map,&ColorGrad[0],PhaseField);
|
||||
FILE *CGX_FILE;
|
||||
sprintf(LocalRankFilename,"Gradient_X.%05i.raw",rank);
|
||||
CGX_FILE = fopen(LocalRankFilename,"wb");
|
||||
fwrite(PhaseField.data(),8,N,CGX_FILE);
|
||||
fclose(CGX_FILE);
|
||||
|
||||
ScaLBL_Comm->RegularLayout(Map,&ColorGrad[Np],PhaseField);
|
||||
FILE *CGY_FILE;
|
||||
sprintf(LocalRankFilename,"Gradient_Y.%05i.raw",rank);
|
||||
CGY_FILE = fopen(LocalRankFilename,"wb");
|
||||
fwrite(PhaseField.data(),8,N,CGY_FILE);
|
||||
fclose(CGY_FILE);
|
||||
|
||||
ScaLBL_Comm->RegularLayout(Map,&ColorGrad[2*Np],PhaseField);
|
||||
FILE *CGZ_FILE;
|
||||
sprintf(LocalRankFilename,"Gradient_Z.%05i.raw",rank);
|
||||
CGZ_FILE = fopen(LocalRankFilename,"wb");
|
||||
fwrite(PhaseField.data(),8,N,CGZ_FILE);
|
||||
fclose(CGZ_FILE);
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user