# Concentration is zero in some subdomains

**URL:** <https://festim.discourse.group/t/concentration-is-zero-in-some-subdomains/51>\
**Category:** User Support\
**Created:** [June 6, 2024, 8:20am UTC](https://festim.discourse.group/t/concentration-is-zero-in-some-subdomains/51 "2024-06-06T08:20:53Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![xinshen](https://yyz2.discourse-cdn.com/free1/user_avatar/festim.discourse.group/xinshen/32/194_2.png) [@xinshen](https://festim.discourse.group/u/xinshen)\
**Post date:** [June 6, 2024, 8:20am UTC](https://festim.discourse.group/t/concentration-is-zero-in-some-subdomains/51/1 "2024-06-06T08:20:53Z")

</div>

Hi everyone.

I performed a simulation of hydrogen transport in W/Cu/CuCrZr in 2D. I used big mesh size to make the computation quick. The exported chemical\_pot\_conservation derived\_quantities file show the result. As is seen in the picture below, the total retention in volume 7 and 8, the flux on surface 15 are missing. Can anyone tell me that what might cause this problem and how to solve it? Thank you!

 ![image](https://global.discourse-cdn.com/free1/uploads/festim/original/1X/48e91ed1327291362ddf609e6db70354149be4c3.png)

---

<div class="post-metadata">

**Author:** ![remidm](https://yyz2.discourse-cdn.com/free1/user_avatar/festim.discourse.group/remidm/32/4_2.png) [@remidm](https://festim.discourse.group/u/remidm)\
**Post date:** [June 6, 2024, 8:46am UTC](https://festim.discourse.group/t/concentration-is-zero-in-some-subdomains/51/2 "2024-06-06T08:46:06Z")

</div>

Hi Xin,

It is a bit hard to tell without more information.

Are you certain that you have volumes 7 and 8 and surface 15 in your model?  
To verify this, open your XDMF mesh files in Paraview.

If you are certain that one of the surfaces is tagged with the ID 15, then what boundary condition did you put on surface 15?  
If you haven’t set any BC on this subdomain than the default is “no flux” which would explain why this column is zero.

---

<div class="post-metadata">

**Author:** ![xinshen](https://yyz2.discourse-cdn.com/free1/user_avatar/festim.discourse.group/xinshen/32/194_2.png) [@xinshen](https://festim.discourse.group/u/xinshen)\
**Post date:** [June 8, 2024, 6:35am UTC](https://festim.discourse.group/t/concentration-is-zero-in-some-subdomains/51/3 "2024-06-08T06:35:25Z")

</div>

Hi Remi,

Here is the image of my model after opening the mesh\_domain and mesh \_boundaries files in Paraview.

 ![image](https://global.discourse-cdn.com/free1/uploads/festim/original/1X/86e363951ce37c3404aa1b5e20d7e22a5b7f1917.png)

The boundary condition I put on 15 is:

```auto
F.RecombinationFlux(Kr_0=2.9e-14, E_Kr=1.92, order=2, surfaces=[id_CuCrZr_inner])

```

---

<div class="post-metadata">

**Author:** ![remidm](https://yyz2.discourse-cdn.com/free1/user_avatar/festim.discourse.group/remidm/32/4_2.png) [@remidm](https://festim.discourse.group/u/remidm)\
**Post date:** [June 10, 2024, 7:12am UTC](https://festim.discourse.group/t/concentration-is-zero-in-some-subdomains/51/4 "2024-06-10T07:12:04Z")

</div>

could you send the code to reproduce your issue? alongside the meshes (XDMF + h5 files)

---

<div class="post-metadata">

**Author:** ![xinshen](https://yyz2.discourse-cdn.com/free1/user_avatar/festim.discourse.group/xinshen/32/194_2.png) [@xinshen](https://festim.discourse.group/u/xinshen)\
**Post date:** [June 10, 2024, 3:04pm UTC](https://festim.discourse.group/t/concentration-is-zero-in-some-subdomains/51/5 "2024-06-10T15:04:33Z")

</div>

Yes, of course. I’ll send you by email because it seems more convenient to attach the meshes.

Thank you very much!

---

<div class="post-metadata">

**Author:** ![remidm](https://yyz2.discourse-cdn.com/free1/user_avatar/festim.discourse.group/remidm/32/4_2.png) [@remidm](https://festim.discourse.group/u/remidm)\
**Post date:** [June 10, 2024, 4:45pm UTC](https://festim.discourse.group/t/concentration-is-zero-in-some-subdomains/51/6 "2024-06-10T16:45:59Z")

</div>

```python
import festim as F

my_model = F.Simulation()

my_model.mesh = F.MeshFromXDMF(
    volume_file="mesh_domains.xdmf",
    boundary_file="mesh_boundaries.xdmf",
)
my_model.materials = F.Material(D_0=1, E_D=0, id=[6, 7, 8])

my_model.boundary_conditions = [
    F.DirichletBC(field="solute", value=1, surfaces=[9]),
]

my_model.T = F.Temperature(823)

my_model.exports = [F.XDMFExport("solute")]

my_model.settings = F.Settings(
    chemical_pot=False,
    absolute_tolerance=1e-10,
    relative_tolerance=1e-10,
    transient=False,
)

my_model.initialise()

my_model.run()

```

This reproduces the behaviour:

 ![image](https://global.discourse-cdn.com/free1/uploads/festim/original/1X/640ff4414d6da55cb838ccb447a8bdd6e6145ca3.png)

[mesh\_boundaries.xdmf](https://festim.discourse.group/uploads/short-url/bpQE6NNnClMVy0RUOighTfJYuvy.xdmf) (587 Bytes)  
[mesh\_domains.h5](https://festim.discourse.group/uploads/short-url/7sSBIQJie1LrmpCfr2oJnl91xSJ.h5) (78.9 KB)  
[mesh\_domains.xdmf](https://festim.discourse.group/uploads/short-url/iPp261ejI7DWz2uo52F7woOY5d7.xdmf) (581 Bytes)  
[mesh\_boundaries.h5](https://festim.discourse.group/uploads/short-url/v9zVuNiOnPIRZcsREahnga82VeL.h5) (52.4 KB)

---

<div class="post-metadata">

**Author:** ![jhdark](https://yyz2.discourse-cdn.com/free1/user_avatar/festim.discourse.group/jhdark/32/13_2.png) [@jhdark](https://festim.discourse.group/u/jhdark)\
**Post date:** [June 10, 2024, 5:02pm UTC](https://festim.discourse.group/t/concentration-is-zero-in-some-subdomains/51/7 "2024-06-10T17:02:53Z")

</div>

I think there may have been an issue when making the mesh. Would you be able to describe the process you underwent to create it?

---

<div class="post-metadata">

**Author:** ![xinshen](https://yyz2.discourse-cdn.com/free1/user_avatar/festim.discourse.group/xinshen/32/194_2.png) [@xinshen](https://festim.discourse.group/u/xinshen)\
**Post date:** [June 11, 2024, 4:18am UTC](https://festim.discourse.group/t/concentration-is-zero-in-some-subdomains/51/8 "2024-06-11T04:18:04Z")

</div>

I compounded the volumes then did the mesh straightly.

Now I realized that I missed the partitioning. After the modification, the results are not zero anymore.

Thank you!

---

<div class="post-metadata">

**Author:** ![xinshen](https://yyz2.discourse-cdn.com/free1/user_avatar/festim.discourse.group/xinshen/32/194_2.png) [@xinshen](https://festim.discourse.group/u/xinshen)\
**Post date:** [June 11, 2024, 4:19am UTC](https://festim.discourse.group/t/concentration-is-zero-in-some-subdomains/51/9 "2024-06-11T04:19:42Z")

</div>

Thank you very much!
