I'm using NDSolve for fluid flow and would like to monitor the convergence of the solution more closely. I have a simple stationary case set up. NDSolve should return the solutions for u,v and p. During the calculation, I want NDSolve to print the current residuals for u, v and p so I can see if the solution actually converges. My first idea was to use StepMonitor, but apparently Mathematica treats non-transient computations as a single step.
Any help on this is greatly appreciated.
(*Fluid*) \[Rho] = 1; \[Mu] = 10^-3; (*Region*) meshReg = DiscretizeRegion[ RegionDifference[ Rectangle[{0,0},{2.2,0.41}], Disk[{1/5,1/5}, 1/20] ], MaxCellMeasure -> 0.0001 ]; (*Operator*) op = { \[Rho]*{u[x,y],v[x,y]} . Inactive[Grad][u[x,y],{x,y}]+Inactive[Div][-\[Mu]*Inactive[Grad][u[x,y],{x,y}],{x,y}]+D[p[x,y],x], \[Rho]*{u[x,y],v[x,y]} . Inactive[Grad][v[x,y],{x,y}]+Inactive[Div][-\[Mu]*Inactive[Grad][v[x,y],{x,y}],{x,y}]+D[p[x,y],y], D[u[x,y],x]+D[v[x,y],y] }; (*BoundaryConditions*) bcs = { DirichletCondition[{u[x,y] == 0.15, v[x,y] == 0.}, x == 0], DirichletCondition[{u[x,y] == 0., v[x,y] == 0.}, 0 < x < 2.2], DirichletCondition[p[x,y] == 0, x == 2.2] }; (*Solution*) {time,{xVel, yVel, pressure}} = AbsoluteTiming@NDSolveValue[ {op == {0,0,0}, bcs}, {u,v,p}, {x,y} \[Element] meshReg, Method -> {"FiniteElement","InterpolationOrder"->{u->2,v->2,p->1}} ]