Hi,
There are two ways to do this simulation. Both of them are not difficult.
1. As mentioned already, but not elaborated, you should break the loop for ac but keep it closed for dc.If you don't do this you run into problems with the dc operating point and saturation of the amplifier because of the high gain. Suppose you have an op-amp connected as a voltage follower (the most difficult to stabilize). The feedback is from the output to the inverting input. Break the loop there and put a resistor. Now, from the inverting input connect a capacitor. To the other side of the cap, connect your ac source (which has 0v dc) to gnd . Make the RC timeconstant of the added network very big. It actually depends on the lowest frequency you want to investigate. Given that frequency, make the time constant such that it produces a frequency at least 10 times smaller. Usually making R and C big (10Meg and 1mF) is sufficient. This way you keep the loop closed for dc through the resistor (the cap is open circuit and doesnt influence the dc operating point), but effectively open it for ac because the capacitor brings the inverting input to ac ground. The non-inverting input being connected to a dc voltage source is also ac ground. So, you have just an ac voltage exciting the loop. Measure the ratio and phase of the voltages at both sides of the resistor.
Instead of a R, you can use an inductor which is again dc short and opens the loop from some frequency upwords
2. Break the loop by putting an ac voltage source instead of the resistor. No capacitor is needed in this case. So, the configuration is the output, then the ac source, then the inverting input. The non-inverting input is again connected to the common mode dc voltage. In this way the loop is closed for dc through the zero ohm resistance of the voltage source, but the ac source injects signal in the loop. In this case however, the loop has to be broken in a place where you have a very big impedance (ideally infinite) on one side of the ac source and small impedance on the other side. Measure the ratio and it's phase of the voltages to ground on both sides of the voltage source - the input voltage is the one facing the high-impedance point. This method produces good results for frequencies usually up to the 0db frequency, but after that you see a difference between the two methods. The reason is that for high-frequencies you don't have any more a very-high impedance point that you have to face. Actually the complete method for correct rezults is to inject voltage, then current and do the combination of the two loop gains, but I don't remember the formula how to combine them. In any case, if you find a high impedance point you are ok with only a voltage injection.
Hope this helps. Have fun.