A semi-analytical foreshock model for energetic storm particle events inside 1 AU