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

Recombination/Dissociation flux BCs #727

Open
RemDelaporteMathurin opened this issue Mar 28, 2024 · 0 comments · May be fixed by #753
Open

Recombination/Dissociation flux BCs #727

RemDelaporteMathurin opened this issue Mar 28, 2024 · 0 comments · May be fixed by #753
Labels
enhancement New feature or request fenicsx Issue that is related to the fenicsx support

Comments

@RemDelaporteMathurin
Copy link
Collaborator

RemDelaporteMathurin commented Mar 28, 2024

Recombination and dissociation flux BCs in a multi-species context

Assume you have 2 species A and B, associated with concentrations $c_A$ and $c_B$ in the bulk (in m-3).

At a surface in contact with a gas, you can have these three 2nd order reactions

A + A <-> A2
A + B <-> AB
B + B <-> B2

Species A2, AB, and B2 are associated with partial pressures $P_{A2}$, $P_{AB}$ and $P_{B2}$.

The reactions are associated with forward rate constants $K_{rAA}$, $K_{rAB}$ and $K_{rBB}$ in $\mathrm{m^{4} \ s^{-1}}$, and backwards rate constants $K_{dA2}$, $K_{dAB}$ and $K_{dB2}$ expressed in $\mathrm{m^{-2} \ s^{-1} \ Pa^{-1}}$.

The flux of species A and B at the surface is therefore

$$ \varphi_{A} = -2 K_{rAA} \ c_A \ c_A + 2 K_{dA2} P_{A2} - K_{rAB} \ c_A \ c_B + K_{dAB} P_{AB} $$

$$ \varphi_{B} =- 2 K_{rBB} \ c_B \ c_B + 2 K_{dB2} P_{B2} - K_{rAB} \ c_A \ c_B + K_{dAB} P_{AB} $$

Simple implementation

This is a simple design similar to Reaction. The product pressure here (eg. $P_{AB}$) is not dynamically calculated from the particle flux.

import festim as F

A = F.Species(name="A")
B = F.Species(name="B")

surf_reaction_1 = F.SurfaceReactionBC(
    reactant=[A, A], product_pressure=2.0, k_r=0.1, k_d=1, surface=...
)
surf_reaction_2 = F.SurfaceReactionBC(
    reactant=[A, B], product_pressure=0.0, k_r=0.1, k_d=1, surface=...
)
surf_reaction_3 = F.SurfaceReactionBC(
    reactant=[B, B], product_pressure=1.0, k_r=0.1, k_d=1, surface=...
)

Future proof implementation

But what if we want to dynamically calculate the pressure of the gas species. Then maybe we create a new GasSpecies object? this would allow us later on to implement enclosures (see this verification case).

However, a full implicit implementation of this would require Real finite elements which are not currently supported in dolfinx.

import festim as F

A = F.Species(name="A")
B = F.Species(name="B")

A2 = F.GasSpecies(name="A2", initial_pressure=2.0)
AB = F.GasSpecies(name="AB", initial_pressure=0)
B2 = F.GasSpecies(name="B2", initial_pressure=1.0)

surf_reaction_1 = F.SurfaceReactionBC(reactant=[A, A], product=[A2], k_r=0.1, k_d=1, surface=...)
surf_reaction_2 = F.SurfaceReactionBC(reactant=[A, B], product=[AB], k_r=0.1, k_d=1, surface=...)
surf_reaction_3 = F.SurfaceReactionBC(reactant=[B, B], product=[B2], k_r=0.1, k_d=1, surface=...)
@RemDelaporteMathurin RemDelaporteMathurin added enhancement New feature or request fenicsx Issue that is related to the fenicsx support labels Mar 28, 2024
This was referenced Apr 10, 2024
@RemDelaporteMathurin RemDelaporteMathurin linked a pull request Apr 13, 2024 that will close this issue
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fenicsx Issue that is related to the fenicsx support
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

1 participant