fix several miscellaneous bugs
This commit is contained in:
parent
030bec9eba
commit
59ffd7bfd6
@ -48,6 +48,15 @@ void ScaLBL_IonModel::ReadParams(string filename,int num_iter,int num_iter_Stoke
|
||||
tau.push_back(0.5+k2_inv*time_conv/(h*1.0e-6)/(h*1.0e-6)*IonDiffusivity[0]);
|
||||
//--------------------------------------------------------------------------//
|
||||
|
||||
// Read domain parameters
|
||||
if (domain_db->keyExists( "voxel_length" )){//default unit: um/lu
|
||||
h = domain_db->getScalar<double>( "voxel_length" );
|
||||
}
|
||||
BoundaryCondition = 0;
|
||||
if (domain_db->keyExists( "BC" )){
|
||||
BoundaryCondition = domain_db->getScalar<int>( "BC" );
|
||||
}
|
||||
|
||||
// LB-Ion Model parameters
|
||||
//if (ion_db->keyExists( "timestepMax" )){
|
||||
// timestepMax = ion_db->getScalar<int>( "timestepMax" );
|
||||
@ -112,14 +121,6 @@ void ScaLBL_IonModel::ReadParams(string filename,int num_iter,int num_iter_Stoke
|
||||
BoundaryConditionSolid = ion_db->getScalar<int>( "BC_Solid" );
|
||||
}
|
||||
|
||||
// Read domain parameters
|
||||
if (domain_db->keyExists( "voxel_length" )){//default unit: um/lu
|
||||
h = domain_db->getScalar<double>( "voxel_length" );
|
||||
}
|
||||
BoundaryCondition = 0;
|
||||
if (domain_db->keyExists( "BC" )){
|
||||
BoundaryCondition = domain_db->getScalar<int>( "BC" );
|
||||
}
|
||||
|
||||
if (rank==0) printf("*****************************************************\n");
|
||||
if (rank==0) printf("LB Ion Transport Solver: \n");
|
||||
@ -275,7 +276,7 @@ void ScaLBL_IonModel::AssignSolidBoundary(double *ion_solid)
|
||||
label_count_global[idx]=sumReduce( Dm->Comm, label_count[idx]);
|
||||
|
||||
if (rank==0){
|
||||
printf("LB Ion Solver: Ion Solid labels: %lu \n",NLABELS);
|
||||
printf("LB Ion Solver: number of ion solid labels: %lu \n",NLABELS);
|
||||
for (unsigned int idx=0; idx<NLABELS; idx++){
|
||||
VALUE=LabelList[idx];
|
||||
AFFINITY=AffinityList[idx];
|
||||
@ -464,6 +465,7 @@ void ScaLBL_IonModel::Run(double *Velocity, double *ElectricField){
|
||||
void ScaLBL_IonModel::getIonConcentration(){
|
||||
for (int ic=0; ic<number_ion_species; ic++){
|
||||
ScaLBL_IonConcentration_Phys(Ci, h, ic, ScaLBL_Comm->FirstInterior(), ScaLBL_Comm->LastInterior(), Np);
|
||||
ScaLBL_IonConcentration_Phys(Ci, h, ic, 0, ScaLBL_Comm->LastExterior(), Np);
|
||||
}
|
||||
|
||||
DoubleArray PhaseField(Nx,Ny,Nz);
|
||||
|
@ -224,7 +224,7 @@ void ScaLBL_Poisson::AssignSolidBoundary(double *poisson_solid)
|
||||
label_count_global[idx]=sumReduce( Dm->Comm, label_count[idx]);
|
||||
|
||||
if (rank==0){
|
||||
printf("LB-Poisson Solver: Poisson Solid labels: %lu \n",NLABELS);
|
||||
printf("LB-Poisson Solver: number of Poisson solid labels: %lu \n",NLABELS);
|
||||
for (unsigned int idx=0; idx<NLABELS; idx++){
|
||||
VALUE=LabelList[idx];
|
||||
AFFINITY=AffinityList[idx];
|
||||
|
@ -40,6 +40,15 @@ void ScaLBL_StokesModel::ReadParams(string filename,int num_iter){
|
||||
Ez = 1.0e-3;
|
||||
//--------------------------------------------------------------------------//
|
||||
|
||||
// Read domain parameters
|
||||
BoundaryCondition = 0;
|
||||
if (domain_db->keyExists( "BC" )){
|
||||
BoundaryCondition = domain_db->getScalar<int>( "BC" );
|
||||
}
|
||||
if (domain_db->keyExists( "voxel_length" )){//default unit: um/lu
|
||||
h = domain_db->getScalar<double>( "voxel_length" );
|
||||
}
|
||||
|
||||
// Single-fluid Navier-Stokes Model parameters
|
||||
//if (stokes_db->keyExists( "timestepMax" )){
|
||||
// timestepMax = stokes_db->getScalar<int>( "timestepMax" );
|
||||
@ -76,14 +85,6 @@ void ScaLBL_StokesModel::ReadParams(string filename,int num_iter){
|
||||
flux = stokes_db->getScalar<double>( "flux" );
|
||||
}
|
||||
|
||||
// Read domain parameters
|
||||
if (domain_db->keyExists( "BC" )){
|
||||
BoundaryCondition = domain_db->getScalar<int>( "BC" );
|
||||
}
|
||||
if (domain_db->keyExists( "voxel_length" )){//default unit: um/lu
|
||||
h = domain_db->getScalar<double>( "voxel_length" );
|
||||
}
|
||||
|
||||
// Re-calculate model parameters due to parameter read
|
||||
mu=(tau-0.5)/3.0;
|
||||
time_conv = (h*h*1.0e-12)*mu/nu_phys;//time conversion factor from physical to LB unit; [sec/lt]
|
||||
|
@ -98,6 +98,9 @@ int main(int argc, char **argv)
|
||||
PoissonSolver.getElectricalPotential();
|
||||
IonModel.getIonConcentration();
|
||||
|
||||
if (rank==0) printf("Maximum timestep is reached and the simulation is completed\n");
|
||||
if (rank==0) printf("*************************************************************\n");
|
||||
|
||||
PROFILE_STOP("Main");
|
||||
PROFILE_SAVE("lbpm_electrokinetic_simulator",1);
|
||||
// ****************************************************
|
||||
|
Loading…
Reference in New Issue
Block a user