I was attempting to simulate fluid flow past a circular obstacle. The following is the code which I used
(*define the variables*)
rules3 = {\[Mu] -> 1.63*10^-2, \[Rho] -> 1.1136, g -> -9.81,
epr -> 2*10^-3, ExitV -> 1, PeakV -> 1.5, PipePos -> 0}
(*Define the flow region*)
\[CapitalOmega] =
RegionUnion[Rectangle[{-epr, 0}, {epr, 0.05}],
RegionDifference[Rectangle[{-epr - 10^-3, -0.1}, {0.075, 0}],
Disk[{6.5*10^-3, -0.05}, 6*10^-3]]] /. rules3;
(*Define the Navier-Stokes Equation*)
snsef1 = {
-\[Mu] \!\(
\*SubsuperscriptBox[\(\[Del]\), \({x, y}\), \(2\)]\(u[x,
y]\)\) + \[Rho] {u[x, y], v[x, y]} . \!\(
\*SubscriptBox[\(\[Del]\), \({x, y}\)]\(u[x, y]\)\) + \!\(
\*SubscriptBox[\(\[PartialD]\), \(x\)]\(p[x, y]\)\),
-\[Mu] \!\(
\*SubsuperscriptBox[\(\[Del]\), \({x, y}\), \(2\)]\(v[x,
y]\)\) + \[Rho] {u[x, y], v[x, y]} . \!\(
\*SubscriptBox[\(\[Del]\), \({x, y}\)]\(v[x, y]\)\) + \!\(
\*SubscriptBox[\(\[PartialD]\), \(x\)]\(p[x, y]\)\) - \[Rho] g,
\!\(
\*SubscriptBox[\(\[Del]\), \({x, y}\)] . \({u[x, y], v[x, y]}\)\)
} /. rules3
(*Modelling the Entry velocity as a Poiseulle Flow*)
InflowBC =
DirichletCondition[{u[x, y] == 0,
v[x, y] == -PeakV (1 - ((x - PipePos)/epr)^2)}, y == 0.05] /.
rules3;
(*Outflow Boundary Condition*)
OutflowBC = DirichletCondition[p[x, y] == 0, y == -0.1];
(*Wall Boundary Condition (No-slip) *)
WallBC = DirichletCondition[{u[x, y] == 0, v[x, y] == 0}, 0.05 > y > -0.25];
(*Solving the equation*)
{uVel, vVel, pressure} = NDSolve[{
snsef1 == {0, 0, 0},
bcs
}, {u, v, p}, {x, y} \[Element] \[CapitalOmega], Method -> {
"PDEDiscretization" -> {"FiniteElement",
"InterpolationOrder" -> {u -> 2, v -> 2, p -> 1},
"MeshOptions" -> {"MaxCellMeasure" -> 0.0000001},
"PDESolveOptions" -> {"FindRootOptions" -> {Method -> \
{"AffineCovariantNewton", "MinimalDampingFactor" -> 10^-8}}}}
}]
This returns the error:
FindRoot::dfmin: The minimal damping factor of 1/100000000 has been reached.
FindRoot::sszero: The step size in the search has become less than the tolerance prescribed by the PrecisionGoal option, but the function value is still greater than the tolerance prescribed by the AccuracyGoal option.
NDSolve::fempsf: PDESolve could not find a solution.
Set::shape: Lists {uVel,vVel,pressure} and <<1>> are not the same shape.
What do these errors mean and how can I fix this? Thanks in advance
Clarifications: The Inflow BC represents flow in a pipe, so I used poiseulle flow equation to model this
Edits: The Inflow velocity should be negative (downward), changed in the code
Question Answered:
Thanks to user Alex Trounev for the solution! Appreciate it and thank you!
InflowBC
has outflowv[x, y] == PeakV (1 - ((x - PipePos)/epr)^2)
? If you need inflow just putPeakV=-1.5
. $\endgroup$