try to fix time conversion factor for Poisson solver; to be built and tested
This commit is contained in:
parent
eccebcd95a
commit
ba14aecf35
@ -4,7 +4,7 @@ ScaLBL_Multiphys_Controller::ScaLBL_Multiphys_Controller(
|
||||
int RANK, int NP, const Utilities::MPI &COMM)
|
||||
: rank(RANK), nprocs(NP), Restart(0), timestepMax(0), num_iter_Stokes(0),
|
||||
num_iter_Ion(0), analysis_interval(0), visualization_interval(0),
|
||||
tolerance(0), time_conv_max(0), comm(COMM) {}
|
||||
tolerance(0), time_conv_max(0), time_conv_MainLoop(0), comm(COMM) {}
|
||||
ScaLBL_Multiphys_Controller::~ScaLBL_Multiphys_Controller() {}
|
||||
|
||||
void ScaLBL_Multiphys_Controller::ReadParams(string filename) {
|
||||
@ -22,6 +22,7 @@ void ScaLBL_Multiphys_Controller::ReadParams(string filename) {
|
||||
visualization_interval = 10000;
|
||||
tolerance = 1.0e-6;
|
||||
time_conv_max = 0.0;
|
||||
time_conv_MainLoop = 0.0;
|
||||
|
||||
// load input parameters
|
||||
if (study_db->keyExists("timestepMax")) {
|
||||
|
@ -40,6 +40,7 @@ public:
|
||||
int visualization_interval;
|
||||
double tolerance;
|
||||
double time_conv_max;
|
||||
double time_conv_MainLoop;
|
||||
//double SchmidtNum;//Schmidt number = kinematic_viscosity/mass_diffusivity
|
||||
|
||||
int rank, nprocs;
|
||||
|
@ -79,17 +79,27 @@ int main(int argc, char **argv)
|
||||
|
||||
IonModel.timestepMax = Study.getIonNumIter_PNP_coupling(StokesModel.time_conv,IonModel.time_conv);
|
||||
IonModel.Initialize();
|
||||
|
||||
// Get maximal time converting factor based on Sotkes and Ion solvers
|
||||
Study.getTimeConvMax_PNP_coupling(StokesModel.time_conv,IonModel.time_conv);
|
||||
//Study.getTimeConvMax_PNP_coupling(StokesModel.time_conv,IonModel.time_conv);
|
||||
// Get time conversion factor for the main iteration loop in electrokinetic single fluid simulator
|
||||
Study.time_conv_MainLoop = StokesModel.timestepMax*StokesModel.time_conv;
|
||||
|
||||
// Initialize LB-Poisson model
|
||||
PoissonSolver.ReadParams(filename);
|
||||
PoissonSolver.SetDomain();
|
||||
PoissonSolver.ReadInput();
|
||||
PoissonSolver.Create();
|
||||
PoissonSolver.Initialize(Study.time_conv_max);
|
||||
PoissonSolver.Initialize(Study.time_conv_MainLoop);
|
||||
|
||||
|
||||
printf("********************************************************\n");
|
||||
printf("Key Summary of LBPM electrokinetic single-fluid solver \n");
|
||||
printf(" 1. Max LB Timestep: %i [lt]\n");
|
||||
printf(" 2. Time conversion factor per LB Timestep: %.6g [sec/lt]\n",Study.time_conv_MainLoop);
|
||||
printf(" 3. Max Physical Time: %.6g [sec]\n",Study.timestepMax*Study.time_conv_MainLoop);
|
||||
printf("********************************************************\n");
|
||||
|
||||
int timestep=0;
|
||||
while (timestep < Study.timestepMax){
|
||||
|
||||
@ -98,7 +108,6 @@ int main(int argc, char **argv)
|
||||
StokesModel.Run_Lite(IonModel.ChargeDensity, PoissonSolver.ElectricField);// Solve the N-S equations to get velocity
|
||||
IonModel.Run(StokesModel.Velocity,PoissonSolver.ElectricField); //solve for ion transport and electric potential
|
||||
|
||||
timestep++;//AA operations
|
||||
|
||||
if (timestep%Study.analysis_interval==0){
|
||||
Analysis.Basic(IonModel,PoissonSolver,StokesModel,timestep);
|
||||
@ -116,7 +125,7 @@ int main(int argc, char **argv)
|
||||
if (rank==0) printf("Save simulation raw data at maximum timestep\n");
|
||||
Analysis.WriteVis(IonModel,PoissonSolver,StokesModel,Study.db,timestep);
|
||||
|
||||
if (rank==0) printf("Maximum timestep is reached and the simulation is completed\n");
|
||||
if (rank==0) printf("Maximum LB timestep = %i is reached and the simulation is completed\n",Study.timestepMax);
|
||||
if (rank==0) printf("*************************************************************\n");
|
||||
|
||||
PROFILE_STOP("Main");
|
||||
|
Loading…
Reference in New Issue
Block a user