Currently, I am doing steady state forced convection flow. I use mixed element to define the function space:
from future import print_function
from fenics import *
set parameter values
rho = 997.1 #density water
mu = 1 #0.890*10^-3 #dynamic viscosity water
sigma = 0.05501 #electrical conductivity water
C = 4179 #heat capacitance water
c = 0.591 #thermal conductivity water
B_0 = 0
create mesh
mesh = UnitSquareMesh(8,8)
define function space
V = VectorElement('P', mesh.ufl_cell() , 2)
Q = FiniteElement('P', mesh.ufl_cell(), 2)
element = MixedElement([Q, V, Q])
W = FunctionSpace(mesh, element)
However, there is error:
File "steady.py", line 43, in
bcu_walls = DirichletBC(V, Constant(0), walls)
File "/usr/lib/python2.7/dist-packages/dolfin/fem/bcs.py", line 90, in init
mpi_comm = args[0].mesh().mpi_comm()
AttributeError: 'VectorElement' object has no attribute 'mesh'
Aborted (core dumped)
I dont know how to solve this problem. Thank you for your help.