I notice a strange behavior when using Fipy and fixed flux boundary condition on a 3D mesh with bumps. On the left hand of the attached picture I show a 2D cut of the geometry with the theoretical heat flux boundary condition, without (A: top) and with (B: bottom) the bumps. On the right hand I show a top view of the heat flux calculated with T.faceGradAverage[0]
at the boundary. The mesh is created with GMSH in both cases A and B.
Since I am solving a heat transfer problem with a fixed heat flux distribution at the top and a heat transfer coeffient at the bottom, my fipy problem is defined with (FrontFaces * frontValue).divergence
to apply the heat flux:
Dk.constrain(0., baseMesh.exteriorFaces)
mask_coeff = (boundarySource * baseMesh.faceNormals).divergence
equation = ImplicitDiffusionTerm(coeff=Dk) + ImplicitSourceTerm(mask_coeff) - mask_coeff - (FrontFaces * frontValue).divergence
FrontFaces is defined as FrontFaces = mesh.facesLeft & test_xy
As you can see on the image, both cases yield quite different results. Blue means 0 heat flux, red means high heat flux. Case B is physically not possible: the heat flux is high where is should be 0. It seems that the boundary condition is not correctly applied in case B because of the bumps.
Has anybody encountered the same issue? Heat flux maps