# Symmetric boundary condition not satisfied

**URL:** <https://community.freefem.org/t/symmetric-boundary-condition-not-satisfied/2527>\
**Category:** General Discussion\
**Created:** [June 7, 2023, 5:00am UTC](https://community.freefem.org/t/symmetric-boundary-condition-not-satisfied/2527 "2023-06-07T05:00:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![KanLi](https://avatars.discourse-cdn.com/v4/letter/k/bbce88/32.png) [@KanLi](https://community.freefem.org/u/KanLi)\
**Post date:** [June 7, 2023, 5:00am UTC](https://community.freefem.org/t/symmetric-boundary-condition-not-satisfied/2527/1 "2023-06-07T05:00:57Z")

</div>

Dear all! I’m solving a chemical problem like this.

 ![chem](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/5/5f05052af8b4a0927dd361dfc579a2436d1ac0ef.png)  
And this is my edp code:  
[test.edp](https://community.freefem.org/uploads/short-url/1J5xWZJ77jUqGyodanHTMgrs0oQ.edp) (1.8 KB)  
I try to compute half of the domain. dx(ci)=0 should be satisfied at left boundary, but it seems to be wrong.  
 ![test](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/5/5230b09d7a0c76499424dd399b33e9292c32c6ff.jpeg)  
I’m not sure what causes this problem, because when I compute the whole domain, it turns out to be right. Dose anyone have some ideas? Thank you!

---

<div class="post-metadata">

**Author:** ![KanLi](https://avatars.discourse-cdn.com/v4/letter/k/bbce88/32.png) [@KanLi](https://community.freefem.org/u/KanLi)\
**Post date:** [June 8, 2023, 11:00am UTC](https://community.freefem.org/t/symmetric-boundary-condition-not-satisfied/2527/2 "2023-06-08T11:00:17Z")

</div>

I guess I’ve solved this problem. Just use P2 finite element. Everything is fine now.

---

<div class="post-metadata">

**Author:** ![marchywka](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@marchywka](https://community.freefem.org/u/marchywka)\
**Post date:** [June 8, 2023, 1:19pm UTC](https://community.freefem.org/t/symmetric-boundary-condition-not-satisfied/2527/3 "2023-06-08T13:19:55Z")

</div>

Your boundary conditions are on 1 and 2 AFAICT are the bottom and right  
sides respectively although I may have gotten something confused.  
This system apparently describes X catalytiucally removing M  
but also able to react with O2 and itself. I guess the light based generation  
rate however is not dependent on any reactant or is a const included in the  
light term.  
Your solve seems to include the boundary or equillibrium values  
(Xo ) that would try to impose those values everywhere instead of letting  
the diffusion term model that.

---

<div class="post-metadata">

**Author:** ![KanLi](https://avatars.discourse-cdn.com/v4/letter/k/bbce88/32.png) [@KanLi](https://community.freefem.org/u/KanLi)\
**Post date:** [June 9, 2023, 2:46am UTC](https://community.freefem.org/t/symmetric-boundary-condition-not-satisfied/2527/4 "2023-06-09T02:46:55Z")

</div>

Thank you for your reply!  
As you already know, this is a UV curing process including oxygen inhibition. There are three constituents in the simulation, M(monomer), MR(free radical species) and O2(oxygen). The light field is given fixed over time. Only the diffusion of O2 is considered, so other two equations lose their diffusion terms and become dci/dt=ri. Adding BC to it may causes some problems. So I add a small diffusion coefficient to them, but it doesn’t work. I guess it’s because the boundary effect is too strong that nothing changed after adding small diffusion.  
Finally, I try P2 element which may improve the accuracy and capture changes in second order. Whatever, it works well now.

---

<div class="post-metadata">

**Author:** ![marchywka](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@marchywka](https://community.freefem.org/u/marchywka)\
**Post date:** [June 9, 2023, 9:42am UTC](https://community.freefem.org/t/symmetric-boundary-condition-not-satisfied/2527/5 "2023-06-09T09:42:38Z")

</div>

I guess your beam profile is an extend source gaussian and it tapers  
at each edge but is flat in the middle. If you cut the domain in 1/2  
then what happens to your light profile? If you are going to try  
to compare simulation to expected experiment you may  
need some changes in the model although comparing FF output  
to expectations to the model is a different issue.

---

<div class="post-metadata">

**Author:** ![KanLi](https://avatars.discourse-cdn.com/v4/letter/k/bbce88/32.png) [@KanLi](https://community.freefem.org/u/KanLi)\
**Post date:** [June 10, 2023, 4:34am UTC](https://community.freefem.org/t/symmetric-boundary-condition-not-satisfied/2527/6 "2023-06-10T04:34:40Z")

</div>

I know what you mean. But after using P2 element, the result tend to be right. So I think there is no problem in boundary settings including light.
