add bump rate for endpoint
This commit is contained in:
@@ -505,6 +505,8 @@ void ScaLBL_ColorModel::Run(){
|
|||||||
double delta_volume = 0.0;
|
double delta_volume = 0.0;
|
||||||
double delta_volume_target = 0.0;
|
double delta_volume_target = 0.0;
|
||||||
double RESIDUAL_ENDPOINT_THRESHOLD = 0.04;
|
double RESIDUAL_ENDPOINT_THRESHOLD = 0.04;
|
||||||
|
double NOISE_THRESHOLD = 1.0e-6;
|
||||||
|
double BUMP_RATE = 10.0;
|
||||||
|
|
||||||
auto protocol = color_db->getWithDefault<std::string>( "protocol", "none" );
|
auto protocol = color_db->getWithDefault<std::string>( "protocol", "none" );
|
||||||
if (protocol == "image sequence"){
|
if (protocol == "image sequence"){
|
||||||
@@ -535,6 +537,12 @@ void ScaLBL_ColorModel::Run(){
|
|||||||
if (color_db->keyExists( "residual_endpoint_threshold" )){
|
if (color_db->keyExists( "residual_endpoint_threshold" )){
|
||||||
RESIDUAL_ENDPOINT_THRESHOLD = color_db->getScalar<double>( "residual_endpoint_threshold" );
|
RESIDUAL_ENDPOINT_THRESHOLD = color_db->getScalar<double>( "residual_endpoint_threshold" );
|
||||||
}
|
}
|
||||||
|
if (color_db->keyExists( "noise_threshold" )){
|
||||||
|
NOISE_THRESHOLD = color_db->getScalar<double>( "noise_threshold" );
|
||||||
|
}
|
||||||
|
if (color_db->keyExists( "bump_rate" )){
|
||||||
|
BUMP_RATE = color_db->getScalar<double>( "bump_rate" );
|
||||||
|
}
|
||||||
if (color_db->keyExists( "capillary_number" )){
|
if (color_db->keyExists( "capillary_number" )){
|
||||||
capillary_number = color_db->getScalar<double>( "capillary_number" );
|
capillary_number = color_db->getScalar<double>( "capillary_number" );
|
||||||
SET_CAPILLARY_NUMBER=true;
|
SET_CAPILLARY_NUMBER=true;
|
||||||
@@ -597,7 +605,6 @@ void ScaLBL_ColorModel::Run(){
|
|||||||
printf(" tolerance = %f \n",tolerance);
|
printf(" tolerance = %f \n",tolerance);
|
||||||
printf(" morph_delta = %f \n",morph_delta);
|
printf(" morph_delta = %f \n",morph_delta);
|
||||||
printf(" seed_water = %f \n",seed_water);
|
printf(" seed_water = %f \n",seed_water);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (protocol == "open connected oil"){
|
else if (protocol == "open connected oil"){
|
||||||
printf(" using protocol = open connected oil \n");
|
printf(" using protocol = open connected oil \n");
|
||||||
@@ -714,10 +721,6 @@ void ScaLBL_ColorModel::Run(){
|
|||||||
printf("%i %f \n",timestep,din);
|
printf("%i %f \n",timestep,din);
|
||||||
}
|
}
|
||||||
// Run the analysis
|
// Run the analysis
|
||||||
//analysis.run( timestep, *Averages, Phi, Pressure, Velocity, fq, Den );
|
|
||||||
//color_db->putScalar<int>("timestep",timestep);
|
|
||||||
//current_db->putDatabase("Color", color_db);
|
|
||||||
|
|
||||||
analysis.basic(timestep, current_db, *Averages, Phi, Pressure, Velocity, fq, Den );
|
analysis.basic(timestep, current_db, *Averages, Phi, Pressure, Velocity, fq, Den );
|
||||||
|
|
||||||
|
|
||||||
@@ -846,10 +849,14 @@ void ScaLBL_ColorModel::Run(){
|
|||||||
Fy *= 1e-3/force_mag;
|
Fy *= 1e-3/force_mag;
|
||||||
Fz *= 1e-3/force_mag;
|
Fz *= 1e-3/force_mag;
|
||||||
}
|
}
|
||||||
if (force_mag < 1e-7){
|
if (flow_rate_A_connected < NOISE_THRESHOLD){
|
||||||
Fx *= 1e-7/force_mag; // impose floor
|
Fx *= BUMP_RATE; // impose bump condition
|
||||||
Fy *= 1e-7/force_mag;
|
Fy *= BUMP_RATE;
|
||||||
Fz *= 1e-7/force_mag;
|
Fz *= BUMP_RATE;
|
||||||
|
capillary_number *= BUMP_RATE;
|
||||||
|
color_db->putScalar<int>("capillary_number",capillary_number);
|
||||||
|
current_db->putDatabase("Color", color_db);
|
||||||
|
MORPH_ADAPT = false; // re-run current point if below noise threshold
|
||||||
}
|
}
|
||||||
if (rank == 0) printf(" -- adjust force by factor %f \n ",capillary_number / Ca);
|
if (rank == 0) printf(" -- adjust force by factor %f \n ",capillary_number / Ca);
|
||||||
Averages->SetParams(rhoA,rhoB,tauA,tauB,Fx,Fy,Fz,alpha,beta);
|
Averages->SetParams(rhoA,rhoB,tauA,tauB,Fx,Fy,Fz,alpha,beta);
|
||||||
|
|||||||
Reference in New Issue
Block a user