Electrochemistry#
Models of electrochemistry, built on sumfem.models.
The package has three layers, each importing only from those before it:
materials, what the cells are made of:ElectrolyteofIon,RedoxCouple,PorousElectrodeandRegion.models, the equations: charge and transport,ElectrolyteConduction,NernstPlanckandTransientNernstPlanck; kinetics,ButlerVolmerand its variants onElectrodeReaction; membranes,ProtonExchangeMembrane,SchloeglFlowandMembraneProtonFlux; and the flow through the electrodes,ElectrodeFlowandDarcyFlow.cells, assembled from them:RedoxHalfCellandFullCell, with the specificationsHalfCellSpec,MembraneSpecandFlowSpec.
Every name is also imported from here.
The package imports from the core of sumfem, and never the other
way around.
Materials#
What the cells are made of: ions, electrolytes, couples and electrodes.
These describe materials and their properties, as parameters and the expressions of them that the models share, and hold no equations of their own.
Electrolytes:
Electrolyte, a dilute solution ofIon.Redox couples:
RedoxCouple, the reaction of a half-cell.Porous electrodes:
PorousElectrode, and theRegionof a cell filled with electrolyte.
The materials import nothing from the models or the cells.
Electrolytes#
- class sumfem.electrochemistry.Electrolyte(name, domain, ions=(), temperature=298.15, density=None, viscosity=None, concentration_floor=1e-14)[source]#
A dilute electrolyte solution: its ions, temperature and constants.
An electrolyte is a solution of ions in a solvent, e.g. vanadium ions, protons and sulfate in water. In a dilute solution the ions do not interact with each other: each ion \(k\), of charge number \(z_k\), concentration \(c_k\) and diffusivity \(D_k\), moves by diffusion, by migration in the electric field and with the solvent, with the Nernst-Planck flux \(\mathbf{N}_k\) of (44). The solution is electroneutral:
(42)#\[\begin{aligned} \sum_k z_k c_k &= 0. \end{aligned}\]The state of the solution is the concentrations of its ions and the temperature \(T\). Its properties are the diffusivities of the ions and the density and viscosity of the solution.
The electrolyte gives the quantities of dilute-solution theory that the models of a solution share. These are the concentration of each ion,
concentration(), and the charge the ions carry, the current densitycurrent_density():(43)#\[\begin{split}\begin{aligned} \mathbf{i}_l &= F \sum_k z_k \mathbf{N}_k, \\ \mathbf{i}_l &= -\kappa \nabla \phi - F \sum_k z_k t D_k \nabla c_k, \\ \kappa &= \frac{F^2}{R T} \sum_k z_k^2 t D_k c_k, \end{aligned}\end{split}\]with the electrolyte potential \(\phi\), the ionic
conductivity()\(\kappa\), the current of diffusion,diffusion_current(), and a correction \(t\) of every diffusivity, e.g. Bruggeman’s in a porous electrode. Advection carries no charge, by (42). The transport, conduction and reaction models, e.g.NernstPlanck,ElectrolyteConductionandButlerVolmer, build their terms from one electrolyte, so they agree on these quantities.At most one ion may have no field. Its concentration follows from (42), see
balanced. Nothing keeps that concentration positive, so choose the most abundant ion of the supporting electrolyte, e.g. sulfate in a vanadium electrolyte, never an ion of a reaction, and check its minimum, e.g. withminimum_balanced_concentration(). Without ions, the electrolyte has a uniform composition, and only provides the constants, the temperature and the properties of the solution.Its constants, temperature and properties of the solution, and the diffusivity of each ion, see
diffusivity(), are parameters named"<name>.<parameter>", e.g. the temperature"<name>.T". Models that share an electrolyte share these parameters. The temperature, density and viscosity may instead be given as expressions, e.g. fields of a heat equation or of a flow, which couples the models to them.- Parameters:
name (str) – Prefix of the parameter names.
domain (Domain) – The domain of the parameters.
temperature (ExpressionOrDefault) – The temperature: an expression in K, e.g. the field of a heat equation, or the default value of the parameter the electrolyte creates.
density (ExpressionOrDefault) – Density of the solution: an expression in kg/m^3, e.g. a parameter shared with a flow model, or the default value of the parameter the electrolyte creates.
Nonefor no default.viscosity (ExpressionOrDefault) – Dynamic viscosity of the solution, in Pa s, given like the density.
concentration_floor (float) – Default regularization of positive concentrations in mol/m^3, see
positive_part().
- Raises:
ValueError – If there are ions but none has a field, more than one ion has none, the ion without one has no charge, or two ions share a name.
- positive_part(c)[source]#
The smooth positive part
(c + sqrt(c^2 + floor^2)) / 2.Reaction kinetics take it of the concentrations they react, see
ButlerVolmer, so that a concentration that undershoots zero neither reverses a reaction nor enters a logarithm.
- concentration(name)[source]#
Concentration of an ion, with its sign.
That is the field of a transported ion, and the expression given by electroneutrality for the ion without one. The conductivity uses it as it is, as Nernst-Planck migration does, so the current is the charge the ions carry, see
current_density().
- diffusion_current(correction=1.0)[source]#
The current of diffusion, \(F \sum_k z_k t D_k \nabla c_k\).
It is the current of (43) without migration.
- Parameters:
correction (Expr | float) – See
conductivity().- Return type:
- current_density(potential, correction=1.0)[source]#
The current density \(\mathbf{i}_l\) of (43).
It is the charge the ions carry, with the Nernst-Planck fluxes of every ion, also the one given by (42), as the conductivity and the migration use the same concentrations.
- Parameters:
potential (Expr) – The electrolyte potential \(\phi\).
correction (Expr | float) – See
conductivity().
- Return type:
- class sumfem.electrochemistry.Ion(name, charge, diffusivity, concentration=None)[source]#
An ion in an electrolyte solution.
The ion describes itself; the
Electrolyteit is in gives its diffusivity as a parameter,Electrolyte.diffusivity(), and its concentration,Electrolyte.concentration(), which for the ion without a field follows from electroneutrality.- diffusivity#
Diffusion coefficient in free electrolyte, in m^2/s or a quantity with units, e.g.
1e-9 * syu.m**2 / syu.s. It is the default value of the parameter the electrolyte creates.- Type:
- concentration#
The field of a transported ion.
Nonefor the one ion whose concentration follows from electroneutrality.- Type:
Redox couples#
- class sumfem.electrochemistry.RedoxCouple(reduced, oxidized, rate_constant, formal_potential, oxidation_on_discharge, electrons=1, anodic_transfer=0.5, cathodic_transfer=0.5, reactants=None, products=None)[source]#
A redox couple and its reaction at an electrode.
Oxidation turns the reduced ion into the oxidized one, as the reaction
reactants -> products + n e-. The reactants hold the reduced ion and the products the oxidized one, and either may hold other species of the reaction, e.g. VO2+ + H2O -> VO2+ + 2 H+ + e- consumes water and produces protons. The coefficients are those ofRateReaction. The kinetics are those ofButlerVolmer, in the concentrations of the couple.The rate constant, the formal potential and the transfer coefficients are each an expression, used as given, e.g. a rate constant of a temperature field by Arrhenius’ law, or the default of the parameter of the half-cell of the couple, see
expression_or_parameter().- rate_constant#
Standard rate constant, in m/s or with units.
- Type:
ufl.core.expr.Expr | collections.abc.Buffer | numpy._typing._array_like._SupportsArray[numpy.dtype[Any]] | numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]]] | complex | bytes | str | numpy._typing._nested_sequence._NestedSequence[complex | bytes | str] | sympy.core.expr.Expr | None
- formal_potential#
Formal potential, in V or with units.
- Type:
ufl.core.expr.Expr | collections.abc.Buffer | numpy._typing._array_like._SupportsArray[numpy.dtype[Any]] | numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]]] | complex | bytes | str | numpy._typing._nested_sequence._NestedSequence[complex | bytes | str] | sympy.core.expr.Expr | None
- oxidation_on_discharge#
Whether discharge oxidizes the couple, as in the negative half-cell of a battery; the positive half-cell reduces its couple on discharge.
- Type:
- anodic_transfer#
Anodic transfer coefficient.
- Type:
ufl.core.expr.Expr | collections.abc.Buffer | numpy._typing._array_like._SupportsArray[numpy.dtype[Any]] | numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]]] | complex | bytes | str | numpy._typing._nested_sequence._NestedSequence[complex | bytes | str] | sympy.core.expr.Expr | None
- cathodic_transfer#
Cathodic transfer coefficient.
- Type:
ufl.core.expr.Expr | collections.abc.Buffer | numpy._typing._array_like._SupportsArray[numpy.dtype[Any]] | numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]]] | complex | bytes | str | numpy._typing._nested_sequence._NestedSequence[complex | bytes | str] | sympy.core.expr.Expr | None
- reactants#
The coefficient of each ion that oxidation consumes, by name. Defaults to the reduced ion alone, e.g.
{"VO": 1, "H2O": 1}.
- products#
The coefficient of each ion that oxidation produces. Defaults to the oxidized ion alone, e.g.
{"VO2": 1, "H": 2}.
- Raises:
ValueError – If the reactants lack the reduced ion or the products the oxidized one.
- Parameters:
reduced (str)
oxidized (str)
rate_constant (Expr | Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | Expr | None)
formal_potential (Expr | Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | Expr | None)
oxidation_on_discharge (bool)
electrons (int)
anodic_transfer (Expr | Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | Expr | None)
cathodic_transfer (Expr | Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | Expr | None)
- property species: tuple[str, ...]#
the reactants, then the products.
- Type:
Names of the ions of the reaction
- check(ions)[source]#
Check the reaction against the ions of an electrolyte.
- Raises:
ValueError – If an ion of the reaction is not among the ions, or the reaction does not conserve charge.
- Parameters:
- Return type:
None
Porous electrodes#
- class sumfem.electrochemistry.PorousElectrode(name, domain, markers=(), porosity=None, conductivity=None, specific_area=None, fiber_diameter=None, kozeny_carman_constant=None, pore_length=None)[source]#
A porous electrode of carbon fibers, filled with electrolyte.
Each property is an expression, used as given, e.g. a field of another model such as the porosity of a compressed felt or a conductivity of the temperature, or the default of the parameter
"<name>.<property>", such as"<name>.porosity", in SI units or a quantity with units, e.g.0.5 * syu.micrometer, seeexpression_or_parameter(). Models that share an electrode share these. A parameter without a default value must be set on the discretization before it is used.- Parameters:
name (str) – Prefix of the parameter names.
domain (Domain) – The domain of the parameters.
markers (tuple[str, ...]) – Cell markers of the electrode. Empty for the whole domain.
porosity (ExpressionOrDefault) – The porosity.
conductivity (ExpressionOrDefault) – The conductivity of the fiber material, in S/m.
specific_area (ExpressionOrDefault) – The specific area, in 1/m.
fiber_diameter (ExpressionOrDefault) – The fiber diameter, in m.
kozeny_carman_constant (ExpressionOrDefault) – The Kozeny-Carman constant.
pore_length (ExpressionOrDefault) – The characteristic pore length of Ergun’s drag, in m.
- effective_conductivity()[source]#
Bruggeman’s conductivity of the solid.
That is \(\sigma_\text{eff} = (1 - \varepsilon)^{3/2} \sigma\), with the conductivity \(\sigma\) of the fibres and the porosity \(\varepsilon\).
- Return type:
- permeability()[source]#
Kozeny-Carman permeability of the fibers, see
kozeny_carman().- Return type:
- forchheimer()[source]#
Ergun’s inertial drag coefficient, an estimate for fibres, see
ergun_coefficient().- Return type:
Models#
The equations of electrochemistry: residuals of the materials’ fields.
Charge and transport in the electrolyte:
ElectrolyteConductionandNernstPlanck, with storageTransientNernstPlanck.Kinetics:
ExchangeCurrentButlerVolmer,ButlerVolmer,MassTransferButlerVolmerandPistonVelocityButlerVolmer, onElectrodeReaction, with the Butler-Volmer equationbutler_volmer().Membranes:
ProtonExchangeMembrane, with the flow of water ofSchloeglFlow, whose current the protons of an electrode carry through its face,MembraneProtonFlux.The flow of the electrolyte through the electrodes: any
ElectrodeFlow, e.g.DarcyFlow, created from aFlowSetup.
The models import from the materials, and nothing from the cells.
Charge and transport#
- class sumfem.electrochemistry.ElectrolyteConduction(name, potential, electrolyte, region=Region(markers=(), porosity=1.0, bruggeman_exponent=1.5))[source]#
Charge conservation in the electrolyte, \(-(\mathbf{i}_l, \nabla v)\).
The weak form of \(\nabla \cdot \mathbf{i}_l = 0\), with the current density \(\mathbf{i}_l\) of (43), the charge the ions carry, computed by the electrolyte’s
current_density()with the diffusivities corrected for the region, \(t\) the region’stransport, as in (44). Sources, e.g. of anElectrodeReaction, are added to it as models of their own.- Parameters:
name (str) – Name of the model.
potential (Field) – The electrolyte potential.
electrolyte (Electrolyte) – The electrolyte.
region (Region) – The region filled with electrolyte.
- residual()[source]#
Return this component’s contribution to the residual.
The form must be linear in test functions
field.vand contain no trial functions. A contribution that is zero, e.g. for some inputs, isufl.ZeroBaseForm((field.v,)): UFL drops the test function from a form whose terms vanish.- Return type:
- class sumfem.electrochemistry.NernstPlanck(name, ion, electrolyte, potential, region=Region(markers=(), porosity=1.0, bruggeman_exponent=1.5), velocity=None)[source]#
Nernst-Planck transport of one ion, \(-(\mathbf{N}, \nabla w)\).
The molar flux of the ion of charge \(z\) and concentration \(c\) is
(44)#\[\begin{aligned} \mathbf{N} &= -D_\text{eff} \nabla c - \frac{z F}{R T} D_\text{eff} c \nabla \phi + \mathbf{u} c, \end{aligned}\]with its diffusivity \(D\) corrected for the region, \(D_\text{eff} = t D\) with \(t\) the region’s
transport, the electrolyte potential \(\phi\) and the superficial velocity \(\mathbf{u}\). For transient transport, seeTransientNernstPlanck.- Parameters:
name (str) – Name of the model.
ion (Ion) – The ion, one of the electrolyte’s with a field.
electrolyte (Electrolyte) – The electrolyte of the ion.
potential (Field) – The electrolyte potential
phi.region (Region) – The region filled with electrolyte.
velocity (ufl.core.expr.Expr | None) – The superficial velocity
u. Defaults to zero, without advection.
- Raises:
ValueError – If the ion is not in the electrolyte.
TypeError – If the ion follows from electroneutrality.
- residual()[source]#
Return this component’s contribution to the residual.
The form must be linear in test functions
field.vand contain no trial functions. A contribution that is zero, e.g. for some inputs, isufl.ZeroBaseForm((field.v,)): UFL drops the test function from a form whose terms vanish.- Return type:
- class sumfem.electrochemistry.TransientNernstPlanck(name, ion, electrolyte, potential, region=Region(markers=(), porosity=1.0, bruggeman_exponent=1.5), velocity=None)[source]#
Storage and Nernst-Planck transport of one ion.
The conservation law of the ion in a region of porosity \(\varepsilon\),
(45)#\[\begin{aligned} \varepsilon \frac{\partial c}{\partial t} + \nabla \cdot \mathbf{N} &= 0, \end{aligned}\]with the flux \(\mathbf{N}\) of (44). Sources, e.g. of an
ElectrodeReaction, are added to it as models of their own. It is the sum of"<name>_storage", anAccumulationweighted with the region’sstorage, and"<name>_transport", aNernstPlanck.- Parameters:
name (str) – Name of the sum, and prefix of its summands’ names.
ion (Ion) – The ion, one of the electrolyte’s with a field.
electrolyte (Electrolyte) – The electrolyte of the ion.
potential (Field) – The electrolyte potential \(\phi\).
region (Region) – The region filled with electrolyte.
velocity (ufl.core.expr.Expr | None) – The superficial velocity \(\mathbf{u}\). Defaults to zero, without advection.
- Raises:
ValueError – If the ion is not in the electrolyte.
TypeError – If the ion follows from electroneutrality.
- flux()[source]#
The molar flux \(\mathbf{N}\), see
NernstPlanck.flux().- Return type:
Kinetics#
- class sumfem.electrochemistry.ElectrodeReaction(name, solid_potential, electrolyte_potential, electrolyte, reactants=None, products=None, specific_area=None, electrons=1, markers=())[source]#
An electrode reaction
reactants -> products + n e-in a porous electrode.A
RateReactionthat also moves charge between the phases. The volumetric currentf = a i, with the specific areaaand the interfacial current densityiofcurrent_density(), leaves the solid and enters the electrolyte. The reaction happensf / (n F)times per unit volume and time, so it consumes each reactant and produces each product at that rate times its coefficient, e.g.V2+ -> V3+ + e-, orVO2+ + H2O -> VO2+ + 2 H+ + e-, which also produces two protons and consumes one water molecule. Participants without a field get no source. Subclasses give the kinetics.- Parameters:
name (str) – Name of the model.
solid_potential (Field) – The potential of the solid,
phi_s.electrolyte_potential (Field) – The potential of the electrolyte,
phi_l.electrolyte (Electrolyte) – The electrolyte, for the constants and temperature.
reactants (Mapping[ufl.core.expr.Expr, int] | None) – The coefficient of each species that oxidation consumes, by concentration. None for a reaction that only moves charge.
products (Mapping[ufl.core.expr.Expr, int] | None) – The coefficient of each species that oxidation produces.
specific_area (ExpressionOrValue) – Specific area
a. Defaults to the parameter"<name>.specific_area"in 1/m.electrons (int) – Number of electrons
ntransferred.markers (tuple[str, ...]) – Cell markers of the electrode. Empty for the whole domain.
- property electrolyte: Electrolyte#
The electrolyte.
- residual()[source]#
Return this component’s contribution to the residual.
The form must be linear in test functions
field.vand contain no trial functions. A contribution that is zero, e.g. for some inputs, isufl.ZeroBaseForm((field.v,)): UFL drops the test function from a form whose terms vanish.- Return type:
- class sumfem.electrochemistry.ExchangeCurrentButlerVolmer(name, solid_potential, electrolyte_potential, electrolyte, exchange_current=None, equilibrium_potential=None, anodic_transfer=None, cathodic_transfer=None, reduced=None, oxidized=None, specific_area=None, electrons=1, markers=())[source]#
Butler-Volmer kinetics with a given exchange current density.
The current density of
butler_volmer(),i = i0 (exp(alpha_a n F eta / (R T)) - exp(-alpha_c n F eta / (R T)))witheta = phi_s - phi_l - E_eq. The exchange current density may depend on concentrations. With both transfer coefficients one half and one electron,i = 2 i0 sinh(F eta / (2 R T)).- Parameters:
name (str) – Name of the model.
solid_potential (Field) – See
ElectrodeReaction.electrolyte_potential (Field) – See
ElectrodeReaction.electrolyte (Electrolyte) – See
ElectrodeReaction.exchange_current (ExpressionOrValue) – Exchange current density
i0. Defaults to the parameter"<name>.exchange_current"in A/m^2.equilibrium_potential (ExpressionOrValue) – Equilibrium potential
E_eq. Defaults to the parameter"<name>.equilibrium_potential"in V.anodic_transfer (ExpressionOrValue) – Anodic transfer coefficient
alpha_a. Defaults to the parameter"<name>.anodic_transfer", 0.5.cathodic_transfer (ExpressionOrValue) – Cathodic transfer coefficient
alpha_c. Defaults to the parameter"<name>.cathodic_transfer", 0.5.reduced (ufl.core.expr.Expr | None) – See
ElectrodeReaction.oxidized (ufl.core.expr.Expr | None) – See
ElectrodeReaction.specific_area (ExpressionOrValue) – See
ElectrodeReaction.electrons (int) – See
ElectrodeReaction.markers (tuple[str, ...]) – See
ElectrodeReaction.
- class sumfem.electrochemistry.ButlerVolmer(name, solid_potential, electrolyte_potential, electrolyte, reduced, oxidized, specific_area=None, rate_constant=None, formal_potential=None, anodic_transfer=None, cathodic_transfer=None, electrons=1, markers=(), reactants=None, products=None)[source]#
Butler-Volmer kinetics of a redox couple of an electrolyte.
The Butler-Volmer equation, see
butler_volmer(), with an exchange current density from the concentrations of the couple. The interfacial current density is(46)#\[\begin{split}\begin{aligned} i &= n F \left( k_a c_\text{red}^s - k_c c_\text{ox}^s \right), \\ k_a &= k_0 e^{\alpha_a n F \eta / (R T)}, \\ k_c &= k_0 e^{-\alpha_c n F \eta / (R T)}, \\ \eta &= \phi_s - \phi_l - E_0, \end{aligned}\end{split}\]with the standard rate constant \(k_0\), the transfer coefficients \(\alpha_a\) and \(\alpha_c\), the formal potential \(E_0\), and the concentrations \(c_\text{red}^s\) and \(c_\text{ox}^s\) of the reduced and oxidized ion at the electrode surface. These are, by default, the smooth positive parts of the bulk concentrations, \(c^+ = (c + \sqrt{c^2 + c_\text{floor}^2}) / 2\), see
positive_part(). The reduced and oxidized ions are ions in the electrolyte, given by name.Subclasses change the kinetics by overriding
surface_concentrations(),rate_constants()orcurrent_density().- Parameters:
name (str) – Name of the model.
solid_potential (Field) – See
ElectrodeReaction.electrolyte_potential (Field) – See
ElectrodeReaction.electrolyte (Electrolyte) – The electrolyte of the ions.
reduced (str) – Name of the reduced ion.
oxidized (str) – Name of the oxidized ion.
specific_area (ExpressionOrValue) – See
ElectrodeReaction.rate_constant (ExpressionOrValue) – Standard rate constant
k0. Defaults to the parameter"<name>.rate_constant"in m/s.formal_potential (ExpressionOrValue) – Formal potential
E0. Defaults to the parameter"<name>.formal_potential"in V.anodic_transfer (ExpressionOrValue) – Anodic transfer coefficient
alpha_a. Defaults to the parameter"<name>.anodic_transfer", 0.5.cathodic_transfer (ExpressionOrValue) – Cathodic transfer coefficient
alpha_c. Defaults to the parameter"<name>.cathodic_transfer", 0.5.electrons (int) – See
ElectrodeReaction.markers (tuple[str, ...]) – See
ElectrodeReaction.reactants (Mapping[str, int] | None) – The coefficient of each ion that oxidation consumes, by name, see
ElectrodeReaction. Defaults to the reduced ion alone, e.g.{"VO": 1, "H2O": 1}for VO2+ + H2O -> VO2+ + 2 H+ + e-.products (Mapping[str, int] | None) – The coefficient of each ion that oxidation produces. Defaults to the oxidized ion alone, e.g.
{"VO2": 1, "H": 2}.
- Raises:
ValueError – If the reactants lack the reduced ion or the products the oxidized one, or if an ion of the reaction other than the couple has no field, as the ion that follows from electroneutrality.
- surface_concentrations()[source]#
Concentrations of the reduced and oxidized ion at the surface.
These are the positive parts of the bulk concentrations.
- equilibrium_potential()[source]#
Nernst’s potential
E0 + R T / (n F) ln(c_ox / c_red).The concentrations are the positive parts of the bulk ones, each plus the electrolyte’s concentration floor.
- Return type:
- overpotential()[source]#
phi_s - phi_lminus theequilibrium_potential().- Return type:
- class sumfem.electrochemistry.MassTransferButlerVolmer(name, solid_potential, electrolyte_potential, electrolyte, reduced, oxidized, velocity, fiber_diameter=None, density=None, viscosity=None, sherwood_factor=7.0, reynolds_exponent=0.4, speed_floor=1e-16, transfer_floor=1e-14, specific_area=None, rate_constant=None, formal_potential=None, anodic_transfer=None, cathodic_transfer=None, electrons=1, markers=(), reactants=None, products=None)[source]#
Butler-Volmer kinetics limited by mass transfer to the fibers.
The surface concentrations of (46) are those at which mass transfer from the bulk, with the coefficients \(m_\text{red}\) and \(m_\text{ox}\), balances the reaction:
(47)#\[\begin{split}\begin{aligned} m_\text{red} \left( c_\text{red}^+ - c_\text{red}^s \right) &= k_a c_\text{red}^s - k_c c_\text{ox}^s, \\ m_\text{ox} \left( c_\text{ox}^s - c_\text{ox}^+ \right) &= k_a c_\text{red}^s - k_c c_\text{ox}^s, \end{aligned}\end{split}\]two linear equations, solved in closed form. Each coefficient has a small floor added. The coefficients follow from the Sherwood number \(\mathrm{Sh} = a \, \mathrm{Re}^b\) of the flow past fibers of diameter \(d\):
(48)#\[\begin{split}\begin{aligned} m_\text{red} &= \mathrm{Sh} \frac{D_\text{red}}{d}, \\ m_\text{ox} &= \mathrm{Sh} \frac{D_\text{ox}}{d}, \\ \mathrm{Re} &= \frac{\rho |\mathbf{u}| d}{\mu}, \end{aligned}\end{split}\]with the diffusivities \(D_\text{red}\) and \(D_\text{ox}\) of the reduced and oxidized ion in free electrolyte, and the density \(\rho\) and viscosity \(\mu\) of the electrolyte. The defaults \(a = 7\) and \(b = 0.4\) are the correlation of Krishnamurthy et al., 2011, and the surface concentrations those of equation 20 of Aghabarari et al., 2026.
- Parameters:
name (str) – Name of the model.
solid_potential (Field) – See
ButlerVolmer.electrolyte_potential (Field) – See
ButlerVolmer.electrolyte (Electrolyte) – See
ButlerVolmer.reduced (str) – See
ButlerVolmer.oxidized (str) – See
ButlerVolmer.velocity (ufl.core.expr.Expr) – The superficial velocity
u.fiber_diameter (ExpressionOrValue) – Fiber diameter
d. Defaults to the parameter"<name>.fiber_diameter"in m.density (ExpressionOrValue) – Density
rhoof the electrolyte. Defaults to thedensityof the electrolyte.viscosity (ExpressionOrValue) – Dynamic viscosity
muof the electrolyte. Defaults to theviscosityof the electrolyte.sherwood_factor (float) – The factor
aof the Sherwood number.reynolds_exponent (float) – The exponent
bof the Sherwood number.speed_floor (float) – Regularization of
|u|, in m/s.transfer_floor (float) – Regularization added to
k_m, in m/s.specific_area (ExpressionOrValue) – See
ButlerVolmer.rate_constant (ExpressionOrValue) – See
ButlerVolmer.formal_potential (ExpressionOrValue) – See
ButlerVolmer.anodic_transfer (ExpressionOrValue) – See
ButlerVolmer.cathodic_transfer (ExpressionOrValue) – See
ButlerVolmer.electrons (int) – See
ButlerVolmer.markers (tuple[str, ...]) – See
ButlerVolmer.
- reynolds_number()[source]#
The Reynolds number
rho |u| d / muof the flow past a fiber.- Return type:
- class sumfem.electrochemistry.PistonVelocityButlerVolmer(name, solid_potential, electrolyte_potential, electrolyte, reduced, oxidized, fiber_distance=None, transfer_floor=1e-14, **kwargs)[source]#
Butler-Volmer kinetics limited by diffusion between the fibres.
The surface concentrations balance the reaction with mass transfer as in (47), with the piston velocities
(49)#\[\begin{split}\begin{aligned} m_\text{red} &= \frac{D_\text{red}}{\delta}, \\ m_\text{ox} &= \frac{D_\text{ox}}{\delta}, \end{aligned}\end{split}\]the diffusivities of the reduced and oxidized ion in free electrolyte over the mean distance \(\delta\) between the fibres, see equations 23 and 24 of Shah et al., 2008. Unlike
MassTransferButlerVolmer, the transfer does not depend on the flow.- Parameters:
name (str) – Name of the model.
solid_potential (Field) – See
ButlerVolmer.electrolyte_potential (Field) – See
ButlerVolmer.electrolyte (Electrolyte) – See
ButlerVolmer.reduced (str) – See
ButlerVolmer.oxidized (str) – See
ButlerVolmer.fiber_distance (ExpressionOrValue) – Mean distance
deltabetween the fibres. Defaults to the parameter"<name>.fiber_distance"in m.transfer_floor (float) – Regularization added to
gamma, in m/s.**kwargs (Any) – The other arguments of
ButlerVolmer.
Membranes#
- class sumfem.electrochemistry.ProtonExchangeMembrane(name, potential, markers, water=None, pressure=None, fixed_charge=None, proton_diffusivity=None, water_diffusivity=None, electrokinetic_permeability=None, hydraulic_permeability=None, viscosity=None, temperature=298.15)[source]#
A proton-exchange membrane saturated with water.
The membrane of Bernardi and Verbrugge, 1991, as in the full cell of Shah et al., 2008, Section 3.2. Its fixed charges, of concentration \(c_f\), are neutralized by protons, the only mobile ions, so the proton concentration is \(c_\text{H} = c_f\) throughout. The membrane is then an Ohmic conductor for the electrolyte potential \(\phi\), and the water, of concentration \(c_w\), moves with the velocity \(\mathbf{v}\) of (51):
(50)#\[\begin{split}\begin{aligned} -\nabla \cdot (\kappa_m \nabla \phi) &= 0, \\ \kappa_m &= \frac{F^2}{R T} D_\text{H} c_f, \\ \frac{\partial c_w}{\partial t} + \nabla \cdot (-D_w \nabla c_w + \mathbf{v} c_w) &= 0, \end{aligned}\end{split}\]with the proton and water diffusivities \(D_\text{H}\) and \(D_w\) of the membrane. The current density \(-\kappa_m \nabla \phi\) uses the sign of
ElectrolyteConduction, so with one potential across the membrane and the electrodes beside it, the current is continuous across its faces, and so is the flux of water with one water field.Every equation is a bulk equation on the cells of the membrane,
markers, whose thickness the mesh resolves. Its fields may extend beyond them: in aFullCellthe potential and the water live on both electrodes and the membrane, and each electrode’s models add the equations there. The faces then need no term of their own for these fields: their continuity, and that of their fluxes, is natural. The protons are not a field of the membrane; the faces pass them to the electrodes’ own fields withproton_flux(), one condition per face.The membrane is the sum of
"<name>_conduction", aConduction; with a water field,"<name>_water_storage", anAccumulation, and"<name>_water_diffusion", aDiffusion; and with a pressure,"<name>_flow", aSchloeglFlow, and"<name>_water_advection", aConservativeAdvectionof the water. Without a pressure, the water does not flow, and only diffuses.The membrane creates its constants and properties as parameters named
"<name>.<parameter>": Faraday’s constant, the gas constant and the temperature, seeElectrolyte, and one for each argument fromfixed_chargeon, with the argument as its default value.- Parameters:
name (str) – Name of the membrane, and prefix of its parameters and models.
potential (Field) – The electrolyte potential \(\phi\), e.g. one field over the membrane and the electrodes.
water (Field | None) – The water concentration \(c_w\), or
Nonewithout water transport.pressure (Field | None) – The pressure \(p\) of (51), or
Nonewithout flow.fixed_charge (ExpressionOrDefault) – The concentration \(c_f\) of fixed charges, in mol/m^3 or with units.
proton_diffusivity (ExpressionOrDefault) – \(D_\text{H}\) in the membrane, in m^2/s or with units.
water_diffusivity (ExpressionOrDefault) – \(D_w\) in the membrane, in m^2/s or with units.
electrokinetic_permeability (ExpressionOrDefault) – \(k_\phi\), in m^2 or with units.
hydraulic_permeability (ExpressionOrDefault) – \(k_p\), in m^2 or with units.
viscosity (ExpressionOrDefault) – The viscosity \(\mu\) of water, in Pa s or with units.
temperature (ExpressionOrDefault) – The temperature \(T\): an expression in K, e.g. the field of a heat equation, or the default value of a parameter.
- property constants: Electrolyte#
Faraday’s constant, the gas constant and the temperature.
- current_density()[source]#
The current density \(-\kappa_m \nabla \phi\) of the membrane.
- Return type:
- proton_flux(name, protons, measure, charge=1.0)[source]#
The membrane current carried by the protons of an electrode.
See
MembraneProtonFlux.- Parameters:
- Returns:
The proton flux at the face.
- Return type:
- property velocity: Expr#
The velocity of the water in the membrane, zero without a pressure.
It holds on the membrane’s cells only, see
SchloeglFlow.
- class sumfem.electrochemistry.SchloeglFlow(name, pressure, potential, charge_density=None, electrokinetic_permeability=None, hydraulic_permeability=None, viscosity=None, markers=())[source]#
Flow of water through a charged membrane, by Schlögl’s equation.
The protons that neutralize the fixed charges of the membrane drag the water with them, so the velocity of the water has an electro-osmotic part besides the pressure-driven one:
(51)#\[\begin{split}\begin{aligned} \mathbf{v} &= -\frac{k_\phi}{\mu} \rho \nabla \phi - \frac{k_p}{\mu} \nabla p, \\ \nabla \cdot \mathbf{v} &= 0, \end{aligned}\end{split}\]with the electrokinetic and hydraulic permeabilities \(k_\phi\) and \(k_p\), the viscosity \(\mu\) of water, and the charge density \(\rho = F c_\text{H}\) of the mobile protons. The residual is \(-(\mathbf{v}, \nabla q)\) on the pressure, as for
Darcyflow.The equation is a bulk equation on the cells of the membrane,
markers, and the velocity holds there only: \(\rho\) is the charge of the membrane’s mobile ions, which the fixed charges set. With one pressure over the membrane and the electrodes beside it, each with a flow model of its own, the pressure is continuous across the faces, and so, weakly, is the normal velocity.- Parameters:
name (str) – Name of the model.
pressure (Field) – The pressure \(p\).
potential (ufl.core.expr.Expr) – The electrolyte potential \(\phi\).
charge_density (ExpressionOrValue) – The charge density \(\rho\) of the mobile ions. Defaults to the parameter
"<name>.charge_density"in C/m^3.electrokinetic_permeability (ExpressionOrValue) – \(k_\phi\). Defaults to the parameter
"<name>.electrokinetic_permeability"in m^2.hydraulic_permeability (ExpressionOrValue) – \(k_p\). Defaults to the parameter
"<name>.hydraulic_permeability"in m^2.viscosity (ExpressionOrValue) – \(\mu\). Defaults to the parameter
"<name>.viscosity"in Pa s.markers (tuple[str, ...]) – Cell markers of the membrane. Empty for the whole domain.
- residual()[source]#
Return this component’s contribution to the residual.
The form must be linear in test functions
field.vand contain no trial functions. A contribution that is zero, e.g. for some inputs, isufl.ZeroBaseForm((field.v,)): UFL drops the test function from a form whose terms vanish.- Return type:
- class sumfem.electrochemistry.MembraneProtonFlux(name, protons, membrane, measure, charge=1.0)[source]#
The protons of an electrode carry the current of a membrane beside it.
A cation-exchange membrane passes protons only, so at the face between an electrode and the membrane the protons of the electrode carry the whole current \(\mathbf{i}_m\) of the membrane,
(52)#\[\begin{aligned} \mathbf{N}_\text{H} \cdot \mathbf{n} &= \frac{\mathbf{i}_m \cdot \mathbf{n}}{z_\text{H} F}, \end{aligned}\]with the normal \(\mathbf{n}\) out of the electrode, and every other ion has no flux. The residual is \((\mathbf{N}_\text{H} \cdot \mathbf{n}, w)\) on the face, with the test function \(w\) of the protons. The current is that of the membrane’s side of the face,
ProtonExchangeMembrane.current_density().With the ion of the electrolyte that follows from electroneutrality, e.g. sulfate, the zero flux of that ion is no natural condition: it holds when the protons carry the current, by this condition. The proton concentration at the face is not held at the fixed charge, so the model has no Donnan potential across the face.
The condition is a surface term of the electrode’s proton equation, on one face of the membrane and from one side, the electrode’s: each face needs its own, with the protons of the electrode on that face. It is not an equation of the membrane, which has no proton field.
- Parameters:
name (str) – Name of the model.
protons (Field) – The proton concentration \(c_\text{H}\) of the electrode.
membrane (ProtonExchangeMembrane) – The membrane.
measure (ufl.Measure) – The interface measure of the face, with the electrode on its
"+"side and the membrane on its"-"side, frominterface().charge (float) – The charge number \(z_\text{H}\) of the protons.
- Raises:
ValueError – If the measure is not that of an interface with the membrane on its
"-"side and the protons’ subdomain on its"+"side.
- flux()[source]#
The proton flux \(\mathbf{N}_\text{H} \cdot \mathbf{n}\) out of the electrode, on its side of the face.
- Return type:
- residual()[source]#
Return this component’s contribution to the residual.
The form must be linear in test functions
field.vand contain no trial functions. A contribution that is zero, e.g. for some inputs, isufl.ZeroBaseForm((field.v,)): UFL drops the test function from a form whose terms vanish.- Return type:
Flow through the electrodes#
- class sumfem.electrochemistry.ElectrodeFlow(setup)[source]#
The flow of the electrolytes through the electrodes of a full cell.
A flow gives the cell the superficial velocity \(\mathbf{u}\) of each electrode,
velocity(), which carries the ions in the electrode, out of its outlet and to its tank, and its own models and conditions, which the cell adds to its own. The cell holds the ions’ inflow at the inlets itself, (56), so the flow needs to take in the electrolyte there at the inlet velocity of theFlowSetup.A subclass creates its unknowns and models from the setup in its constructor. Its models may hold time derivatives, e.g. of the velocity of transient Stokes flow, which the cell’s simulation steps in time with the rest. Its
pressurelives onFlowSetup.electrolyte, which the cell shares with what lies between the electrodes, seeFullCell.Example
Darcy flow with a storage of the pressure, a flow that changes in time, is
DarcyFlowwith one more model, given to the cell by itsFlowSpec:A Brinkman-Forchheimer or a transient Stokes flow creates a velocity field on each electrode’s subdomain,
FlowSetup.subdomains, and its pressure on the electrolyte’s,FlowSetup.electrolyte, withBrinkmanForchheimerorStokesand anAccumulationof the velocity, returns them fromvelocity()andpressure, and holds the inlet velocity on the velocity inconditions().- Parameters:
setup (FlowSetup) – What the cell gives the flow.
- abstract property pressure: Field#
The pressure of the flow, on
FlowSetup.electrolyte.
- initialize(discretization)[source]#
Set the initial state of the flow’s unknowns, none by default.
- Parameters:
discretization (Discretization) – The discretization of the cell.
- Return type:
None
- class sumfem.electrochemistry.DarcyFlow(setup)[source]#
Darcy flow through the electrodes, with one pressure.
The pressure \(p\) lives on
FlowSetup.electrolyte, seeElectrodeFlow.pressure. In each electrode it followsDarcyflow,"<name>_<side>_darcy", with the Kozeny-Carman permeability of its fibres,PorousElectrode.permeability(), and the viscosity of its electrolyte.The electrolyte enters each electrode at its inlet at the inlet velocity,
"<name>_<side>_inflow", aBoundaryFlux, and leaves at its outlet, held at the outlet pressure,conditions().The pressure’s scale is the pressure drop of a uniform flow at the inlet velocity through the negative electrode over the domain’s length scale, if the defaults give it, else one pascal.
- Parameters:
setup (FlowSetup) – What the cell gives the flow.
- property pressure: Field#
The pressure, on
FlowSetup.electrolyte.
- initialize(discretization)[source]#
Set the pressure to the outlet pressure.
- Parameters:
discretization (Discretization) – The discretization of the cell.
- Return type:
None
- class sumfem.electrochemistry.FlowSetup(name, domain, electrolyte, electrodes, subdomains, viscosities, densities, inlets, outlets, inlet_velocity, outlet_pressure, degree)[source]#
What a full cell gives the flow of its electrolytes.
- Parameters:
- domain#
The domain of the cell.
- electrolyte#
The subdomain of the electrolyte, the electrodes and what lies between them, where the pressure lives.
- electrodes#
The porous electrodes, by side,
"negative"and"positive", with their cell markers and properties, e.g. the permeability of their fibres.- Type:
Mapping[str, sumfem.electrochemistry.materials.electrode.PorousElectrode]
- subdomains#
The subdomain of each electrode, by side, e.g. for a velocity field of the electrode.
- Type:
Mapping[str, sumfem.symbolic.domains.Subdomain]
- viscosities#
The dynamic viscosity of each side’s electrolyte.
- Type:
Mapping[str, ufl.core.expr.Expr]
- densities#
The density of each side’s electrolyte.
- Type:
Mapping[str, ufl.core.expr.Expr]
- inlet_velocity#
The superficial velocity at the inlets.
- Type:
- outlet_pressure#
The gauge pressure at the outlets.
- Type:
Cells#
Cells of a redox flow battery, assembled from the materials and models.
Half-cells:
RedoxHalfCell, negative or positive, of any redox couple and electrolyte.Full cells:
FullCell, two half-cells, each aHalfCellSpec, and a membrane between them, aMembraneSpec, with the flow of the electrolytes from their tanks, aFlowSpec.
Half-cells#
- class sumfem.electrochemistry.RedoxHalfCell(domain, ions, reservoir, couple, electrode, channels=(), velocity=None, mass_transfer=None, fiber_distance=None, collector=('CurrentCollector',), membrane=('Membrane',), outlet=(), proton_flux=False, density=1399.8, viscosity=0.006963, temperature=298.15, degree=1, name='cell', phi_s=None, phi_l=None, fields=None, electrolyte_name='electrolyte')[source]#
A half-cell of a redox flow battery, of a couple of dissolved ions.
The macro-homogeneous porous-electrode model of RFBniCS, Aghabarari et al., 2026, Section II, for any couple, electrolyte and sign of the half-cell.
The unknowns are the potential \(\phi_s\) of the solid and \(\phi_l\) of the electrolyte, and the concentration \(c_k\) of every ion with a reservoir concentration. In the porous electrode, of porosity \(\varepsilon\) and specific area \(a\), charge is conserved in the solid and the electrolyte, which exchange the current \(a i\) of the reaction, and each ion is stored, transported and produced:
(53)#\[\begin{split}\begin{aligned} -\nabla \cdot (\sigma_\text{eff} \nabla \phi_s) + a i &= 0, \\ \nabla \cdot \mathbf{i}_l - a i &= 0, \\ \varepsilon \frac{\partial c_k}{\partial t} + \nabla \cdot \mathbf{N}_k &= \nu_k \frac{a i}{n F}, \\ \sum_k z_k c_k &= 0. \end{aligned}\end{split}\]The terms are those of the components of the cell:
\(\sigma_\text{eff}\), the effective conductivity of the solid,
PorousElectrode.effective_conductivity;\(\mathbf{i}_l\), the current density of the electrolyte, (43);
\(\mathbf{N}_k\), the Nernst-Planck flux of the ion of charge \(z_k\), (44), with the superficial velocity \(\mathbf{u}\) of the electrolyte;
\(i\), the interfacial current density of the couple, (46), at surface concentrations limited by mass transfer, (47), with flow or a fibre distance;
\(\nu_k\) and \(n\), the coefficient of the ion in the reaction of the couple, negative for a reactant, positive for a product and zero for an ion that takes no part, and the number of electrons, see
RedoxCouple.
The one ion without a reservoir concentration follows from electroneutrality, the last equation. In free channels, \(\varepsilon = 1\) and there is no reaction or solid.
The cell is galvanostatic, with the current density \(j\) of the cell through the membrane, positive on discharge. On discharge the couple is oxidized in the negative half-cell, \(s = 1\), and reduced in the positive one, \(s = -1\). With the outward normal \(\mathbf{n}\), the current enters the solid at the current collector and leaves the electrolyte at the membrane,
(54)#\[\begin{split}\begin{aligned} \sigma_{\text{eff}} \nabla \phi_s \cdot \mathbf{n} &= s j r && \text{at the current collector}, \\ \mathbf{i}_l \cdot \mathbf{n} &= s j && \text{at the membrane}, \\ \mathbf{N}_\text{H} \cdot \mathbf{n} &= \frac{s j}{z_\text{H} F} && \text{at the membrane, with a proton flux}, \\ (\mathbf{N}_k - \mathbf{u} c_k) \cdot \mathbf{n} &= 0 && \text{at an outlet}, \end{aligned}\end{split}\]where the ratio \(r\) of the membrane area to the collector area makes the total currents equal, see
balance_currents(). Other boundaries carry no flux.The model,
model, is the sum of:"<name>_solid": the first equation of (53) without the reaction,Conduction;"<name>_reaction": the kinetics (46), with (47) under mass transfer,ButlerVolmer,MassTransferButlerVolmerwith mass transfer, orPistonVelocityButlerVolmerwith a fibre distance, which adds the reaction to (53);with collector and membrane markers,
"<name>_collector_current"and"<name>_membrane_current": the first two conditions of (54),BoundaryFlux;for the electrode’s pores and, with a suffix
"_channels", the free channels: the charge in the electrolyte,ElectrolyteConduction, and the balance (45) of every ion,TransientNernstPlanck, named"<name>_<ion>", whose summands are"<name>_<ion>_storage"and"<name>_<ion>_transport";with an outlet,
"<name>_outflow_<ion>": the outlet condition,Outflow;with a proton flux,
"<name>_proton_flux": the proton condition at the membrane, aBoundaryFluxof the ion"H".
- Parameters:
domain (Domain) – The domain of the cell.
ions (Sequence[Ion]) – The ions of the electrolyte, with their charges \(z_k\) and diffusivities \(D_k\), without fields: the cell creates the field of every ion that has a reservoir concentration.
reservoir (Mapping[str, float | sympy.Expr]) – The concentration of each transported ion in the reservoir, in mol/m^3 or a quantity with units, the default of the parameter
"<name>.c0_<ion>".couple (RedoxCouple) – The redox couple and its reaction: the coefficients \(\nu_k\), \(n\) and \(s\), and the kinetics (46), whose parameters are those of the cell:
"<name>.rate_constant"\(k_0\),"<name>.formal_potential"\(E_0\),"<name>.anodic_transfer"\(\alpha_a\) and"<name>.cathodic_transfer"\(\alpha_c\).electrode (PorousElectrode) – The porous electrode: \(\varepsilon\), \(a\) and \(\sigma\).
channels (tuple[str, ...]) – Cell markers of free channels. Empty for none.
velocity (ufl.core.expr.Expr | None) – The superficial velocity \(\mathbf{u}\), or
Nonewithout flow.mass_transfer (bool | None) – Limit the kinetics by mass transfer to the fibres, (47), with the coefficients of the flow’s correlation, (48), which needs a velocity. Defaults to whether there is one.
fiber_distance (ExpressionOrDefault) – The mean distance \(\delta\) between the fibres, in m or with units. Limits the kinetics by (47) with the piston velocities, (49), instead, with or without flow.
collector (tuple[str, ...] | None) – Facet markers of the current collector, or
Nonefor a cell whose collector is resolved, e.g. in a full cell.membrane (tuple[str, ...] | None) – Facet markers of the membrane, or
Nonefor a cell whose membrane is resolved.outlet (tuple[str, ...]) – Facet markers of an outlet. Empty for none.
proton_flux (bool) – Carry the membrane current by protons, the ion
"H", through the membrane, the third condition of (54).density (ExpressionOrDefault) – Density of the electrolyte, for the mass transfer, see
Electrolyte. Pass the parameter of a flow model to share it.viscosity (ExpressionOrDefault) – Dynamic viscosity of the electrolyte, given like the density.
temperature (ExpressionOrDefault) – The temperature of the electrolyte, an expression, e.g. the field of a heat equation, or the default of its parameter, in K, see
Electrolyte.degree (int) – Degree of the Lagrange elements of the unknowns.
name (str) – Prefix of the cell’s own parameters,
"<name>.<parameter>", and of the names of its models,"<name>_<model>". The current density \(j\) is the parameter"<name>.current", in A/m^2, and the area ratio \(r\)"<name>.area_ratio".phi_s (Field | None) – The potential \(\phi_s\) of the solid, if it exists, e.g. over the electrode and its current collector. Created on the domain otherwise.
phi_l (Field | None) – The potential \(\phi_l\) of the electrolyte, if it exists, e.g. over the electrodes and the membrane of a full cell.
fields (Mapping[str, Field] | None) – Existing fields of transported ions, by name, e.g. of water shared with a membrane. The others are created on the domain.
electrolyte_name (str) – Prefix of the parameters of the electrolyte, see
Electrolyte.
- Raises:
ValueError – For mass transfer or an outlet without a velocity, a proton flux without membrane markers, a reservoir concentration of an ion that the electrolyte does not have, a reservoir that lacks not exactly one ion, an ion of the reaction without one, a reaction that does not conserve charge, or a balanced ion without charge.
- property couple: RedoxCouple#
The redox couple and its reaction.
- property electrode: PorousElectrode#
The porous electrode.
- property electrolyte: Electrolyte#
The electrolyte.
- property reaction: ButlerVolmer#
The reaction in the electrode.
- property inlet: Mapping[str, Parameter]#
Reservoir concentration of each transported ion, by ion name.
- inlet_conditions(markers)[source]#
The reservoir concentration of every transported ion on some facets.
- Parameters:
- Return type:
- equilibrium_potential(discretization)[source]#
Nernst’s potential of the couple at its reservoir concentrations.
That is
E0 + R T / (n F) ln(c_ox / c_red), seeequilibrium_potential(), with the reservoir concentrations as given,reservoir_concentration(), averaged over the electrode, so that a formal potential or a temperature given as an expression, e.g. of a field, counts with its values on the discretization.- Parameters:
discretization (Discretization) – The discretization, for the values of the formal potential, the constants and any fields they hold.
- Returns:
The mean potential in V.
- Return type:
- initialize(discretization)[source]#
Set a state at rest, as RFBniCS starts.
The concentrations start at their reservoir values, the solid at zero and the electrolyte at minus the formal potential, its mean over the electrode if it is an expression.
- Parameters:
discretization (Discretization)
- Return type:
None
- balance_currents(discretization)[source]#
Set the area ratio from the areas of membrane and current collector.
- Raises:
ValueError – For a cell without collector or membrane markers.
- Parameters:
discretization (Discretization)
- Return type:
None
- voltage(discretization)[source]#
The half-cell voltage in V.
That is the mean solid potential on the current collector minus the mean electrolyte potential on the membrane.
- Raises:
ValueError – For a cell without collector or membrane markers.
- Parameters:
discretization (Discretization)
- Return type:
- state_of_charge(discretization)[source]#
The share of the reduced ion in the couple, over the cell.
- Parameters:
discretization (Discretization)
- Return type:
- minimum_balanced_concentration(discretization)[source]#
The smallest concentration of the ion given by electroneutrality.
Nothing keeps that concentration positive. A negative minimum means the electrolyte cannot stay neutral with the computed concentrations, e.g. after a time step that is too long, or because the balanced ion is not abundant enough, see
Electrolyte.- Parameters:
discretization (Discretization) – The discretization of the cell.
- Returns:
The minimum over the nodes of the concentrations’ space, over all processes.
- Return type:
Full cells#
- class sumfem.electrochemistry.FullCell(domain, negative, positive, membrane=MembraneSpec(fixed_charge=None, proton_diffusivity=None, water_diffusivity=None, electrokinetic_permeability=None, hydraulic_permeability=None, viscosity=None, temperature=298.15), collector_conductivity=1000.0, flow=None, degree=1, name='cell')[source]#
The full cell of a redox flow battery.
The cell of Shah et al., 2008, corrected: from left to right, a current collector, the negative porous electrode, a proton-exchange membrane, the positive porous electrode and a current collector, each a layer of the mesh, see
mesh_data(). Each unknown lives where it is defined: the potential of each side’s solid on its collector and electrode, the electrolyte potential, the water and, with flow, the pressure on both electrodes and the membrane, and the other ions of each side in its electrode.The cell is made of:
a
RedoxHalfCellfor each side, whose collector and membrane are layers of the mesh;the
ProtonExchangeMembrane, whose protons carry the current through each face,MembraneProtonFlux, so the ion that follows from electroneutrality, e.g. sulfate, stays on its side. Shah et al. hold the protons at the fixed charge at the faces instead, which lets that ion carry part of the current through them;Ohmic conduction in the collectors,
Conduction;the current density of the cell at the positive terminal, with the negative terminal grounded, see
conditions();with flow, the flow of the electrolytes through the electrodes from their inlets to their outlets, (56), an
ElectrodeFlowsuch asDarcyFlow, seeflow, and tanks,update_tanks().
- Parameters:
domain (Domain) – The domain of the cell, with the markers of
mesh_data().negative (HalfCellSpec) – The negative side.
positive (HalfCellSpec) – The positive side.
membrane (MembraneSpec) – The properties of the membrane. Parameters without defaults by default.
collector_conductivity (ExpressionOrDefault) – The conductivity of the collectors: an expression, used as given, e.g. one of the temperature, or the default of the parameter
"<name>.collector_conductivity", in S/m or with units.flow (FlowSpec | None) – The flow of the electrolytes,
Nonefor none.degree (int) – Degree of the Lagrange elements of the unknowns.
name (str) – Prefix of the cell’s own parameters and models.
- Raises:
ValueError – If only one side transports water.
- static mesh_data(marked)[source]#
Mesh data with the unions of the layers the cell’s unknowns live on.
The cell’s mesh has the cell markers of its layers,
"NegativeCollector","NegativeElectrode","Membrane","PositiveElectrode"and"PositiveCollector", and the facet markers"NegativeTerminal"and"PositiveTerminal", the outer faces of the collectors,"NegativeFace"and"PositiveFace", the faces of the membrane, and with flow,"NegativeInlet","NegativeOutlet","PositiveInlet"and"PositiveOutlet", the ends of the electrodes. This adds"NegativeSolid"and"PositiveSolid", a collector and its electrode, and"Electrolyte", the electrodes and the membrane.
- property model: Residual#
The sum of all models of the cell.
These are the models of the half-cells,
"negative_<model>"and"positive_<model>", of the membrane,"<name>_membrane_<model>", the conduction in the collectors,"<name>_<side>_collector", the current at the positive terminal,"<name>_terminal_current", the proton fluxes at the faces,"<name>_<side>_protons", and with flow, the models of the flow, e.g. those ofDarcyFlow, and the inflow of each ion of each electrode,"<name>_<side>_inflow_<ion>".
- property half_cells: Mapping[str, RedoxHalfCell]#
The half-cells,
"negative"and"positive".
- property membrane: ProtonExchangeMembrane#
The membrane.
- property flow: ElectrodeFlow | None#
The flow of the electrolytes, if any.
- property pressure: Field | None#
The pressure of the flow over the electrodes and the membrane,
Nonewithout flow.
- conditions()[source]#
The Dirichlet conditions of the cell.
These are the negative terminal at zero potential, which fixes the potentials, and with flow, those of the flow, e.g. the outlet pressure of
DarcyFlow.- Return type:
- initialize(discretization)[source]#
Set a state at rest, as Shah et al. start.
The concentrations start at the reservoir values of the sides, the defaults of their parameters
"<side>.c0_<ion>", the electrolyte potential at zero, the solid of each side at the equilibrium potential of its couple at those concentrations, by Nernst’s equation, so that no current flows, and the flow as it initializes itself, seeElectrodeFlow.initialize.- Raises:
ValueError – If the sides start with different water concentrations, which one water field cannot hold.
- Parameters:
discretization (Discretization)
- Return type:
None
- voltage(discretization)[source]#
The cell voltage in V: the mean potential of the positive terminal minus that of the negative terminal.
- Parameters:
discretization (Discretization)
- Return type:
- tank_volume(discretization, side)[source]#
The volume of a side’s tank, per unit of the dimensions the mesh lacks, e.g. per metre of depth for a 2D cell.
- Parameters:
discretization (Discretization) – The discretization of the cell.
side (str) –
"negative"or"positive".
- Raises:
ValueError – For a cell without flow, or without tanks.
- Return type:
- amount(discretization, side, ion)[source]#
The amount of an ion in a side’s electrode and its tank.
The amounts are per unit of the dimensions the mesh lacks, e.g. per metre of depth for a 2D cell.
- Parameters:
discretization (Discretization) – The discretization of the cell.
side (str) –
"negative"or"positive".ion (str) – The name of an ion of the side with a field. The water of the membrane is in neither side’s amount.
- Returns:
The amount in mol, that of the tank included with tanks.
- Return type:
- state_of_charge(discretization, side)[source]#
The state of charge of a side’s couple, its tank included.
- Parameters:
discretization (Discretization) – The discretization of the cell.
side (str) –
"negative"or"positive".
- Returns:
the reduced ion of a couple oxidized on discharge, the oxidized ion of one reduced on discharge.
- Return type:
The share of the ion that charging makes
- update_tanks(discretization, dt)[source]#
Take a step of the tanks after a time step of the cell.
Each tank, of volume \(V\), mixes what the outlet of its electrode returns, Shah et al.’s eq. 33 with the fluxes of the outlet and the inlet,
(55)#\[\begin{aligned} V \frac{\mathrm{d} c_k^\text{in}}{\mathrm{d} t} &= \int_\text{outlet} \mathbf{u} \cdot \mathbf{n}\, c_k \,\mathrm{d}s - v_\text{in} \int_\text{inlet} c_k^\text{in} \,\mathrm{d}s, \end{aligned}\]see (56). The step takes the outflow of the cell’s new state and the inflow of the inlet concentrations the cell took its step with, so the cell and its tanks together conserve every ion. The concentrations of the tanks are the reservoir parameters of the half-cells,
"<side>.c0_<ion>". A cell without tanks keeps them.- Parameters:
discretization (Discretization) – The discretization of the cell, after the step.
dt (float) – The size of the step, in s.
- Return type:
None
- class sumfem.electrochemistry.HalfCellSpec(ions, reservoir, couple, porosity, conductivity, specific_area, fiber_distance=None, fiber_diameter=None, kozeny_carman_constant=None, density=1399.8, viscosity=0.006963, temperature=298.15)[source]#
One side of a full cell: its electrolyte, its couple and its electrode.
The properties of the electrode and the electrolyte, from the porosity on, are each an expression, used as given, e.g. a field of another model such as the porosity of a compressed felt or a viscosity of the temperature, or the default of the parameter the cell creates, see
expression_or_parameter(). The reservoir concentrations are values: with flow, the tanks change them.- ions#
The ions of the electrolyte, see
RedoxHalfCell. Water,"H2O", if transported, must be an ion of both sides, since the water moves through the membrane.
- reservoir#
The initial concentration of each transported ion, see
RedoxHalfCell, and with flow, that of its tank. The protons,"H", must be one of them.- Type:
Mapping[str, float | sympy.core.expr.Expr]
- couple#
The redox couple of the side.
- porosity#
The porosity of the electrode.
- Type:
ufl.core.expr.Expr | collections.abc.Buffer | numpy._typing._array_like._SupportsArray[numpy.dtype[Any]] | numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]]] | complex | bytes | str | numpy._typing._nested_sequence._NestedSequence[complex | bytes | str] | sympy.core.expr.Expr | None
- conductivity#
The conductivity of the electrode’s fibres, in S/m or with units.
- Type:
ufl.core.expr.Expr | collections.abc.Buffer | numpy._typing._array_like._SupportsArray[numpy.dtype[Any]] | numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]]] | complex | bytes | str | numpy._typing._nested_sequence._NestedSequence[complex | bytes | str] | sympy.core.expr.Expr | None
- specific_area#
The specific area of the electrode, in 1/m or with units.
- Type:
ufl.core.expr.Expr | collections.abc.Buffer | numpy._typing._array_like._SupportsArray[numpy.dtype[Any]] | numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]]] | complex | bytes | str | numpy._typing._nested_sequence._NestedSequence[complex | bytes | str] | sympy.core.expr.Expr | None
- fiber_distance#
The mean distance between the fibres, in m or with units, which limits the kinetics by the piston velocities, see
PistonVelocityButlerVolmer.Nonefor kinetics without them, limited by the flow’s mass transfer with flow.- Type:
ufl.core.expr.Expr | collections.abc.Buffer | numpy._typing._array_like._SupportsArray[numpy.dtype[Any]] | numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]]] | complex | bytes | str | numpy._typing._nested_sequence._NestedSequence[complex | bytes | str] | sympy.core.expr.Expr | None
- fiber_diameter#
The diameter of the electrode’s fibres, in m or with units, for the permeability with flow, and the mass transfer without a fibre distance.
- Type:
ufl.core.expr.Expr | collections.abc.Buffer | numpy._typing._array_like._SupportsArray[numpy.dtype[Any]] | numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]]] | complex | bytes | str | numpy._typing._nested_sequence._NestedSequence[complex | bytes | str] | sympy.core.expr.Expr | None
- kozeny_carman_constant#
The Kozeny-Carman constant of the permeability with flow, see
kozeny_carman().- Type:
ufl.core.expr.Expr | collections.abc.Buffer | numpy._typing._array_like._SupportsArray[numpy.dtype[Any]] | numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]]] | complex | bytes | str | numpy._typing._nested_sequence._NestedSequence[complex | bytes | str] | sympy.core.expr.Expr | None
- density#
The density of the electrolyte, in kg/m^3 or with units.
- Type:
ufl.core.expr.Expr | collections.abc.Buffer | numpy._typing._array_like._SupportsArray[numpy.dtype[Any]] | numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]]] | complex | bytes | str | numpy._typing._nested_sequence._NestedSequence[complex | bytes | str] | sympy.core.expr.Expr | None
- viscosity#
The dynamic viscosity of the electrolyte, in Pa s or with units, which the flow and the mass transfer share.
- Type:
ufl.core.expr.Expr | collections.abc.Buffer | numpy._typing._array_like._SupportsArray[numpy.dtype[Any]] | numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]]] | complex | bytes | str | numpy._typing._nested_sequence._NestedSequence[complex | bytes | str] | sympy.core.expr.Expr | None
- temperature#
The temperature of the electrolyte, in K, e.g. the field of a heat equation.
- Type:
ufl.core.expr.Expr | collections.abc.Buffer | numpy._typing._array_like._SupportsArray[numpy.dtype[Any]] | numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]]] | complex | bytes | str | numpy._typing._nested_sequence._NestedSequence[complex | bytes | str] | sympy.core.expr.Expr | None
- Raises:
ValueError – If the side does not transport protons.
- Parameters:
couple (RedoxCouple)
porosity (Expr | Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | Expr | None)
conductivity (Expr | Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | Expr | None)
specific_area (Expr | Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | Expr | None)
fiber_distance (Expr | Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | Expr | None)
fiber_diameter (Expr | Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | Expr | None)
kozeny_carman_constant (Expr | Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | Expr | None)
density (Expr | Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | Expr | None)
viscosity (Expr | Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | Expr | None)
temperature (Expr | Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | Expr | None)
- class sumfem.electrochemistry.MembraneSpec(fixed_charge=None, proton_diffusivity=None, water_diffusivity=None, electrokinetic_permeability=None, hydraulic_permeability=None, viscosity=None, temperature=298.15)[source]#
The properties of the membrane of a full cell.
Each is an expression, used as given, or the default of the parameter
"<membrane>.<property>", in SI units or with units,Nonefor a parameter without a default, seeProtonExchangeMembrane. The last three are those of the flow of water, with aFlowSpec.- Parameters:
fixed_charge (Expr | Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | Expr | None)
proton_diffusivity (Expr | Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | Expr | None)
water_diffusivity (Expr | Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | Expr | None)
electrokinetic_permeability (Expr | Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | Expr | None)
hydraulic_permeability (Expr | Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | Expr | None)
viscosity (Expr | Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | Expr | None)
temperature (Expr | Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | Expr | None)
- fixed_charge#
The concentration of the fixed charges, in mol/m^3.
- Type:
ufl.core.expr.Expr | collections.abc.Buffer | numpy._typing._array_like._SupportsArray[numpy.dtype[Any]] | numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]]] | complex | bytes | str | numpy._typing._nested_sequence._NestedSequence[complex | bytes | str] | sympy.core.expr.Expr | None
- proton_diffusivity#
The proton diffusivity in the membrane, in m^2/s.
- Type:
ufl.core.expr.Expr | collections.abc.Buffer | numpy._typing._array_like._SupportsArray[numpy.dtype[Any]] | numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]]] | complex | bytes | str | numpy._typing._nested_sequence._NestedSequence[complex | bytes | str] | sympy.core.expr.Expr | None
- water_diffusivity#
The water diffusivity in the membrane, in m^2/s.
- Type:
ufl.core.expr.Expr | collections.abc.Buffer | numpy._typing._array_like._SupportsArray[numpy.dtype[Any]] | numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]]] | complex | bytes | str | numpy._typing._nested_sequence._NestedSequence[complex | bytes | str] | sympy.core.expr.Expr | None
- electrokinetic_permeability#
The electrokinetic permeability, in m^2.
- Type:
ufl.core.expr.Expr | collections.abc.Buffer | numpy._typing._array_like._SupportsArray[numpy.dtype[Any]] | numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]]] | complex | bytes | str | numpy._typing._nested_sequence._NestedSequence[complex | bytes | str] | sympy.core.expr.Expr | None
- hydraulic_permeability#
The hydraulic permeability, in m^2.
- Type:
ufl.core.expr.Expr | collections.abc.Buffer | numpy._typing._array_like._SupportsArray[numpy.dtype[Any]] | numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]]] | complex | bytes | str | numpy._typing._nested_sequence._NestedSequence[complex | bytes | str] | sympy.core.expr.Expr | None
- viscosity#
The viscosity of the water in the membrane, in Pa s.
- Type:
ufl.core.expr.Expr | collections.abc.Buffer | numpy._typing._array_like._SupportsArray[numpy.dtype[Any]] | numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]]] | complex | bytes | str | numpy._typing._nested_sequence._NestedSequence[complex | bytes | str] | sympy.core.expr.Expr | None
- temperature#
The temperature of the membrane, in K, e.g. the field of a heat equation.
- Type:
ufl.core.expr.Expr | collections.abc.Buffer | numpy._typing._array_like._SupportsArray[numpy.dtype[Any]] | numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]]] | complex | bytes | str | numpy._typing._nested_sequence._NestedSequence[complex | bytes | str] | sympy.core.expr.Expr | None
- class sumfem.electrochemistry.FlowSpec(inlet_velocity=None, outlet_pressure=0.0, tank_ratio=None, model=<class 'sumfem.electrochemistry.models.electrode_flow.DarcyFlow'>)[source]#
The flow of the electrolytes through the electrodes, from their tanks.
The flow of the electrolytes is a
ElectrodeFlow, by defaultDarcyFlow, which gives the superficial velocity \(\mathbf{u}\) of each electrode. The electrolyte of each side enters its electrode at the inlet with the superficial velocity \(v_\text{in}\) and the concentrations \(c_k^\text{in}\) of its tank, and leaves at the outlet, held at the pressure \(p_\text{out}\), with the flow,(56)#\[\begin{split}\begin{aligned} -\mathbf{u} \cdot \mathbf{n} &= v_\text{in} && \text{at the inlet}, \\ -\mathbf{N}_k \cdot \mathbf{n} &= v_\text{in} c_k^\text{in} && \text{at the inlet}, \\ p &= p_\text{out} && \text{at the outlet}, \\ (\mathbf{N}_k - \mathbf{u} c_k) \cdot \mathbf{n} &= 0 && \text{at the outlet}, \end{aligned}\end{split}\]with the superficial velocity \(\mathbf{u}\) of the electrode and the Nernst-Planck flux \(\mathbf{N}_k\) of each ion. The inlet holds the flux of the ions, the flow’s, rather than their concentration as Shah et al. do, so that the cell takes in exactly what its tank gives.
- Parameters:
inlet_velocity (Expr | Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | Expr | None)
outlet_pressure (Expr | Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | Expr | None)
tank_ratio (float | None)
model (Callable[[FlowSetup], ElectrodeFlow])
- inlet_velocity#
The superficial velocity at the inlets of both electrodes: an expression, or the default of the parameter
"<cell>.inlet_velocity", in m/s or with units.- Type:
ufl.core.expr.Expr | collections.abc.Buffer | numpy._typing._array_like._SupportsArray[numpy.dtype[Any]] | numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]]] | complex | bytes | str | numpy._typing._nested_sequence._NestedSequence[complex | bytes | str] | sympy.core.expr.Expr | None
- outlet_pressure#
The gauge pressure at the outlets, given like the inlet velocity, in Pa.
- Type:
ufl.core.expr.Expr | collections.abc.Buffer | numpy._typing._array_like._SupportsArray[numpy.dtype[Any]] | numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]]] | complex | bytes | str | numpy._typing._nested_sequence._NestedSequence[complex | bytes | str] | sympy.core.expr.Expr | None
- tank_ratio#
The volume of each tank over the volume of electrolyte in the pores of its electrode,
Nonefor tanks so large that the electrolyte at the inlets does not change.- Type:
float | None
- model#
The flow, created from the
FlowSetupthe cell gives it: anElectrodeFlowsubclass, or any callable of the setup, e.g. afunctools.partial()of one with options of its own.