From 4db49247fb69c4dd7340c2eac34cc01d96635303 Mon Sep 17 00:00:00 2001 From: Sreehari Perumanath Date: Sun, 24 Mar 2024 10:20:35 +0000 Subject: [PATCH] Mobility scale array deleted --- exec/multispec/AdvanceTimestepBousq.cpp | 25 ++++++++++++------------- exec/multispec/main_driver.cpp | 6 +++--- src_multispec/multispec_functions.cpp | 1 + 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/exec/multispec/AdvanceTimestepBousq.cpp b/exec/multispec/AdvanceTimestepBousq.cpp index e492679d..57aeff97 100644 --- a/exec/multispec/AdvanceTimestepBousq.cpp +++ b/exec/multispec/AdvanceTimestepBousq.cpp @@ -38,7 +38,6 @@ void AdvanceTimestepBousq(std::array< MultiFab, AMREX_SPACEDIM >& umac, MultiFab& phi_new, MultiFab& phitot_old, MultiFab& phitot_new, - MultiFab& local_MobScale, const Real& dt, const Real& time, const int& istep, @@ -656,7 +655,6 @@ if (use_ice_nucleation ==0){ Box bx = mfi.tilebox(); const Array4& phiOld = phi_old.array(mfi); const Array4& phiPrd = phi_prd.array(mfi); - const Array4& MobScale = local_MobScale.array(mfi); const amrex::Array4& u = umac[0].array(mfi); const amrex::Array4& v = umac[1].array(mfi); @@ -671,20 +669,20 @@ if (use_ice_nucleation ==0){ { phiPrd(i,j,k) = phiOld(i,j,k,n) - + dt/2 * Mobility*MobScale(i,j,k) * 2 * GradEnCoef * + + dt/2 * Mobility * 2 * GradEnCoef * ( (phiOld(i+1,j,k,n) - 2.*phiOld(i,j,k,n) + phiOld(i-1,j,k,n)) / (dx[0]*dx[0]) +(phiOld(i,j+1,k,n) - 2.*phiOld(i,j,k,n) + phiOld(i,j-1,k,n)) / (dx[1]*dx[1]) ) - dt/2 * ((u(i+1,j,k)+u_old(i+1,j,k))/2*(phiOld(i+1,j,k,n)+phiOld(i,j,k,n))/2-(u(i,j,k)+u_old(i,j,k))/2*(phiOld(i,j,k,n)+phiOld(i-1,j,k,n))/2)/dx[0] - dt/2 * ((v(i,j+1,k)+v_old(i,j+1,k))/2*(phiOld(i,j+1,k,n)+phiOld(i,j,k,n))/2-(v(i,j,k)+v_old(i,j,k))/2*(phiOld(i,j,k,n)+phiOld(i,j-1,k,n))/2)/dx[1] #if (AMREX_SPACEDIM == 3) - + dt/2 * Mobility*MobScale(i,j,k) * 2 * GradEnCoef * (phiOld(i,j,k+1,n) - 2.*phiOld(i,j,k,n) + phiOld(i,j,k-1,n)) / (dx[2]*dx[2]) + + dt/2 * Mobility * 2 * GradEnCoef * (phiOld(i,j,k+1,n) - 2.*phiOld(i,j,k,n) + phiOld(i,j,k-1,n)) / (dx[2]*dx[2]) - dt/2 * ((w(i,j,k+1)+w_old(i,j,k+1))/2*(phiOld(i,j,k+1,n)+phiOld(i,j,k,n))/2-(w(i,j,k)+w_old(i,j,k))/2*(phiOld(i,j,k,n)+phiOld(i,j,k-1,n))/2)/dx[2] - + variance_coef_mass*sqrt(2.0*k_B*T_init[0]*Mobility*MobScale(i,j,k)*dt/(dx[0]*dx[1]*dx[2]))*amrex::RandomNormal(0,1)/sqrt(2) + + variance_coef_mass*sqrt(2.0*k_B*T_init[0]*Mobility*dt/(dx[0]*dx[1]*dx[2]))*amrex::RandomNormal(0,1)/sqrt(2) #elif (AMREX_SPACEDIM == 2) - + variance_coef_mass*sqrt(2.0*k_B*T_init[0]*Mobility*MobScale(i,j,k)*dt/(dx[0]*dx[1]*cell_depth))*amrex::RandomNormal(0,1)/sqrt(2) + + variance_coef_mass*sqrt(2.0*k_B*T_init[0]*Mobility*dt/(dx[0]*dx[1]*cell_depth))*amrex::RandomNormal(0,1)/sqrt(2) #endif - - dt/2 * Mobility*MobScale(i,j,k) * EnScale*(2*phiOld(i,j,k,n)*(phiOld(i,j,k,n)-1)*(phiOld(i,j,k,n)-1)+2*phiOld(i,j,k,n)*phiOld(i,j,k,n)*(phiOld(i,j,k,n)-1) - PotWellDepr) + - dt/2 * Mobility * EnScale*(2*phiOld(i,j,k,n)*(phiOld(i,j,k,n)-1)*(phiOld(i,j,k,n)-1)+2*phiOld(i,j,k,n)*phiOld(i,j,k,n)*(phiOld(i,j,k,n)-1) - PotWellDepr) ; }); } @@ -697,7 +695,6 @@ if (use_ice_nucleation ==0){ const Array4& phiNew = phi_new.array(mfi); const Array4& phiOld = phi_old.array(mfi); const Array4& phiPrd = phi_prd.array(mfi); - const Array4& MobScale = local_MobScale.array(mfi); const amrex::Array4& u = umac[0].array(mfi); const amrex::Array4& v = umac[1].array(mfi); @@ -712,20 +709,20 @@ if (use_ice_nucleation ==0){ { phiNew(i,j,k,n) = phiOld(i,j,k,n) - + dt * Mobility*MobScale(i,j,k) * 2 * GradEnCoef * + + dt * Mobility * 2 * GradEnCoef * ( (phiPrd(i+1,j,k) - 2.*phiPrd(i,j,k) + phiPrd(i-1,j,k)) / (dx[0]*dx[0]) +(phiPrd(i,j+1,k) - 2.*phiPrd(i,j,k) + phiPrd(i,j-1,k)) / (dx[1]*dx[1]) ) - dt * ((u(i+1,j,k)+u_old(i+1,j,k))/2*(phiPrd(i+1,j,k)+phiPrd(i,j,k))/2-(u(i,j,k)+u_old(i,j,k))/2*(phiPrd(i,j,k)+phiPrd(i-1,j,k))/2)/dx[0] - dt * ((v(i,j+1,k)+v_old(i,j+1,k))/2*(phiPrd(i,j+1,k)+phiPrd(i,j,k))/2-(v(i,j,k)+v_old(i,j,k))/2*(phiPrd(i,j,k)+phiPrd(i,j-1,k))/2)/dx[1] #if (AMREX_SPACEDIM == 3) - + dt * Mobility*MobScale(i,j,k) * 2 * GradEnCoef * (phiPrd(i,j,k+1) - 2.*phiPrd(i,j,k) + phiPrd(i,j,k-1)) / (dx[2]*dx[2]) + + dt * Mobility * 2 * GradEnCoef * (phiPrd(i,j,k+1) - 2.*phiPrd(i,j,k) + phiPrd(i,j,k-1)) / (dx[2]*dx[2]) - dt * ((w(i,j,k+1)+w_old(i,j,k+1))/2*(phiPrd(i,j,k+1)+phiPrd(i,j,k))/2-(w(i,j,k)+w_old(i,j,k))/2*(phiPrd(i,j,k)+phiPrd(i,j,k-1))/2)/dx[2] - + variance_coef_mass*sqrt(2.0*k_B*T_init[0]*Mobility*MobScale(i,j,k)*dt/(dx[0]*dx[1]*dx[2]))*amrex::RandomNormal(0,1) + + variance_coef_mass*sqrt(2.0*k_B*T_init[0]*Mobility*dt/(dx[0]*dx[1]*dx[2]))*amrex::RandomNormal(0,1) #elif (AMREX_SPACEDIM == 2) - + variance_coef_mass*sqrt(2.0*k_B*T_init[0]*Mobility*MobScale(i,j,k)*dt/(dx[0]*dx[1]*cell_depth))*amrex::RandomNormal(0,1) + + variance_coef_mass*sqrt(2.0*k_B*T_init[0]*Mobility*dt/(dx[0]*dx[1]*cell_depth))*amrex::RandomNormal(0,1) #endif - - dt * Mobility*MobScale(i,j,k) * EnScale*(2*phiPrd(i,j,k)*(phiPrd(i,j,k)-1)*(phiPrd(i,j,k)-1)+2*phiPrd(i,j,k)*phiPrd(i,j,k)*(phiPrd(i,j,k)-1) - PotWellDepr) + - dt * Mobility * EnScale*(2*phiPrd(i,j,k)*(phiPrd(i,j,k)-1)*(phiPrd(i,j,k)-1)+2*phiPrd(i,j,k)*phiPrd(i,j,k)*(phiPrd(i,j,k)-1) - PotWellDepr) ; phiNew(i,j,k,n+1) = 1-phiNew(i,j,k,n); @@ -738,6 +735,8 @@ if (use_ice_nucleation ==0){ MultiFab::Copy(phi_old,phi_new,0,0,nspecies,0); + amrex::Print() << "Mobility = " << Mobility <<"\n"; + amrex::Print() << "Advanced phi (phi1_avg = " << phi_new.sum(0)/(n_cells[0]*n_cells[1] #if (AMREX_SPACEDIM == 3) *n_cells[2] diff --git a/exec/multispec/main_driver.cpp b/exec/multispec/main_driver.cpp index be633b8a..be949736 100644 --- a/exec/multispec/main_driver.cpp +++ b/exec/multispec/main_driver.cpp @@ -234,8 +234,8 @@ void main_driver(const char* argv) /***/ MultiFab phi_new (ba, dmap, nspecies, ng_s); MultiFab phitot_new (ba, dmap, 1 , ng_s); - MultiFab local_MobScale (ba, dmap, 1 , 0); - local_MobScale.setVal(1.0); // Change this near to wall BC + //MultiFab local_MobScale (ba, dmap, 1 , 0); + //local_MobScale.setVal(1.0); // Change this near to wall BC ///////////////////////////////////////// // eta and Temp on nodes (2d) or edges (3d) @@ -572,7 +572,7 @@ void main_driver(const char* argv) grad_Epot_old,grad_Epot_new, charge_old,charge_new,Epot,permittivity, sMassFlux,sMomFlux, - phi_old,phi_new,phitot_old,phitot_new,local_MobScale, + phi_old,phi_new,phitot_old,phitot_new, dt,time,istep,geom); } else { diff --git a/src_multispec/multispec_functions.cpp b/src_multispec/multispec_functions.cpp index 57004ec8..d7d18d45 100644 --- a/src_multispec/multispec_functions.cpp +++ b/src_multispec/multispec_functions.cpp @@ -208,6 +208,7 @@ void InitializeMultispecNamespace() { pp.query("use_log_potential",use_log_potential); pp.query("monomer_mass",monomer_mass); pp.query("kc_tension",kc_tension); + pp.query("Mobility",Mobility); pp.query("fh_tension",fh_tension); pp.query("alpha_gex",alpha_gex); pp.query("n_gex",n_gex);