fix force adaptation
This commit is contained in:
parent
14826cba1f
commit
48fe85f4ef
@ -815,28 +815,6 @@ void ScaLBL_ColorModel::Run(){
|
|||||||
color_db->putVector<double>("F",{Fx,Fy,Fz});
|
color_db->putVector<double>("F",{Fx,Fy,Fz});
|
||||||
}
|
}
|
||||||
if ( isSteady ){
|
if ( isSteady ){
|
||||||
/*if (SET_CAPILLARY_NUMBER && fabs(capillary_number - Ca) / capillary_number > 2.0){
|
|
||||||
// reject steady points if they don't match the Ca well enough
|
|
||||||
double RESCALE_FORCE_FACTOR = capillary_number / Ca;
|
|
||||||
if (RESCALE_FORCE_FACTOR > 2.0) RESCALE_FORCE_FACTOR = 2.0;
|
|
||||||
if (RESCALE_FORCE_FACTOR < 0.5) RESCALE_FORCE_FACTOR = 0.5;
|
|
||||||
Fx *= RESCALE_FORCE_FACTOR;
|
|
||||||
Fy *= RESCALE_FORCE_FACTOR;
|
|
||||||
Fz *= RESCALE_FORCE_FACTOR;
|
|
||||||
force_mag = sqrt(Fx*Fx+Fy*Fy+Fz*Fz);
|
|
||||||
if (force_mag > 1e-3){
|
|
||||||
Fx *= 1e-3/force_mag; // impose ceiling for stability
|
|
||||||
Fy *= 1e-3/force_mag;
|
|
||||||
Fz *= 1e-3/force_mag;
|
|
||||||
}
|
|
||||||
if (rank == 0) printf(" -- adjust force by factor %f \n ",capillary_number / Ca);
|
|
||||||
Averages->SetParams(rhoA,rhoB,tauA,tauB,Fx,Fy,Fz,alpha,beta);
|
|
||||||
color_db->putVector<double>("F",{Fx,Fy,Fz});
|
|
||||||
// simulate the point again with new force
|
|
||||||
CURRENT_STEADY_TIMESTEPS=0;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
*/
|
|
||||||
MORPH_ADAPT = true;
|
MORPH_ADAPT = true;
|
||||||
CURRENT_MORPH_TIMESTEPS=0;
|
CURRENT_MORPH_TIMESTEPS=0;
|
||||||
delta_volume_target = Dm->Volume*volA *morph_delta; // set target volume change
|
delta_volume_target = Dm->Volume*volA *morph_delta; // set target volume change
|
||||||
@ -932,13 +910,9 @@ void ScaLBL_ColorModel::Run(){
|
|||||||
printf(" Measured capillary number %f \n ",Ca);
|
printf(" Measured capillary number %f \n ",Ca);
|
||||||
}
|
}
|
||||||
if (SET_CAPILLARY_NUMBER ){
|
if (SET_CAPILLARY_NUMBER ){
|
||||||
double RESCALE_FORCE_FACTOR = capillary_number / Ca;
|
Fx *= capillary_number / Ca;
|
||||||
if (RESCALE_FORCE_FACTOR > 2.0) RESCALE_FORCE_FACTOR = 2.0;
|
Fy *= capillary_number / Ca;
|
||||||
if (RESCALE_FORCE_FACTOR < 0.5) RESCALE_FORCE_FACTOR = 0.5;
|
Fz *= capillary_number / Ca;
|
||||||
Fx *= RESCALE_FORCE_FACTOR;
|
|
||||||
Fy *= RESCALE_FORCE_FACTOR;
|
|
||||||
Fz *= RESCALE_FORCE_FACTOR;
|
|
||||||
force_mag = sqrt(Fx*Fx+Fy*Fy+Fz*Fz);
|
|
||||||
if (force_mag > 1e-3){
|
if (force_mag > 1e-3){
|
||||||
Fx *= 1e-3/force_mag; // impose ceiling for stability
|
Fx *= 1e-3/force_mag; // impose ceiling for stability
|
||||||
Fy *= 1e-3/force_mag;
|
Fy *= 1e-3/force_mag;
|
||||||
@ -949,6 +923,8 @@ void ScaLBL_ColorModel::Run(){
|
|||||||
color_db->putVector<double>("F",{Fx,Fy,Fz});
|
color_db->putVector<double>("F",{Fx,Fy,Fz});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CURRENT_STEADY_TIMESTEPS = 0;
|
||||||
|
}
|
||||||
else{
|
else{
|
||||||
if (rank==0){
|
if (rank==0){
|
||||||
printf("** Continue to simulate steady *** \n ");
|
printf("** Continue to simulate steady *** \n ");
|
||||||
@ -957,9 +933,6 @@ void ScaLBL_ColorModel::Run(){
|
|||||||
}
|
}
|
||||||
morph_timesteps=0;
|
morph_timesteps=0;
|
||||||
Ca_previous = Ca;
|
Ca_previous = Ca;
|
||||||
/*}
|
|
||||||
THIS IS WHERE YOU DISABLE STEADY POINT REJECTION
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MORPH_ADAPT ){
|
if (MORPH_ADAPT ){
|
||||||
@ -1018,7 +991,6 @@ void ScaLBL_ColorModel::Run(){
|
|||||||
}
|
}
|
||||||
MPI_Barrier(ScaLBL_Comm->MPI_COMM_SCALBL);
|
MPI_Barrier(ScaLBL_Comm->MPI_COMM_SCALBL);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
analysis.finish();
|
analysis.finish();
|
||||||
PROFILE_STOP("Loop");
|
PROFILE_STOP("Loop");
|
||||||
PROFILE_SAVE("lbpm_color_simulator",1);
|
PROFILE_SAVE("lbpm_color_simulator",1);
|
||||||
|
Loading…
Reference in New Issue
Block a user