Aren't Gauss's law for magnetism and Faraday's law of induction contradictory?

The definition of magnetic flux is

$$\Phi = \int_S d\vec{A}\cdot\vec{B},$$

where the integral is not over a closed surface in general. Gauss' Law requires that the integral is over a closed surface, and so there is no contradiction.

In particular, look at any basic discussion of Faraday's Law. They always look at simple loops or coils of wire. There are clearly not closed surfaces, and so the definition of flux can't involve a closed surface in these cases. Without a closed surface it's easy to think of cases where the field gives nonzero flux.


I do not think that I need to draw a closed surface but here is an example of an open surface with a closed loop at its throat.
This is likened to a butterfly net.

enter image description here

It is often the case that the closed surface is taken to be in the plane of the loop for ease of calculation but this does not always have to be so.

The answer to a recent question illustrates this.


Gauss's law states that $\int_S \vec B\cdot d\vec S=0$ for a closed surface, while the induction law relates the flux through an open surface to the electromotive force ($\xi$) in the circuit formed by its border