Let’s consider a horizontal channel with a round obstacle in the middle.
rules = {length -> 2, hight -> 1/2};
Ω =
RegionDifference[Rectangle[{0, 0}, {length, hight}],
Disk[{1, 1/4}, 1/15]] /. rules;
region = RegionPlot[Ω, AspectRatio -> Automatic]
The flow occurs under the action of horizontal force from initial state at rest. Side boundaries are open on which the periodical condition is specified.
op = {
Derivative[1, 0, 0][u][t, x, y] +
Inactive[Div][-Inactive[Grad][u[t, x, y], {x, y}], {x,
y}] + {u[t, x, y], v[t, x, y]}.Inactive[Grad][
u[t, x, y], {x, y}] +
Derivative[0, 1, 0][p][t, x, y] + (1 - Exp[-t]),
Derivative[1, 0, 0][v][t, x, y] +
Inactive[Div][-Inactive[Grad][v[t, x, y], {x, y}], {x,
y}] + {u[t, x, y], v[t, x, y]}.Inactive[Grad][
v[t, x, y], {x, y}] + Derivative[0, 0, 1][p][t, x, y],
Derivative[0, 1, 0][u][t, x, y] + Derivative[0, 0, 1][v][t, x, y]};
ic = {u[0, x, y] == 0, v[0, x, y] == 0, p[0, x, y] == 0};
bcsp = {
PeriodicBoundaryCondition[u[t, x, y],
x == 0 && 0 < y < hight, TranslationTransform[{length, 0}]],
PeriodicBoundaryCondition[v[t, x, y],
x == 0 && 0 < y < hight, TranslationTransform[{length, 0}]],
DirichletCondition[{u[t, x, y] == 0, v[t, x, y] == 0},
0 < x < length],
DirichletCondition[p[t, x, y] == 0.,
x == length && y == hight]} /. rules;
Monitor[AbsoluteTiming[{xVel1, yVel1, pressure1} =
NDSolveValue[{op == {0, 0, 0}, bcsp, ic}, {u, v,
p}, {x, y} ∈ Ω, {t, 0, 5},
Method -> {"PDEDiscretization" -> {"MethodOfLines",
"SpatialDiscretization" -> {"FiniteElement",
"MeshOptions" -> {"MaxCellMeasure" -> 0.0005},
"InterpolationOrder" -> {u -> 2, v -> 2, p -> 1}}}},
EvaluationMonitor :> (currentTime =
Row[{"t = ", CForm[t]}])];], currentTime]
Flow is not appeared. It stays trivial.
StreamDensityPlot[
Evaluate[{xVel1[5, x, y], yVel1[5, x, y]}], {x,
y} ∈ Ω, ColorFunction -> "Rainbow",
PlotLegends -> Placed[Automatic, Top], AspectRatio -> Automatic,
ImageSize -> 800, PlotRange -> All]
The problem is that the pressure doen't know that side walls are open. Is it possible to overcome it?
ContourPlot[
Evaluate[pressure1[5, x, y]], {x, y} ∈ Ω,
ColorFunction -> "Rainbow", PlotLegends -> Placed[Automatic, Top],
AspectRatio -> Automatic, ImageSize -> 800, PlotRange -> All]
Is it possible to overcome it and obtain something like that?
Let me explain why answer below by Alex Trounev does not completely satisfy. This preriodic solution (velocity and pressure fields) can be appeared in an infinite periodic array of same obstacles. Let's take 5 for example
rules = {length -> 2.5, hight -> 1/2};
Ω =
RegionDifference[Rectangle[{0, 0}, {length, hight}],
RegionUnion[Table[Disk[{n 1/2 - 1/4, 1/4}, 1/15], {n, 5}]]] /.
rules;
region = RegionPlot[Ω, AspectRatio -> Automatic]
Let's solve the problem with periodic-like boundary conditions as suggested by Alex Trounev
op = {Derivative[1, 0, 0][u][t, x, y] +
10^-2 Inactive[Div][-Inactive[Grad][u[t, x, y], {x, y}], {x,
y}] + {u[t, x, y], v[t, x, y]}.Inactive[Grad][
u[t, x, y], {x, y}] +
Derivative[0, 1, 0][p][t, x, y] - (1 - Exp[-t]),
Derivative[1, 0, 0][v][t, x, y] +
10^-2 Inactive[Div][-Inactive[Grad][v[t, x, y], {x, y}], {x,
y}] + {u[t, x, y], v[t, x, y]}.Inactive[Grad][
v[t, x, y], {x, y}] + Derivative[0, 0, 1][p][t, x, y],
Derivative[0, 1, 0][u][t, x, y] + Derivative[0, 0, 1][v][t, x, y]};
ic = {u[0, x, y] == 0, v[0, x, y] == 0, p[0, x, y] == 0};
bcsp = {PeriodicBoundaryCondition[u[t, x, y], x == 0 && 0 < y < hight,
TranslationTransform[{length, 0}]],
PeriodicBoundaryCondition[v[t, x, y], x == 0 && 0 < y < hight,
TranslationTransform[{length, 0}]],
DirichletCondition[{u[t, x, y] == 0, v[t, x, y] == 0},
0 < x < length], DirichletCondition[p[t, x, y] == 0., True]} /.
rules;
Monitor[AbsoluteTiming[{xVel1, yVel1, pressure1} =
NDSolveValue[{op == {0, 0, 0}, bcsp, ic}, {u, v,
p}, {x, y} ∈ Ω, {t, 0, 10},
Method -> {"PDEDiscretization" -> {"MethodOfLines",
"SpatialDiscretization" -> {"FiniteElement",
"MeshOptions" -> {"MaxCellMeasure" -> 0.0005},
"InterpolationOrder" -> {u -> 2, v -> 2, p -> 1}}}},
EvaluationMonitor :> (currentTime = Row[{"t = ", CForm[t]}])];],
currentTime];
We obtain almost steady velocity and pressure fields
As you can see that periodic pressure appers at the middle (y-profiles are the same) and not at the side walls.
Plot[{pressure1[5, 1, y], pressure1[5, 1.5, y], pressure1[5, 0, y],
pressure1[5, 2.5, y]}, {y, 0, 1/2}, PlotRange -> All,
PlotStyle -> {Black, {Red, Dashed, Thick}, {Blue, Dashed, Thick},
Green}, Frame -> True,
PlotLegends -> {"x=1", "x=1.5", "x=0", "x=2.5"}]
Note true periodic pressure depends on y. So DirichletCondition[p[t, x, y] == 0., True]
is partial solution because of periodicity is slightly broken near side walls. Any other suggestions are welcome.