automation of generating geometry and mesh

I have been running 81 CFD simulations with OpenFOAM. Each case has different geometry, which I use Salome python script to produce. The geometries are similar and the differences are dimensions.
My problem is that, in the script, I extract faces and group the faces for a boundary condition.
# extract face
[Face_1,Face_2,Face_3,Face_4,Face_5,Face_6,Face_7,Face_8,Face_9,Face_10,Face_11,Face_12,Face_13,Face_14,Face_15, Face_16,Face_17,Face_18,Face_19,Face_20,Face_21]= geompy.ExtractShapes(CFD, geompy.ShapeType["FACE"], True)
inletOutlet = geompy.CreateGroup(CFD, geompy.ShapeType["FACE"])
geompy.UnionList(inletOutlet, [Face_1, Face_2, Face_20, Face_21])
However, when I changed dimensions of the geometry, the faces I selected are not the faces I want for the boundary condition. I don't understand why. Can anyone help?
Partition is used to generate the geometry. Could this be the cause and what's the solution?
Regards,
Charles