move duplicate code related to filling/draining into Solution model element