driftlet 1.3.2 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/docs/device.md +79 -6
- package/docs/internals.md +5 -2
- package/docs/kit.md +7 -3
- package/docs/numerics.md +11 -0
- package/docs/statistics.md +7 -2
- package/docs/templates.md +157 -2
- package/llms.txt +19 -14
- package/package.json +1 -1
- package/src/boundaries.js +200 -14
- package/src/checks.js +13 -2
- package/src/describe.js +3 -1
- package/src/device.js +70 -5
- package/src/diffuse.js +240 -0
- package/src/impedance.js +2 -1
- package/src/kit.js +6 -2
- package/src/lawRows.js +26 -1
- package/src/newton.js +31 -5
- package/src/regions.js +6 -3
- package/src/solution.js +46 -6
- package/src/solver.js +87 -9
- package/src/start.js +37 -8
- package/src/statistics.js +1 -0
- package/src/steady.js +51 -22
- package/src/timeSteps.js +10 -6
- package/src/types.js +16 -2
- package/types/boundaries.d.ts +8 -0
- package/types/diffuse.d.ts +25 -0
- package/types/newton.d.ts +1 -1
- package/types/solver.d.ts +8 -2
- package/types/types.d.ts +36 -1
package/types/types.d.ts
CHANGED
|
@@ -250,6 +250,28 @@ export type FaceReactionDef = {
|
|
|
250
250
|
*/
|
|
251
251
|
K?: Record<string, number>;
|
|
252
252
|
};
|
|
253
|
+
/**
|
|
254
|
+
* A face's diffuse layer on one side, in a solution.
|
|
255
|
+
*/
|
|
256
|
+
export type DiffuseLayerResult = {
|
|
257
|
+
/**
|
|
258
|
+
* the drop from the side's edge node to the plane, φ_plane − φ_edge (V)
|
|
259
|
+
*/
|
|
260
|
+
psi: number;
|
|
261
|
+
/**
|
|
262
|
+
* the layer's charge (C/m²)
|
|
263
|
+
*/
|
|
264
|
+
charge: number;
|
|
265
|
+
/**
|
|
266
|
+
* each ion's surface excess, ∫ (c − c_edge) dx (mol/m²)
|
|
267
|
+
*/
|
|
268
|
+
excess: Record<string, number>;
|
|
269
|
+
/**
|
|
270
|
+
* each ion's concentration at the plane, c e^{−zFψ/RT} (mol/m³; on a
|
|
271
|
+
* lattice, over its crowding; for what a face reaction takes or makes there, times its level's drop across the layer)
|
|
272
|
+
*/
|
|
273
|
+
plane: Record<string, number>;
|
|
274
|
+
};
|
|
253
275
|
/**
|
|
254
276
|
* One face between consecutive regions. For different materials under a 'pinned' or
|
|
255
277
|
* 'capacitive' law, exactly one alignment (step or dipole) is required.
|
|
@@ -279,6 +301,14 @@ export type InterfaceDef = {
|
|
|
279
301
|
* C/m²
|
|
280
302
|
*/
|
|
281
303
|
sheetCharge?: number;
|
|
304
|
+
/**
|
|
305
|
+
* a Gouy–Chapman diffuse layer below the grid on each strictly
|
|
306
|
+
* neutral (ε = 0) side of a charged face, of relative permittivity epsr: the side's share of the
|
|
307
|
+
* face's charge held as its ions' surface excesses, the face's reactions at its plane
|
|
308
|
+
*/
|
|
309
|
+
diffuse?: {
|
|
310
|
+
epsr: number;
|
|
311
|
+
};
|
|
282
312
|
/**
|
|
283
313
|
* per-species laws (default equilibrium
|
|
284
314
|
* where present on both sides and mobile on one, blocked otherwise; a species reacting at the
|
|
@@ -717,7 +747,8 @@ export type Solution = {
|
|
|
717
747
|
* (V) and sheet charge (C/m²), its displacement D (C/m²), each species' flux N across it and each face
|
|
718
748
|
* reaction's net rate (mol/(m²·s), toward +x and forward), how each species that crosses it does (its
|
|
719
749
|
* link type); for those crossing by permeability, the one-way fluxes [toward +x, toward −x] whose
|
|
720
|
-
* difference is N; with gates, each one's fraction open and the voltage they follow, φ_right − φ_left (V)
|
|
750
|
+
* difference is N; with gates, each one's fraction open and the voltage they follow, φ_right − φ_left (V; between the diffuse layers' planes, where it has them);
|
|
751
|
+
* with a diffuse layer, each side's
|
|
721
752
|
*/
|
|
722
753
|
interfaces: {
|
|
723
754
|
left: string;
|
|
@@ -731,6 +762,10 @@ export type Solution = {
|
|
|
731
762
|
oneWay?: Record<string, [number, number]>;
|
|
732
763
|
gates?: Record<string, number>;
|
|
733
764
|
V?: number;
|
|
765
|
+
diffuse?: {
|
|
766
|
+
left?: DiffuseLayerResult;
|
|
767
|
+
right?: DiffuseLayerResult;
|
|
768
|
+
};
|
|
734
769
|
}[];
|
|
735
770
|
/**
|
|
736
771
|
* each bulk reaction's net rate per node (mol/(m³·s), forward minus backward, NaN where it doesn't
|