def adjust_volume_gravity(vol, og, new_vol):
    """
    Calculate the new gravity after boil off or dilution to ``new_vol``
    This is unit independent and the volume can be used for liters
    and or gallons.

    Ending Gravity = (Beginning Volume * Beginning Gravity) / End Volume

    :arg vol: Original volume of wort
    :arg og: The current gravity of the wort
    :arg new_vol: The new volume of the wort
    :returns: The new gravity after boiloff or dilution
    """
    og = (og - 1) * 1000
    return 1 + ((vol * og) / new_vol) / 1000