varying Dirichlet BC on curved boundary
Hi,
I try to prescribe tangential velocity on the surface of the circle. The following representation invokes PETSC error:
u_bc=Expression
bc = DirichletBC(
Is there any other possibility to implement such type of bc?
Thanks!
# -------
from dolfin import *
mesh = UnitCircleMesh(10)
V = VectorFunctionS
P = FunctionSpace(
W = MixedFunctionSp
T = interpolate(
g = Function(
Ra = Constant(100.0)
eta = Constant(1.0)
def strain(v):
return 0.5*(grad(v) + grad(v).T)
def boun(x, on_boundary):
return on_boundary
u_bc=Expression
bc = DirichletBC(
(u, p) = TrialFunctions(W)
(v, q) = TestFunctions(W)
F = (2.0*eta*
a = lhs(F)
L = rhs(F)
res = Function(W)
solve(a=
u_,p_ = split(res)
plot(u_
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Jan Domurath
- Solved:
- 2013-03-05
- Last query:
- 2013-03-05
- Last reply:
- 2013-03-05
|
#1 |
Hello Lyuda,
I think your Expression for the tangent vector is upside down, it should be
u_bc=Expression((" 0.001 * x[1] / sqrt(x[
Also, you should use
u_,p_ = res.split()
at the end of your program, see: https:/
Cheers,
Jan
Lyuda Vynnytska (lyudav) said : | #2 |
Jan, many thanks for finding this mistake!
Lyuda Vynnytska (lyudav) said : | #3 |
Thanks Jan Domurath, that solved my question.