I have one expression, but this scalar:
vel_in = Expression("dp/mu * (1/2 * x[2]*x[2] + 16*h*h/(pi*pi))* \
(1/pow(1,3)*cos(1/4 * pi*x[2]/h)*(1 - cosh(1/4 * pi * x[1]/h)/cosh(1/4 * pi)) - \
1/pow(3,3)*cos(3/4 * pi*x[2]/h)*(1 - cosh(3/4 * pi * x[1]/h)/cosh(3/4 * pi)) + \
1/pow(5,3)*cos(5/4 * pi*x[2]/h)*(1 - cosh(5/4 * pi * x[1]/h)/cosh(5/4 * pi)) - \
1/pow(7,3)*cos(7/4 * pi*x[2]/h)*(1 - cosh(7/4 * pi * x[1]/h)/cosh(7/4 * pi)) + \
1/pow(9,3) * cos(9/4 * pi*x[2]/h)*(1 - cosh(9/4 * pi * x[1]/h)/cosh(9/4 * pi)) \
)", dp=20, h=0.0002, mu=mu, degree = 2)
I want to set this expression on x[1] in boundary condition. I try:
bcp_inflow_top = DirichletBC(V, Constant((0,vel_in,0)), facet_domains, 14)
and try:
bcp_inflow_top = DirichletBC(V, (0,vel_in,0), facet_domains, 14)
But i have error.