Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constants like FARADAY, gasconstant are defined in multiple sources #324

Closed
pramodk opened this issue Nov 15, 2019 · 0 comments · Fixed by #746
Closed

Constants like FARADAY, gasconstant are defined in multiple sources #324

pramodk opened this issue Nov 15, 2019 · 0 comments · Fixed by #746
Milestone

Comments

@pramodk
Copy link
Member

pramodk commented Nov 15, 2019

NMODL translated MOD files get unit constants typically from share/lib/nrnunits.lib.in. But there are other source files that hardcode some of the constants. For example:

→ grep -r -n FARADAY nn/src/*
nn/src/nmodl/version.c:624: * UNITS { FARADAY = 96520 (coul) }
nn/src/nrniv/kschan.h:74:// e/(kT) e/k=11.604589 from hoc's FARADAY and R values
nn/src/nrnoc/eion.c:218:#define FARADAY 96485.309
nn/src/nrnoc/eion.c:221:#define FARADAY 96485.33289
nn/src/nrnoc/eion.c:225:#define ktf (1000.*gasconstant*(celsius + 273.15)/FARADAY)
nn/src/nrnoc/eion.c:302:	return (.001)*z*FARADAY*(eci - eco);
nn/src/oc/hoc_init.c:93:	"FARADAY", 96485.309,	/*coulombs/mole*/
nn/src/oc/hoc_init.c:97:	/* also see FARADAY and gasconstant in ../nrnoc/eion.c */
nn/src/oc/hoc_init.c:98:	"FARADAY", 96485.33289,	/*coulombs/mole*/
nn/src/oc/version.c:715: * FARADAY and R (molar gas constant) added as built-in constants.

This also applied to CoreNEURON. We should uniform these definitions into single location to be consistent.

@ohm314 ohm314 added this to the Release v8.0 milestone May 4, 2020
@nrnhines nrnhines modified the milestones: Release v8.0, Release v8.0a Jun 21, 2020
@nrnhines nrnhines mentioned this issue Oct 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants