Considering the basis of your question as your requirement:
20 hours’ work required for a task, over 15 days duration with 30% resource allocation.
30% of a single day is 2.4 hours, times 15 days = 36 hours and not 20 hours.
There is a mismatch in your requirement between the 20 hours of work vs. 36 hours of work yielded from the 30% allocation.
You will need to 'freeze' some combination of your Duration, Work, % Resource Allocation and allow the other to ‘float’ in the calculation process. Here are some options below:
Freeze 15 days and 20 hours total work: either 16% or 17% resource allocation (running tests on MS Project 2010 standard; does not handle fractional % allocations – comes up with 17%)
Freeze 30% allocation and 15 days: 36 hours work
Freeze 30% allocation and 20 hours: 8.33 days duration
You can allow MS Project to perform the desired calculation by adjusting your Task type or 'fixed-ness’ by choosing the desired task and performing the following:
Task Information ==> Advanced tab ==> Task Type drop down
Then choose between
- Fixed Units
- Fixed Duration
- Fixed Work
An additional consideration is the effort driven check box, also on the advanced task. This mostly comes into play when you have more than one resource on a task, which did not seem to be a part of your requirement and question. From the Microsoft website at the second link below:
“When you assign or remove people from a task, Project lengthens or shortens the duration of the task based on the number of resources that are assigned to it, but Project does not change the total work for the task. This is called effort-driven scheduling and is the setting Project typically uses when you assign resources to tasks.”
Additional information
Task Types:
https://support.office.com/en-US/article/Change-the-task-type-for-more-accurate-scheduling-B0B969AD-45BC-4E9E-8967-435587548A72
Effort Driven checkbox
https://support.office.com/en-US/article/Change-the-effort-driven-setting-for-task-types-18EFD7C7-D146-4B06-BDBE-B6A11564BDF3
Good Luck