I want to solve a 3D (stationary) Navier Stokes problem. Since I am not very skilled in fenics I modified the 2D (instationary) example demo_navier_stokes.py. I generated the geometry and mesh with Gmsh and converted to xml format with dolfin-convert.py. Since I could not tranfer boundaries from msh to xml I had to redefine the boundaries in fenics.
For example a cylindrical part:
# class GasInletBoundary(SubDomain):
def inside(self,x,on_boundary):
return on_boundary and \
x[2]<eps and math.hypot(x[0],x[1])<=d1/2
gamma_1 = GasInletBoundary()
gamma_1.mark(boundary_parts,1)
#
Etc...for a total of 8 boundaries.
There are 2 boundaries with prescribed velocities and 1 with prescribed pressure. Also many surfaces with noslip boundary conditions. I don't think that the boundary conditions are conflicting.
# boundary conditions VectorFunctionSpace V (velocity)
bc_1 = DirichletBC(V,(0,0,v_gas),boundary_parts,1)
bc_2 = DirichletBC(V,(0,0,v_air),boundary_parts,2)
# boundary conditions for (scalar) FunctionSpace Q (pressure)
bc_3 = DirichletBC(Q, p_out,boundary_parts,3)
# noslip boundary conditions VectorFunctionSpace V (velocity)
bc_4 = DirichletBC(V,(0,0,0),boundary_parts,4)
bc_5 = DirichletBC(V,(0,0,0),boundary_parts,5)
All boundaries are put in a list bcu and bcp like the example.
Solution the same as in the example.
When I choose the timing parameters such that the cycle is executed oly once like dt = 0.2 and total time T = 0.3 than the result is a reasonable solution that may or may not be right. Probably not.
If I increase the total time T and the loop is executed several times then the (some) velocities increase more or less exponentially. The final solution has a number of velocities order of magnitude 1.0E+100 or so. It looks as if in certain areas the boundary conditions get detached since when I print the velocity at the boundary I also get other values returned than the initial condition. The plot of the velocity reveals that only in certain areas the velocity has large magnitude.
There are no errors exept "Requested preconditioner is not available for uBAS Krylov solver" Using ILU.
I can send code and mesh if you contact me and/or a plot of the velocity.
Hope that somebody can help me.