Text this: Flowfield-dependent variation method for moving-boundary problems