Hello,I am beginner at FEniCS and i try to set up boundary conditions on my reaction diffusion problem, this pic is my schematic representation of 2D reaction diffusion system, i want the concentration at left to be constant value 1 and concentration gradient at bottom,top,right to be zero but i coundn’t find any example code like my problem. Could you guys give any idea or example to me.
this is my boundary condition code:
#boundary condition
c_left = 1.0 # Constant value on the left
c_rtb = 0.0 # Zero value on the right, top, and bottom
class BoundaryConditionExpresion(Expression):
def eval(self,value,x):
if near(x[0],0):
value[0] = c_left
else :
value[0] = c_rtb
bc = DirichletBC(V, BoundaryConditionExpression(), 'near(x[1], 0) || near(x[1], 1) || near(x[0], 1)')
it gives error name ‘Expresstion’ is not defined