Exergy analysis with variable ambient conditions