Simulating Photodiode sensor in LTspice
Obstruction simply means less current through the diode, so you could either add an element across the diode to simulate a resistive (dissipative) effect, or divert the current with another current source, controlled or not. The first method may require additional calculations, while the second might be easier in terms of setting a control voltage/current.
You have a constant current source, so the current through the whole circuit (ciode and parasitic) will be the same, only the diode will see less. Which means you can just model this on the same principle as a solar panel cell: a current source controlling the intensity of the light:

G1 is reversed because it's &quot;stealing&quot; current. I1 is meant to reproduce the constant current source, and V3 some variation of light (here a simple ramp from 1 V to 2 V). The values for the diode are from the master wet finger in the wind. This is just the principle of operation.