-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Diffusion: tests, fixed coefficients in the solver, & tutorial (#2226)
By careful re-analysis of the diffusion solver we found that the coeffiecients of the LHS need an additional factor of the CV Volume. Scopes be creeping. During the analysis it became apparent that the during coupling to the cable equation proper raises at lot of potential problems. Conversion of ionic current densities $i_X$ to mass transfer is $\dot c_X = \frac{i_XA}{q F V}$ with volume, area, Faraday's constant, and charge. Now, people are interested in using neutral species $n$, ie $q=0$ for which we also should expect $i_n=0$. Yet we need to special case on this (and assert zero current) to avoid ill-defined division. That's the smaller problem. The more worrying issue is this: We construct a coupling term from the cable equation to the ionic diffusion via $\dot c_X = \frac{i_XA}{q F V}$. Yet, there's no backreaction to the cable equation, unless the user explicitly constructs it. How? Well, the way ions should feed back to the voltage is this: `iX = g(U-eX)` this is the conductance model and should be found in an NMODL file and `eX` $\sim \ln\frac{X_i}{X_o}$ which is the Nernst equation found, again, in a builtin NMODL file. But, for technical reasons we had to invent a special diffusive concentration `Xd` which is _not_ identical to `Xi`. For proper behaviour, we should have used `Xd` instead of `Xi` in the Nernst term above. So, a non-standard Nernst module needs to be used. This brings me to the great change in this context: remove the offending term and carefully document how to retrofit it in NMODL and add the proper Nernst model, too. fixes #2145 requires #2209 --------- Co-authored-by: Jannik Luboeinski <[email protected]> Co-authored-by: Jannik Luboeinski <[email protected]>
- Loading branch information
1 parent
637712f
commit 257e74f
Showing
37 changed files
with
1,137 additions
and
418 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.