Patent attributes
In some aspects, techniques and systems for simulating well system fluid flow are described. Multiple subsystem models each include fluid flow variables and represent well system fluid dynamics associated with a sub-region in a subterranean region. The subsystem models are connected by one or more junction models. The junction models represent interactions among the subsystem models. For each of the subsystem models, an elimination of internal variables of the subsystem model is performed to express the internal variables in terms of junction variables of the junction models. The junction variables are solved based on the junction models. The internal variables of the subsystem model are solved based on the solved junction variables.