# NeumannValue and Dirichlet boundary condition at the same boundary?

Posted 5 months ago
556 Views
|
|
0 Total Likes
|
 I understand that NeumannValue and Dirichlet boundary conditions cannot be used at the same boundary for a PDE. However, if I have a system of partial differential equations can I then have NeumannValue for 1 variable and Dirichlet BC for the other at the same x position?A realistic situation for the same would be a membrane that only allows one solute molecule to pass and is impermeable to the other solute.Edit 1:My system of equations looks like follows: $$\frac{\partial \bar{c^{T}_E}}{\partial \bar{t}} = \frac{\partial^2 \bar{c^{T}_E}}{\partial \bar{x}^2} + \alpha \frac{\partial^2}{\partial \bar{x}^2}\Big(\frac{\bar{c^{T}_E} \bar{c_S}}{K_M/c_{S0} + \bar{c_S}}\Big)$$ $$\frac{\partial \bar{c_S}}{\partial \bar{t}} = \beta \frac{\partial^2 \bar{c_S}}{\partial \bar{x}^2} - k_2 \frac{c_{E0}}{c_{S0}}\frac{\bar{c^{T}_E} \bar{c_S}}{K_M/c_{S0} + \bar{c_S}}\frac{d^2}{D_E}$$The boundary conditions that I want to impose is the following: $$\frac{\partial c_E}{\partial x} = 0 \hspace{0.5 cm}x = 0; \hspace{0.5cm} \frac{\partial c_E}{\partial x} = 0 \hspace{0.5 cm}x = 1$$ $$c_S(t,x=0) = 1 ; \hspace{0.5cm} c_S(t,x=1) = 0$$The initial conditions are as follows: $$c_E(0,x) = 1; \hspace{0.5cm} c_S(0,x \leq 0.5) = 1 ; c_S(0,x>0) = 0$$The code works fine when I impose no-flux conditions for $c_S$. However, when I use Dirichlet condition for $c_S$ the mass of $c_E$ is no longer conserved. Why is this issue happening and how does one get through this issue?I have attached the notebook here. Attachments: