A numerical model for toroidal plasma containment with flow