GEOS icon indicating copy to clipboard operation
GEOS copied to clipboard

feat: Simplify region statistics output in HDF5

Open arng40 opened this issue 5 months ago • 8 comments

this PR is based on the work of @wrtobin & @untereiner : Memory Space Aware Packing , Export info embedded on regions

With the current impl, in order to output region statistics we would have to create :

  • 1 <CompositionalMultiphaseStatistics> component + 1 <PeriodicEvent>
  • 1 <TimeHistory> per region with each desired statistics fields (hidden to the user) + 1 <periodicEvent> per <TimeHistory>
  • 1 <PackCollection> per field and 1 <PeriodicEvent> per <packCollection> With multiple regions this could easily lead to hundred of components to create and maintain manually
<Tasks>

    <CompositionalMultiphaseStatistics
      name="compflowStatistics"
      flowSolverName="compflow"
      logLevel="1"
      computeCFLNumbers="1"
      computeRegionStatistics="1"/>

    <PackCollection
      name="pressureRegion1Collection"
      objectPath="Path/to/field/"
      fieldName="pressure"/>
[Omitting around 18 fields X 3 regions ...]
    <PackCollection
      name="minTRegion1Collection"
      objectPath="Path/to/field/"
      fieldName="minT"/>

</Tasks>
 <Outputs>

    <TimeHistory
      name="timeHistoryOutput"
      sources="{ Path/toregionA/field }"
      filename="outputRegions"/>
[Omitting 2 regions ...]
    <TimeHistory
      name="timeHistoryOutput"
      sources="{ Path/toregionD/field }"
      filename="outputRegions"/>

  </Outputs>
<Events>

    <PeriodicEvent
      name="statComputeEvent"
      forceDt="1e6"
      target="/Tasks/compflowStatistics"/> 

    <PeriodicEvent
      name="pressureCollectionEvent"
      forceDt="1e6"
      target="/Tasks/pressureRegion1Collection"/>
[Omitting around 18 fields X 3 regions ...]
    <PeriodicEvent
      name="pressureCollectionEvent"
      forceDt="1e6"
      target="/Tasks/minTRegion1Collection"/>

    <PeriodicEvent
      name="statOutputEvent"
      forceDt="1e6"
      target="/Output/timeHistoryOutput"/>

</Events>

With the controller component proposed in this PR, we would have all <PackCollection>, <TimeHistory> and their <PeriodicEvent> automatically created / managed :

<Problem>
     
  <Solvers>
    <CompositionalMultiphaseFVM
      name="compflow"
      logLevel="1"
      [...]
      />
    </CompositionalMultiphaseFVM>
  </Solvers>    

  <Events
    maxTime="8.64e6">
    <PeriodicEvent
      name="statistics"
      timeFrequency="1e6"
      target="/Tasks/statController"/>
  </Events>

  <Tasks>
    <StatOutputController name="statController" >
      <CompositionalMultiphaseStatistics
        name="compflowStatistics"
        flowSolverName="compflow"
        logLevel="1"
        computeCFLNumbers="1"
        computeRegionStatistics="1"
      />
    </StatOutputController>

  </Tasks>
  
</Problem>

arng40 avatar Aug 29 '24 09:08 arng40