Facets orientation in inner surface with fenicsX

I found some way to fix my problem, but it does not generalize very well. As I know the real normal, I can then use the ufl conditional operator:

vec_x = fem.Constant(domain,PETSc.ScalarType((1.0,0,0)))
vec_y = fem.Constant(domain,PETSc.ScalarType((0.0,1.0,0)))
vecs=[-vec_x,vec_x,-vec_y,vec_y]
for i in range(0,4):
    n_corr=ufl.conditional(ufl.le(ufl.inner(N('+'),vecs[i]),0.0),n('-'),n('+'))
    SurfaceForm_inner = fem.form(ufl.inner(n_corr,vecs[i])*dS(i))#+ fem.Constant(domain, PETSc.ScalarType(0.0))*dx)
    surface_inner =  domain.comm.allreduce(fem.assemble_scalar(SurfaceForm_inner), op=MPI.SUM)

    print(f"Checking pressure on surface {i}: reference={reference}, {surface_inner} ")

However it works only as my normal vector is very specific (constant on each side).