I am trying to extend Stokes flow example to 3D but I get an error. Not sure what's wrong.
For example we define the region and this works:
Ω =
ImplicitRegion[
-0.5 <= z <= 0.5 && 0 <= x <= 2 && 0 <= y <= 0.5 &&
!(x >= 1 && y <= 0.1) && !(x >= 1 && y >= 0.4),
{x, y, z}];
RegionPlot3D[Ω]
Then I define the Stokes flow operator, but I am not sure this is right:
stokesFlowOperator =
{Inactive[Div][{{-1, 0}, {0, -1}}.Inactive[Grad][u[x, y, z], {x, y, z}], {x, y, z}] +
Derivative[1, 0][w][x, y],
Inactive[Div][{{-1, 0}, {0, -1}}.Inactive[Grad][v[x, y, z], {x, y, z}], {x, y, z}] +
Derivative[0, 1][w][x, y, z],
Inactive[Div][{{-1, 0}, {0, -1}}.Inactive[Grad][v[x, y, z], {x, y, z}], {x, y, z}] +
Derivative[0, 1, 1][w][x, y, z],
Derivative[0, 1, 0][v][x, y, z] + Derivative[1, 0, 1][u][x, y, z]};
Subscript[Γ, D] =
{DirichletCondition[u[x, y, z] == z + 4*0.3*y*((0.5 - y)/0.41^2), {x == 0.}],
DirichletCondition[{u[x, y, z] == 0., v[x, y, z] == 0.}, 0 < x < 2],
DirichletCondition[w[x, y, z] == 0., x == 2]}; This lines fails:
{xVel, yVel, zVel, pressure} =
NDSolveValue[
{stokesFlowOperator == {0, 0, 0}, Subscript[Γ, D]},
{u, v, w}, {x, y, z} ∈ Ω,
Method ->
{"FiniteElement",
"InterpolationOrder" -> {u -> 2, v -> 2, w -> 1}}]
And I get this error:
NDSolveValue::dsvar: 0.35` cannot be used as a variable.
Set::shape: Lists {xVel, yVel, zVel, pressure} and NDSolveValue[{False, {DirichletCondition[u[x, y, 0.35] == 0.35 + 7.13861 Plus[<<2>>] y, {x == 0.}], DirichletCondition[{u[x, y, 0.35] == 0., v[x, y, 0.35] ==0.}, 0 < x < 2], DirichletCondition[w[x, y, 0.35] == 0., x == 2]}}, {u, v, w}, {x, y, 0.35} ∈ ImplicitRegion[-0.5 <= z <= 0.5 && 0 <= x <=2 && 0 <= y <= 0.5 && !(x >= 1 && y <= 0.1) && !(x >= 1 && y >= 0.4), {x, y, z}], Method -> {FiniteElement, InterpolationOrder -> {u -> 2, v -> 2, w -> 1}}] are not the same shape.
I am not sure what I am doing wrong when trying to extend to 3D.