Programming efficient numerical simulations on heterogeneous supercomputers remains challenging despite advances in runtime interoperability. Task-based programming models offer significant benefits for exploiting asynchronous execution and communication-computation overlap, but manual porting is complex, time-consuming, and requires deep expertise. This paper presents a methodology for porting heterogeneous applications to task-based programming models. Operating with static analysis on the Control Flow Graph, our approach systematically decomposes code into tasks through three phases:(1) initial task definition by instruction classification, (2) control structure management, and (3) function call expansion. The methodology systematically decomposes code into hierarchical task definitions that preserve program semantics while exposing available parallelism for runtime exploitation. We evaluate our methodology on Lulesh and MiniFE scientific miniapplications. The porting generates functionally correct taskbased versions producing numerically identical results. For Lulesh, complete porting achieves performance gains from improved communication-computation overlap. The methodology identifies and reports constraints limiting parallelism, providing developers with actionable feedback for optimization. By guiding the initial porting process while maintaining transparency about limitations, our approach significantly reduces the barrier to adopting task-based programming for heterogeneous HPC applications.