Skip to content

[fluidsystems] Implement ranges to iterate over phases and components

Timo Koch requested to merge feature/fluid-ranges into master

Multiphase fluidsystem can be used for single or multiphase simulations with the less phases and the same number of components. This adds general iterators that extract from model traits which phases to use. The default goes over phases 0..numPhases and 0..numComponents. However modeltraits can implement an optional function phases/components that returns an array of size numPhases/numComponents containing the selected phases/components. For selecting components there is currently no use case but when iterating over all phases and component this is going to look more consistent.

for (const auto phase : phases(model)
    for (const auto component : components(model))

Merge request reports