-
Notifications
You must be signed in to change notification settings - Fork 10
BCs #134
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
base: festim2
Are you sure you want to change the base?
BCs #134
Conversation
RemDelaporteMathurin
left a comment
There was a problem hiding this 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 # |
There was a problem hiding this comment.
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`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| BC = 10 + x^2 + T(t+2) | |
| c = 10 + x^2 + T(t+2) |
| BC = 10 + x^2 + T(t+2) | ||
|
|
||
| $$ | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| To do so, we define a python function. |
| ```{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) | ||
| ``` |
There was a problem hiding this comment.
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 ## |
There was a problem hiding this comment.
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}$$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| $$\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 ## |
There was a problem hiding this comment.
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 ## |
There was a problem hiding this comment.
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 ## |
There was a problem hiding this comment.
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.
Boundary conditions chapter: