Skip to content

Conversation

@ck768
Copy link
Collaborator

@ck768 ck768 commented Oct 22, 2025

Boundary conditions chapter:

  • flux
  • concentration
  • surface reactions
  • temperature

@ck768 ck768 linked an issue Oct 22, 2025 that may be closed by this pull request
9 tasks
@ck768 ck768 marked this pull request as ready for review October 28, 2025 18:46
Copy link
Collaborator

@RemDelaporteMathurin RemDelaporteMathurin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First pass on the Concentration part.

name: python3
---

# Concentration #
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think instead of Concentration + Particle Flux + Surface reactions, we can have everything under "Hydrogen Transport"?


## Defining fixed concentration ##

BCs need to be assigned to surfaces using FESTIM's `SurfaceSubdomain` class. To define the concentration of a specific species, we can use `FixedConcentrationBC`:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
BCs need to be assigned to surfaces using FESTIM's `SurfaceSubdomain` class. To define the concentration of a specific species, we can use `FixedConcentrationBC`:
BCs need to be assigned to surfaces using FESTIM's `SurfaceSubdomain` class. To set the concentration of a specific species on a boundary, we can use `FixedConcentrationBC`:


$$

BC = 10 + x^2 + T(t+2)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
BC = 10 + x^2 + T(t+2)
c = 10 + x^2 + T(t+2)

BC = 10 + x^2 + T(t+2)

$$

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To do so, we define a python function.

Comment on lines +49 to +53
```{code-cell} ipython3
my_custom_value = lambda x, t, T: 10 + x[0]**2 + T *(t + 2)

my_bc = FixedConcentrationBC(subdomain=boundary, value=my_custom_value, species=H)
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we should add a note block showing that this is equivalent to

def my_custom_value(x, t, T):
    return 10 + x[0]**2 + T *(t + 2)

my_bc = FixedConcentrationBC(subdomain=boundary, value=my_custom_value, species=H)
```

## Choosing a solubility law ##
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above. We need to show more about the integration. For example, show that this is equivalent to a FixedConcentrationBC but it's just providing convenience


$$ S_{ext} = \varphi \cdot f(x) $$

$$\varphi = 1\cdot 10^{13} \quad \mathrm{m}^{-2}\mathrm{s}^{-1}$$
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$$\varphi = 1\cdot 10^{13} \quad \mathrm{m}^{-2}\mathrm{s}^{-1}$$
$$\varphi = 10^{13} \quad \mathrm{m}^{-2}\mathrm{s}^{-1}$$

my_bc = HenrysBC(subdomain=3, H_0=1.5, E_H=0.2, species=H, pressure=pressure_value)
```

## Plasma implantation approximation ##
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this one could go in a section "Hydrogen transport: advanced"

my_bc = HenrysBC(subdomain=3, H_0=1.5, E_H=0.2, species=H, pressure=pressure_value)
```

## Plasma implantation approximation ##
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this application, because it's a "real-world" application, I would use real numbers.

Typically, the implantation range is a few nanometers for example.

my_bc = HenrysBC(subdomain=3, H_0=1.5, E_H=0.2, species=H, pressure=pressure_value)
```

## Plasma implantation approximation ##
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's actually an issue here: this is not a boundary condition approximation, you set an actual volumetric source.

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 this pull request may close these issues.

Boundary conditions

3 participants