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

[BUG] Mobile species defined in only one subdomain, but with a common interface for some other species #897

Open
jorgensd opened this issue Oct 25, 2024 · 0 comments
Labels
bug Something isn't working fenicsx Issue that is related to the fenicsx support

Comments

@jorgensd
Copy link
Collaborator

jorgensd commented Oct 25, 2024

When defining a mobile species that lives only in a subdomain then festim tries to assign a concentration discontinuity interface condition on this species. Causing an error because that species doesn't exist on the other side.

In this case, an homogeneous neuman BC should be applied (no-flux). A simple way to do this is to just check for a given interface that the species lives in both subdomains. If not, then do nothing.

MWE

Run this code on fenicsx

my_model = F.HTransportProblemDiscontinuous()
my_model.mesh = F.Mesh1D(vertices=np.array([0.0, 1.0, 2.0, 3.0, 4.0]))
my_mat = F.Material(D_0=3, E_D=2, K_S_0=1, E_K_S=0, name="mat")

s0 = F.VolumeSubdomain1D(1, borders=[0.0, 2], material=my_mat)
s1 = F.VolumeSubdomain1D(2, borders=[2, 4], material=my_mat)
l0 = F.SurfaceSubdomain1D(1, x=0.0)
l1 = F.SurfaceSubdomain1D(2, x=4.0)
my_model.interfaces = [F.Interface(6, (s0, s1))]

my_model.temperature = 55
my_model.subdomains = [s0, s1, l0, l1]
my_model.surface_to_volume = {l0: s0, l1: s1}

my_model.species = [
    F.Species("H", subdomains=[s0]),
    F.Species("T", subdomains=[s0, s1], mobile=False),
]

filename = str(tmpdir.join("my_export.txt"))
my_export = F.VTXSpeciesExport(
    filename, field=my_model.species, subdomain=s0)
assert my_export.filename.suffix == ".bp"
my_model.exports = [my_export]
my_model.settings = F.Settings(atol=1, rtol=0.1)
my_model.settings.stepsize = F.Stepsize(initial_value=1)

my_model.initialise()
@RemDelaporteMathurin RemDelaporteMathurin added bug Something isn't working fenicsx Issue that is related to the fenicsx support labels Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fenicsx Issue that is related to the fenicsx support
Projects
None yet
Development

No branches or pull requests

2 participants