I would appreciate some helps in order to clarify the nature of my simulation output. This simulation regards the flow around a cube contained inside a cylindrical channel in 3D. The mathematical model are the Navier-Stokes equations and the continuity equation (div U = 0). I’ve develop the code for a 2d numerical simulation and the output is correct, this lead me to think that the variational problem which is the same for 2d and 3d problem (correct me if i’m wrong), is well posed in FEniCS. When I try to run the simulation on the 3D geometry i’ve got the following (output) both in term of pressure and velocity fields (u,p).
I want to explain how I’ve managed the geometry in few steps:
- Build it in FreeCAD
- Imported it in GMSH
- Define the Boundaries through command add–>surfaces and labeled them with number from 1 to 4
3.1) Wall which corresponds to tag ‘1’ represents the surface associated with the cylinder
3.2) Obstalce which corresponds to tag ‘2’ represent the inner cube surfaces
3.3) Inlet (Outlet) which correspond to tag ‘3’ (‘4’) represent the inlet and outlet surfaces associated to the cylinder - Define volume with add–>volumes and labeled it with 5
- Convert .msh file into .xml file which generates two additional file: physical_region.xml and facet_region.xml. These two files must contains the informations about boundaries automatically. Then the following line are implemented in order to elaborate the geometry in python3 before computing the simulation:
% Read mesh
mesh = Mesh(‘file.xml’)
cd=MeshFunction(‘size_t’, mesh, ‘prova_physical_region.xml’)
fd=MeshFunction(‘size_t’, mesh, ‘prova_facet_region.xml’)
bcu_inflow = DirichletBC(V, Constant((2, 2, 0)), ‘3’)
bcu_wall = DirichletBC(V, Constant((0, 0, 0)), ‘1’)
bcu_cube = DirichletBC(V, Constant((0, 0, 0)), ‘2’)
bcp_outflow = DirichletBC(Q, Constant(0), ‘4’)
The simulation doesn’t give any error and computes the result showed in (output) which has no sense in our physical context (fluid dynamics), then I would like to know what the problem is. I would stress that the mesh is well charged in FEniCS.