Taanit 12b states that only if one has the ability is fasting positive. The Shulchan Aruch (YD 245:17) states that a melamed a Torah teacher of children should not fast, (see Aruch ha-Shulchan) a voluntary fast so that it does not detract from his teaching. Is the determining factor whether or not one could continue concentrating on his daily activities? Does one's productivity need to remain at the same level as when one is well-nourished? Are there health risks for youth?
Examples of voluntary fasts include erev Rosh Hodesh and BaHaB (Yamim Bet ve-Hei during the weeks of Shovavim).