renamed u_g to result_g in order not to confuse it with flow->u_g