I'm trying to implement a half-wave rectifier using just a diode. I'm using a unity gain opamp for isolation from the mains. At the output of the opamp, I'm using a smoothing capacitor to get a DC voltage across 1K load resistor.
I don't know what you mean here with isolation, but the opamp does not isolate from mains, don't be lured into false sense of safety.
You have an ideal simulator, the op-amp will buffer whatever voltage there is at the input, and it will do that no matter how big capacitor you put at the op-amp output, it will get charged and discharged by the op-amp.
Thank you so much.
I moved the diode after the opamp. Technically, The -ve of the opamp is connected to the ground. So the opamp itself should rectify (No diode needed). But without the diode, I was running into the previous problem where the smoothing capacitor is not worth the way it supposes to work.