update nernst-planck docs
This commit is contained in:
parent
720e7fa195
commit
b2ac66739f
208
docs/source/examples/membrane/cellModel.rst
Normal file
208
docs/source/examples/membrane/cellModel.rst
Normal file
@ -0,0 +1,208 @@
|
||||
********************************
|
||||
Membrane Charging Dynamics
|
||||
********************************
|
||||
|
||||
In this example, we consider membrane charging dynamics for a simple cell.
|
||||
|
||||
For the case considered in ``example/SingleCell`` an input membrane geometry is provided in the
|
||||
file ``Bacterium.swc``, which specifies an oblong cell shape, relying on the ``.swc`` file format that
|
||||
is commonly used to approximate neuron structures. The case considered is the four ion membrane transport
|
||||
problem considered in Figure 4 from McClure & Li
|
||||
|
||||
The input file ``Bacterium.db`` specifies the following
|
||||
|
||||
.. code:: c
|
||||
|
||||
MultiphysController {
|
||||
timestepMax = 25000
|
||||
num_iter_Ion_List = 4
|
||||
analysis_interval = 100
|
||||
tolerance = 1.0e-9
|
||||
visualization_interval = 1000 // Frequency to write visualization data
|
||||
}
|
||||
Ions {
|
||||
use_membrane = true
|
||||
Restart = false
|
||||
MembraneIonConcentrationList = 150.0e-3, 10.0e-3, 15.0e-3, 155.0e-3 //user-input unit: [mol/m^3]
|
||||
temperature = 293.15 //unit [K]
|
||||
number_ion_species = 4 //number of ions
|
||||
tauList = 1.0, 1.0, 1.0, 1.0
|
||||
IonDiffusivityList = 1.0e-9, 1.0e-9, 1.0e-9, 1.0e-9 //user-input unit: [m^2/sec]
|
||||
IonValenceList = 1, -1, 1, -1 //valence charge of ions; dimensionless; positive/negative integer
|
||||
IonConcentrationList = 4.0e-3, 20.0e-3, 16.0e-3, 0.0e-3 //user-input unit: [mol/m^3]
|
||||
BC_Solid = 0 //solid boundary condition; 0=non-flux BC; 1=surface ion concentration
|
||||
FluidVelDummy = 0.0, 0.0, 0.0 // dummy fluid velocity for debugging
|
||||
BC_InletList = 0, 0, 0, 0
|
||||
BC_OutletList = 0, 0, 0, 0
|
||||
}
|
||||
Poisson {
|
||||
lattice_scheme = "D3Q19"
|
||||
epsilonR = 78.5 //fluid dielectric constant [dimensionless]
|
||||
BC_Inlet = 0 // ->1: fixed electric potential; ->2: sine/cosine periodic electric potential
|
||||
BC_Outlet = 0 // ->1: fixed electric potential; ->2: sine/cosine periodic electric potential
|
||||
//--------------------------------------------------------------------------
|
||||
//--------------------------------------------------------------------------
|
||||
BC_Solid = 2 //solid boundary condition; 1=surface potential; 2=surface charge density
|
||||
SolidLabels = 0 //solid labels for assigning solid boundary condition
|
||||
SolidValues = 0 //if surface potential, unit=[V]; if surface charge density, unit=[C/m^2]
|
||||
WriteLog = true //write convergence log for LB-Poisson solver
|
||||
//------------------------------ advanced setting ------------------------------------
|
||||
timestepMax = 4000 //max timestep for obtaining steady-state electrical potential
|
||||
analysis_interval = 25 //timestep checking steady-state convergence
|
||||
tolerance = 1.0e-10 //stopping criterion for steady-state solution
|
||||
InitialValueLabels = 1, 2
|
||||
InitialValues = 0.0, 0.0
|
||||
}
|
||||
Domain {
|
||||
Filename = "Bacterium.swc"
|
||||
nproc = 2, 1, 1 // Number of processors (Npx,Npy,Npz)
|
||||
n = 64, 64, 64 // Size of local domain (Nx,Ny,Nz)
|
||||
N = 128, 64, 64 // size of the input image
|
||||
voxel_length = 0.01 //resolution; user-input unit: [um]
|
||||
BC = 0 // Boundary condition type
|
||||
ReadType = "swc"
|
||||
ReadValues = 0, 1, 2
|
||||
WriteValues = 0, 1, 2
|
||||
}
|
||||
Analysis {
|
||||
analysis_interval = 100
|
||||
subphase_analysis_interval = 50 // Frequency to perform analysis
|
||||
restart_interval = 5000 // Frequency to write restart data
|
||||
restart_file = "Restart" // Filename to use for restart file (will append rank)
|
||||
N_threads = 4 // Number of threads to use
|
||||
load_balance = "independent" // Load balance method to use: "none", "default", "independent"
|
||||
}
|
||||
Visualization {
|
||||
save_electric_potential = true
|
||||
save_concentration = true
|
||||
save_velocity = false
|
||||
}
|
||||
Membrane {
|
||||
MembraneLabels = 2
|
||||
VoltageThreshold = 0.0, 0.0, 0.0, 0.0
|
||||
MassFractionIn = 1e-1, 1.0, 5e-3, 0.0
|
||||
MassFractionOut = 1e-1, 1.0, 5e-3, 0.0
|
||||
ThresholdMassFractionIn = 1e-1, 1.0, 5e-3, 0.0
|
||||
ThresholdMassFractionOut = 1e-1, 1.0, 5e-3, 0.0
|
||||
}
|
||||
|
||||
Once this has been set, we launch ``lbpm_nernst_planck_simulator`` in the same way as other parallel tools
|
||||
|
||||
.. code:: bash
|
||||
|
||||
mpirun -np 2 $LBPM_BIN/lbpm_nernst_planck_simulator bacterium.db
|
||||
|
||||
Successful output looks like the following
|
||||
|
||||
|
||||
.. code:: bash
|
||||
|
||||
********************************************************
|
||||
Running LBPM Nernst-Planck Membrane solver
|
||||
********************************************************
|
||||
.... Read membrane permeability (MassFractionIn)
|
||||
.... Read membrane permeability (MassFractionOut)
|
||||
.... Read membrane permeability (ThresholdMassFractionIn)
|
||||
.... Read membrane permeability (ThresholdMassFractionOut)
|
||||
.... Read MembraneIonConcentrationList
|
||||
voxel length = 0.010000 micron
|
||||
voxel length = 0.010000 micron
|
||||
Reading SWC file...
|
||||
Number of lines in SWC file: 7
|
||||
Number of lines extracted is: 7
|
||||
shift swc data by 0.150000, 0.140000, 0.140000
|
||||
Media porosity = 1.000000
|
||||
LB Ion Solver: Initialized solid phase & converting to Signed Distance function
|
||||
Domain set.
|
||||
LB Ion Solver: Create ScaLBL_Communicator
|
||||
LB Ion Solver: Set up memory efficient layout
|
||||
LB Ion Solver: Allocating distributions
|
||||
LB Ion Solver: Setting up device map and neighbor list
|
||||
**** Creating membrane data structure ******
|
||||
Number of active lattice sites (rank = 0): 262160
|
||||
Membrane labels: 1
|
||||
label=2, volume fraction = 0.133917
|
||||
Creating membrane data structure...
|
||||
Copy initial neighborlist...
|
||||
Cut membrane links...
|
||||
(cut 7105 links crossing membrane)
|
||||
Construct membrane data structures...
|
||||
Create device data structures...
|
||||
Construct communication data structures...
|
||||
Ion model setup complete
|
||||
Analyze system with sub-domain size = 66 x 66 x 66
|
||||
Set up analysis routines for 4 ions
|
||||
LB Ion Solver: initializing D3Q7 distributions
|
||||
...initializing based on membrane list
|
||||
.... Set concentration(0): inside=0.15 [mol/m^3], outside=0.004 [mol/m^3]
|
||||
.... Set concentration(1): inside=0.01 [mol/m^3], outside=0.02 [mol/m^3]
|
||||
.... Set concentration(2): inside=0.015 [mol/m^3], outside=0.016 [mol/m^3]
|
||||
.... Set concentration(3): inside=0.155 [mol/m^3], outside=0 [mol/m^3]
|
||||
LB Ion Solver: initializing charge density
|
||||
LB Ion Solver: solid boundary: non-flux boundary is assigned
|
||||
LB Ion Solver: inlet boundary for Ion 1 is periodic
|
||||
LB Ion Solver: outlet boundary for Ion 1 is periodic
|
||||
LB Ion Solver: inlet boundary for Ion 2 is periodic
|
||||
LB Ion Solver: outlet boundary for Ion 2 is periodic
|
||||
LB Ion Solver: inlet boundary for Ion 3 is periodic
|
||||
LB Ion Solver: outlet boundary for Ion 3 is periodic
|
||||
LB Ion Solver: inlet boundary for Ion 4 is periodic
|
||||
LB Ion Solver: outlet boundary for Ion 4 is periodic
|
||||
*****************************************************
|
||||
LB Ion Transport Solver:
|
||||
Ion 1: LB relaxation tau = 1
|
||||
Time conversion factor: 1.25e-08 [sec/lt]
|
||||
Internal iteration: 2 [lt]
|
||||
Ion 2: LB relaxation tau = 1
|
||||
Time conversion factor: 1.25e-08 [sec/lt]
|
||||
Internal iteration: 2 [lt]
|
||||
Ion 3: LB relaxation tau = 1
|
||||
Time conversion factor: 1.25e-08 [sec/lt]
|
||||
Internal iteration: 2 [lt]
|
||||
Ion 4: LB relaxation tau = 1
|
||||
Time conversion factor: 1.25e-08 [sec/lt]
|
||||
Internal iteration: 2 [lt]
|
||||
*****************************************************
|
||||
Ion model initialized
|
||||
Main loop time_conv computed from ion 1: 2.5e-08[s/lt]
|
||||
Main loop time_conv computed from ion 2: 2.5e-08[s/lt]
|
||||
Main loop time_conv computed from ion 3: 2.5e-08[s/lt]
|
||||
Main loop time_conv computed from ion 4: 2.5e-08[s/lt]
|
||||
***********************************************************************************
|
||||
LB-Poisson Solver: steady-state MaxTimeStep = 4000; steady-state tolerance = 1e-10
|
||||
LB relaxation tau = 3.5
|
||||
***********************************************************************************
|
||||
LB-Poisson Solver: Use averaged MSE to check solution convergence.
|
||||
LB-Poisson Solver: Use D3Q19 lattice structure.
|
||||
voxel length = 0.010000 micron
|
||||
voxel length = 0.010000 micron
|
||||
Reading SWC file...
|
||||
Number of lines in SWC file: 7
|
||||
Number of lines extracted is: 7
|
||||
shift swc data by 0.150000, 0.140000, 0.140000
|
||||
Media porosity = 1.000000
|
||||
LB-Poisson Solver: Initialized solid phase & converting to Signed Distance function
|
||||
Domain set.
|
||||
LB-Poisson Solver: Create ScaLBL_Communicator
|
||||
LB-Poisson Solver: Set up memory efficient layout
|
||||
LB-Poisson Solver: Allocating distributions
|
||||
LB-Poisson Solver: Setting up device map and neighbor list
|
||||
.... LB-Poisson Solver: check neighbor list
|
||||
.... LB-Poisson Solver: copy neighbor list to GPU
|
||||
Poisson solver created
|
||||
LB-Poisson Solver: initializing D3Q19 distributions
|
||||
LB-Poisson Solver: number of Poisson solid labels: 1
|
||||
label=0, surface potential=0 [V], volume fraction=0
|
||||
LB-Poisson Solver: number of Poisson initial-value labels: 2
|
||||
label=1, initial potential=0 [V], volume fraction=0.96
|
||||
label=2, initial potential=0 [V], volume fraction=0.13
|
||||
POISSON MODEL: Reading restart file!
|
||||
Poisson solver initialized
|
||||
... getting Poisson solver error
|
||||
-------------------------------------------------------------------
|
||||
set coefficients
|
||||
********************************************************
|
||||
CPU time = 0.008526
|
||||
Lattice update rate (per core)= 30.749833 MLUPS
|
||||
Lattice update rate (total)= 61.499666 MLUPS
|
||||
********************************************************
|
@ -20,3 +20,5 @@ a basic introduction to working with LBPM.
|
||||
color/*
|
||||
|
||||
analysis/*
|
||||
|
||||
membrane/*
|
||||
|
@ -1,4 +1,4 @@
|
||||
\============
|
||||
============
|
||||
Publications
|
||||
============
|
||||
|
||||
@ -13,3 +13,5 @@ Publications
|
||||
* J.E. McClure, M. Berrill, W. Gray, C.T. Miller, C.T. "Tracking interface and common curve dynamics for two-fluid flow in porous media. Journal of Fluid Mechanics, 796, 211-232 (2016) https://doi.org/10.1017/jfm.2016.212
|
||||
|
||||
* J.E.McClure, D.Adalsteinsson, C.Pan, W.G.Gray, C.T.Miller "Approximation of interfacial properties in multiphase porous medium systems" Advances in Water Resources, 30 (3): 354-365 (2007) https://doi.org/10.1016/j.advwatres.2006.06.010
|
||||
|
||||
* J.E. McClure, Z. Li "Capturing membrane structure and function in lattice Boltzmann models" arXiv preprint arXiv:2208.14122 https://arxiv.org/pdf/2208.14122.pdf
|
||||
|
172
docs/source/userGuide/models/GaussLaw/GaussLaw.rst
Normal file
172
docs/source/userGuide/models/GaussLaw/GaussLaw.rst
Normal file
@ -0,0 +1,172 @@
|
||||
=============================================
|
||||
Gauss's Law Model
|
||||
=============================================
|
||||
|
||||
The LBPM Gauss's law solver is designed to solve for the electric field in an ionic fluid.
|
||||
|
||||
.. math::
|
||||
:nowrap:
|
||||
|
||||
$$
|
||||
\nabla^2_{fe} \psi (\mathbf{x}_i) = \frac{1}{6 \Delta x^2}
|
||||
\Bigg( 2 \sum_{q=1}^{6} \psi(\mathbf{x}_i + \bm{\xi}_q \Delta t)
|
||||
+ \sum_{q=7}^{18} \psi(\mathbf{x}_i + \bm{\xi}_q \Delta t)
|
||||
- 24 \psi (\mathbf{x}_i) \Bigg) \;,
|
||||
$$
|
||||
|
||||
The equilibrium functions are defined as
|
||||
|
||||
.. math::
|
||||
:nowrap:
|
||||
|
||||
$$
|
||||
g_q^{eq} = w_q \psi\;,
|
||||
$$
|
||||
|
||||
where :math:`w_0=1/2`, :math:`w_q=1/24` for :math:`q=1,\ldots,6` and :math:`w_q=1/48` for :math:`q=7,\ldots,18`
|
||||
|
||||
which implies that
|
||||
|
||||
.. math::
|
||||
:nowrap:
|
||||
|
||||
$$
|
||||
\psi = \sum_{q=0}^{Q} g_q^{eq}\;.
|
||||
$$
|
||||
|
||||
Given a particular initial condition for :math:`\psi`, let us consider application of the standard D3Q19 streaming step based on the equilibrium distributions
|
||||
|
||||
.. math::
|
||||
:nowrap:
|
||||
|
||||
$$
|
||||
g_q^\prime(\mathbf{x}, t) = g_q^{eq}(\mathbf{x}-\bm{\xi}_q\Delta t, t+ \Delta t)\;.
|
||||
$$
|
||||
|
||||
Relative to the solution of Gauss's law, the error is given by
|
||||
|
||||
.. math::
|
||||
:nowrap:
|
||||
|
||||
$$
|
||||
\varepsilon_{\psi} =
|
||||
8 \Big[ -g_0 + \sum_{q=1}^Q g_q^\prime(\mathbf{x}, t) \Big]
|
||||
+ \frac{\rho_e}{\epsilon_r \epsilon_0} \;.
|
||||
$$
|
||||
|
||||
Using the fact that :math:`f_0 = W_0 \psi`, we can compute the value
|
||||
:math:`\psi^\prime` that would kill the error. We set :math:`\varepsilon_{\psi}=0`
|
||||
and rearrange terms to obtain
|
||||
|
||||
.. math::
|
||||
:nowrap:
|
||||
|
||||
$$
|
||||
\psi^\prime (\mathbf{x},t) = \frac{1}{W_0}\Big[ \sum_{q=1}^Q g_q^\prime(\mathbf{x}, t)
|
||||
+ \frac{1}{8}\frac{\rho_e}{\epsilon_r \epsilon_0}\Big] \;.
|
||||
$$
|
||||
|
||||
The local value of the potential is then updated based on a relaxation scheme, which is controlled by the relaxation time :math:`\tau_\psi`
|
||||
|
||||
.. math::
|
||||
:nowrap:
|
||||
|
||||
$$
|
||||
\psi(\mathbf{x},t+\Delta t) \leftarrow \Big(1 - \frac{1}{\tau_\psi} \Big )\psi (\mathbf{x},t)
|
||||
+ \frac{1}{\tau_\psi} \psi^\prime (\mathbf{x},t)\;.
|
||||
$$
|
||||
|
||||
The algorithm can then proceed to the next timestep.
|
||||
|
||||
****************************
|
||||
Example Input File
|
||||
****************************
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
MultiphysController {
|
||||
timestepMax = 25000
|
||||
num_iter_Ion_List = 4
|
||||
analysis_interval = 100
|
||||
tolerance = 1.0e-9
|
||||
visualization_interval = 1000 // Frequency to write visualization data
|
||||
}
|
||||
Stokes {
|
||||
tau = 1.0
|
||||
F = 0, 0, 0
|
||||
ElectricField = 0, 0, 0 //body electric field; user-input unit: [V/m]
|
||||
nu_phys = 0.889e-6 //fluid kinematic viscosity; user-input unit: [m^2/sec]
|
||||
}
|
||||
Ions {
|
||||
MembraneIonConcentrationList = 150.0e-3, 10.0e-3, 15.0e-3, 155.0e-3 //user-input unit: [mol/m^3]
|
||||
temperature = 293.15 //unit [K]
|
||||
number_ion_species = 4 //number of ions
|
||||
tauList = 1.0, 1.0, 1.0, 1.0
|
||||
IonDiffusivityList = 1.0e-9, 1.0e-9, 1.0e-9, 1.0e-9 //user-input unit: [m^2/sec]
|
||||
IonValenceList = 1, -1, 1, -1 //valence charge of ions; dimensionless; positive/negative integer
|
||||
IonConcentrationList = 4.0e-3, 20.0e-3, 16.0e-3, 0.0e-3 //user-input unit: [mol/m^3]
|
||||
BC_Solid = 0 //solid boundary condition; 0=non-flux BC; 1=surface ion concentration
|
||||
//SolidLabels = 0 //solid labels for assigning solid boundary condition; ONLY for BC_Solid=1
|
||||
//SolidValues = 1.0e-5 // user-input surface ion concentration unit: [mol/m^2]; ONLY for BC_Solid=1
|
||||
FluidVelDummy = 0.0, 0.0, 0.0 // dummy fluid velocity for debugging
|
||||
BC_InletList = 0, 0, 0, 0
|
||||
BC_OutletList = 0, 0, 0, 0
|
||||
|
||||
}
|
||||
Poisson {
|
||||
lattice_scheme = "D3Q19"
|
||||
epsilonR = 78.5 //fluid dielectric constant [dimensionless]
|
||||
BC_Inlet = 0 // ->1: fixed electric potential; ->2: sine/cosine periodic electric potential
|
||||
BC_Outlet = 0 // ->1: fixed electric potential; ->2: sine/cosine periodic electric potential
|
||||
//--------------------------------------------------------------------------
|
||||
//--------------------------------------------------------------------------
|
||||
BC_Solid = 2 //solid boundary condition; 1=surface potential; 2=surface charge density
|
||||
SolidLabels = 0 //solid labels for assigning solid boundary condition
|
||||
SolidValues = 0 //if surface potential, unit=[V]; if surface charge density, unit=[C/m^2]
|
||||
WriteLog = true //write convergence log for LB-Poisson solver
|
||||
// ------------------------------- Testing Utilities ----------------------------------------
|
||||
// ONLY for code debugging; the followings test sine/cosine voltage BCs; disabled by default
|
||||
TestPeriodic = false
|
||||
TestPeriodicTime = 1.0 //unit:[sec]
|
||||
TestPeriodicTimeConv = 0.01 //unit:[sec]
|
||||
TestPeriodicSaveInterval = 0.2 //unit:[sec]
|
||||
//------------------------------ advanced setting ------------------------------------
|
||||
timestepMax = 4000 //max timestep for obtaining steady-state electrical potential
|
||||
analysis_interval = 25 //timestep checking steady-state convergence
|
||||
tolerance = 1.0e-10 //stopping criterion for steady-state solution
|
||||
InitialValueLabels = 1, 2
|
||||
InitialValues = 0.0, 0.0
|
||||
|
||||
}
|
||||
Domain {
|
||||
Filename = "Bacterium.swc"
|
||||
nproc = 2, 1, 1 // Number of processors (Npx,Npy,Npz)
|
||||
n = 64, 64, 64 // Size of local domain (Nx,Ny,Nz)
|
||||
N = 128, 64, 64 // size of the input image
|
||||
voxel_length = 0.01 //resolution; user-input unit: [um]
|
||||
BC = 0 // Boundary condition type
|
||||
ReadType = "swc"
|
||||
ReadValues = 0, 1, 2
|
||||
WriteValues = 0, 1, 2
|
||||
}
|
||||
Analysis {
|
||||
analysis_interval = 100
|
||||
subphase_analysis_interval = 50 // Frequency to perform analysis
|
||||
restart_interval = 5000 // Frequency to write restart data
|
||||
restart_file = "Restart" // Filename to use for restart file (will append rank)
|
||||
N_threads = 4 // Number of threads to use
|
||||
load_balance = "independent" // Load balance method to use: "none", "default", "independent"
|
||||
}
|
||||
Visualization {
|
||||
save_electric_potential = true
|
||||
save_concentration = true
|
||||
save_velocity = false
|
||||
}
|
||||
Membrane {
|
||||
MembraneLabels = 2
|
||||
VoltageThreshold = 0.0, 0.0, 0.0, 0.0
|
||||
MassFractionIn = 1e-1, 1.0, 5e-3, 0.0
|
||||
MassFractionOut = 1e-1, 1.0, 5e-3, 0.0
|
||||
ThresholdMassFractionIn = 1e-1, 1.0, 5e-3, 0.0
|
||||
ThresholdMassFractionOut = 1e-1, 1.0, 5e-3, 0.0
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
=============================================
|
||||
Poisson-Boltzmann model
|
||||
=============================================
|
||||
|
||||
The LBPM Poisson-Boltzmann solver is designed to solve the Poisson-Boltzmann equation
|
||||
to solve for the electric field in an ionic fluid.
|
@ -4,3 +4,162 @@ Nernst-Planck model
|
||||
|
||||
The Nernst-Planck model is designed to model ion transport based on the
|
||||
Nernst-Planck equation.
|
||||
|
||||
.. math::
|
||||
:nowrap:
|
||||
|
||||
$$
|
||||
\frac{\partial C_k}{\partial t} + \nabla \cdot \mathbf{j}_k = 0
|
||||
$$
|
||||
|
||||
where
|
||||
|
||||
.. math::
|
||||
:nowrap:
|
||||
|
||||
$$
|
||||
\mathbf{j}_k = C_k \mathbf{u} - D_k \Big( \nabla C_k + \frac{z_k C_k}{V_T} \nabla \psi\Big)
|
||||
$$
|
||||
|
||||
|
||||
|
||||
A LBM solution is developed using a three-dimensional, seven velocity (D3Q7) lattice structure for each species. Each distribution is associated with a particular discrete velocity, such that the concentration is given by their sum,
|
||||
|
||||
.. math::
|
||||
:nowrap:
|
||||
|
||||
$$
|
||||
C_k = \sum_{q=0}^{6} f^k_q \;.
|
||||
$$
|
||||
|
||||
Lattice Boltzmann equations (LBEs) are defined to determine the evolution of the distributions
|
||||
|
||||
.. math::
|
||||
:nowrap:
|
||||
|
||||
$$
|
||||
f^{k}_q (\mathbf{x}_n + \bm{\xi}_q \Delta t, t+ \Delta t)-
|
||||
f^{k}_q (\mathbf{x}_n, t) = \frac{1}{\lambda_k}
|
||||
\Big( f^{k}_q - f^{eq}_q \Big)\;,
|
||||
$$
|
||||
|
||||
where the relaxation time :math:`\lambda_k` controls the bulk diffusion coefficient,
|
||||
|
||||
.. math::
|
||||
:nowrap:
|
||||
|
||||
$$
|
||||
D_k = c_s^2\Big( \lambda_k - \frac 12\Big)\;.
|
||||
$$
|
||||
|
||||
The speed of sound for the D3Q7 lattice model is :math:`c_s^2 = \frac 14` and the weights are :math:`W_0 = 1/4` and :math:`W_1,\ldots, W_6 = 1/8`.
|
||||
Equilibrium distributions are established from the fact that molecular velocity distribution follows a Gaussian distribution within the bulk fluids,
|
||||
|
||||
.. math::
|
||||
:nowrap:
|
||||
|
||||
$$
|
||||
f^{eq}_q = W_q C_k \Big[ 1 + \frac{\bm{\xi_q}\cdot \mathbf{u}^\prime}{c_s^2} \Big]\;.
|
||||
$$
|
||||
|
||||
The velocity is given by
|
||||
|
||||
.. math::
|
||||
:nowrap:
|
||||
|
||||
$$
|
||||
\mathbf{u}^\prime = \mathbf{u} - \frac{z_k D_k}{V_T} \nabla \psi \;.
|
||||
$$
|
||||
|
||||
****************************
|
||||
Example Input File
|
||||
****************************
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
MultiphysController {
|
||||
timestepMax = 25000
|
||||
num_iter_Ion_List = 4
|
||||
analysis_interval = 100
|
||||
tolerance = 1.0e-9
|
||||
visualization_interval = 1000 // Frequency to write visualization data
|
||||
}
|
||||
Stokes {
|
||||
tau = 1.0
|
||||
F = 0, 0, 0
|
||||
ElectricField = 0, 0, 0 //body electric field; user-input unit: [V/m]
|
||||
nu_phys = 0.889e-6 //fluid kinematic viscosity; user-input unit: [m^2/sec]
|
||||
}
|
||||
Ions {
|
||||
MembraneIonConcentrationList = 150.0e-3, 10.0e-3, 15.0e-3, 155.0e-3 //user-input unit: [mol/m^3]
|
||||
temperature = 293.15 //unit [K]
|
||||
number_ion_species = 4 //number of ions
|
||||
tauList = 1.0, 1.0, 1.0, 1.0
|
||||
IonDiffusivityList = 1.0e-9, 1.0e-9, 1.0e-9, 1.0e-9 //user-input unit: [m^2/sec]
|
||||
IonValenceList = 1, -1, 1, -1 //valence charge of ions; dimensionless; positive/negative integer
|
||||
IonConcentrationList = 4.0e-3, 20.0e-3, 16.0e-3, 0.0e-3 //user-input unit: [mol/m^3]
|
||||
BC_Solid = 0 //solid boundary condition; 0=non-flux BC; 1=surface ion concentration
|
||||
//SolidLabels = 0 //solid labels for assigning solid boundary condition; ONLY for BC_Solid=1
|
||||
//SolidValues = 1.0e-5 // user-input surface ion concentration unit: [mol/m^2]; ONLY for BC_Solid=1
|
||||
FluidVelDummy = 0.0, 0.0, 0.0 // dummy fluid velocity for debugging
|
||||
BC_InletList = 0, 0, 0, 0
|
||||
BC_OutletList = 0, 0, 0, 0
|
||||
|
||||
}
|
||||
Poisson {
|
||||
lattice_scheme = "D3Q19"
|
||||
epsilonR = 78.5 //fluid dielectric constant [dimensionless]
|
||||
BC_Inlet = 0 // ->1: fixed electric potential; ->2: sine/cosine periodic electric potential
|
||||
BC_Outlet = 0 // ->1: fixed electric potential; ->2: sine/cosine periodic electric potential
|
||||
//--------------------------------------------------------------------------
|
||||
//--------------------------------------------------------------------------
|
||||
BC_Solid = 2 //solid boundary condition; 1=surface potential; 2=surface charge density
|
||||
SolidLabels = 0 //solid labels for assigning solid boundary condition
|
||||
SolidValues = 0 //if surface potential, unit=[V]; if surface charge density, unit=[C/m^2]
|
||||
WriteLog = true //write convergence log for LB-Poisson solver
|
||||
// ------------------------------- Testing Utilities ----------------------------------------
|
||||
// ONLY for code debugging; the followings test sine/cosine voltage BCs; disabled by default
|
||||
TestPeriodic = false
|
||||
TestPeriodicTime = 1.0 //unit:[sec]
|
||||
TestPeriodicTimeConv = 0.01 //unit:[sec]
|
||||
TestPeriodicSaveInterval = 0.2 //unit:[sec]
|
||||
//------------------------------ advanced setting ------------------------------------
|
||||
timestepMax = 4000 //max timestep for obtaining steady-state electrical potential
|
||||
analysis_interval = 25 //timestep checking steady-state convergence
|
||||
tolerance = 1.0e-10 //stopping criterion for steady-state solution
|
||||
InitialValueLabels = 1, 2
|
||||
InitialValues = 0.0, 0.0
|
||||
|
||||
}
|
||||
Domain {
|
||||
Filename = "Bacterium.swc"
|
||||
nproc = 2, 1, 1 // Number of processors (Npx,Npy,Npz)
|
||||
n = 64, 64, 64 // Size of local domain (Nx,Ny,Nz)
|
||||
N = 128, 64, 64 // size of the input image
|
||||
voxel_length = 0.01 //resolution; user-input unit: [um]
|
||||
BC = 0 // Boundary condition type
|
||||
ReadType = "swc"
|
||||
ReadValues = 0, 1, 2
|
||||
WriteValues = 0, 1, 2
|
||||
}
|
||||
Analysis {
|
||||
analysis_interval = 100
|
||||
subphase_analysis_interval = 50 // Frequency to perform analysis
|
||||
restart_interval = 5000 // Frequency to write restart data
|
||||
restart_file = "Restart" // Filename to use for restart file (will append rank)
|
||||
N_threads = 4 // Number of threads to use
|
||||
load_balance = "independent" // Load balance method to use: "none", "default", "independent"
|
||||
}
|
||||
Visualization {
|
||||
save_electric_potential = true
|
||||
save_concentration = true
|
||||
save_velocity = false
|
||||
}
|
||||
Membrane {
|
||||
MembraneLabels = 2
|
||||
VoltageThreshold = 0.0, 0.0, 0.0, 0.0
|
||||
MassFractionIn = 1e-1, 1.0, 5e-3, 0.0
|
||||
MassFractionOut = 1e-1, 1.0, 5e-3, 0.0
|
||||
ThresholdMassFractionIn = 1e-1, 1.0, 5e-3, 0.0
|
||||
ThresholdMassFractionOut = 1e-1, 1.0, 5e-3, 0.0
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user