Resistances in transmission system are negligible, so 1.0pu voltage assumption holds. However, in distribution system, resistances are not negligible. Please provide information about some simple ACOPF relaxation method. Thanks.
HV and UHV transmission system resistances are negligible, but reactance is not.
So assuming 1.0 pu voltage on each bus, is used just for the model linearization in the right part of equation system.
The result of OPF calculation will be optimal voltages on each bus, and then we can calculate power flows based on this voltages.
If distrubution system has no loop circuit we can calculate active power flow and reactive power flow separately. And this is the main relaxation. We can assume 1.0 pu voltage in the head of the feeder, and then calculate power flows.
As Oleksander pointed out, there is a difference in the X/R ratio between distribution and transmission systems.
Anyway, the latest MATPOWER manual has a dedicated (custom) version of OPF for distribution systems called the distribution OPF. I'd recommend checking out the MATPOWER manual. also, since this tool already exists, you don't need to code OPF by yourself.