Why isn't there any current in the primary if secondary circuit is opened in a transformer? Consider an ideal transformer, with no load/resistor attached on the secondary (ppen circuit). It is said that the primary would act as if it is an open circuit too, thus no current flows through the primary.
My question is how does the primary 'knows' there is nothing connected on the secondary, and acts like an open circuit although they're not?
 A: If there is not a complete conducting circuit then the emf induced in the secondary does not produce an induced current and this in turn means that there is no induced magnetic field produced by the secondary coil.
If the secondary coil does not produce an induced magnetic field then the primary will not know of the "presence" of the secondary coil and so the primary circuit behaves as though there is no secondary coil present - ie as a self inductor.

. . . thus no current flows through the Primary.

That being the case there will be a current in the primary and if there was no resistance in the primary circuit and it was an ideal self inductor then the current and the applied voltage would be $90^\circ$ out of phase with one another which means that on average no heat/energy is dissipated in the primary circuit.
If that secondary circuit is completed then the induced emf in the secondary induces a current in the secondary which in turn produces an induced magnetic field which the primary coil can "feel".
This induced magnetic field due to the secondary then induces an emf in the primary which then changes the phase relationship between the primary voltage and current.
With a resistive load and an ideal transformer the current and voltage in the primary are in phase with one another.
A: It doesn't. A transformer works by magnetic induction between the two coils, it doesn't matter whether the secondary is loaded or not. The primary, if connected to a source of current, conducts just fine.
The alternating magnetic field, created by the primary is always present in the system and the induction happens even in an open secondary. It just doesn't do any work.
Unlike what PhysicsDave said below, adding a resistor just anywhere produces different results. Adding a resistor along the primary reduces the voltage, reaching the induction coil by dissipating some energy as heat. While adding a resistance or load along the secondary makes use of the energy rather than waste it in the case of resistor in primary winding.
Also opening the primary winding's circuit with the secondary unloaded might causes spark to jump across the switch, cause by backflow of current due to self induction of the primary.
Induction in a transformer is a bit tricky I'll say, when a coil is energized and a magnetic field is formed around it, this energy seems to be stored somewhere in space within the field as potential. This energy bank energizes the electron in the secondary winding.
Now, if the secondary is not consuming the energy and the primary circuit is also abruptly discontinued, what happens to the potential energy in the field and the energy in the energized electrons in the secondary winding? It's not in a form of energy that can propagate out into space - heat, sound or electromagnetic -, so if it can't flow outward, then it flows back inward. If self induction never happens in a case like that, then we'll have a cloud of energy floating around in 3D space, and any conductor in its path get toasted (I mean a human).
A: There is current flow but it only serves to build up the magnetic field and then the magnetic field in turn builds up the current later in the cycle assuming AC voltage. No energy is consumed until you add a resistor somewhere then the circuit. (in the primary or secondary)
Also below is a copy from wikipedia:
When there is a change in current, there is a change in the strength of the induced magnetic field. Without loss of generality, let us assume we have increased the current over our inductor, and now our induced magnetic field is stronger. This, however, does not come without a price. Magnetic fields store energy, and the stronger they are the more energy they store. To make up for an increase in magnetic potential energy in the induced magnetic field, we must take some energy from the inductor in the form of electrical energy. Here we experience a drop in electric potential over the inductor i.e a negative voltage. Once we stop increasing the current, and keep it constant, no additional energy must be supplied to the magnetic field and the electrical potential returns to its original value, thus we see no voltage drop over the inductor.
A: One idealization of a transformer has input impedance equal to the transformer ratio divided into
the secondary-connected load impedance.   That is a simplified model, a
real transformer will have some input-circuit inductance (it's a kind
of electromagnet) in the open-circuit secondary scenario.

how does the Primary 'knows' there is nothing connected on the Secondary?

A transformer primary circuit delivers power, it does real work on the secondary
circuit, just as you have to do real work when you leash up your pet rock and
take it for a walk.   The tug on the leash, opposing your forward progress,
is there because it takes some power to keep the rock moving against friction.
Opening the secondary circuit, like putting the rock atop a skateboard,
lessens greatly the power
delivered, which means (in a perfect transformer) the impedance
changes.   The low power drawn corresponds to low current on the input
side (assuming an AC voltage source is pressent), which is just the
transformer impedance equation being obeyed.
