Nanomaterial-based membranes for gas separation and water treatment