Printing a variable inside a custom WP_Query

Remove the single quotation, use flowing code. hope it will work

'post_type' => $post_type_name,