Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Statistics output refactoring #3145

Open
arng40 opened this issue May 28, 2024 · 0 comments
Open

Statistics output refactoring #3145

arng40 opened this issue May 28, 2024 · 0 comments
Assignees
Labels
type: cleanup / refactor Non-functional change (NFC) type: new A new issue has been created and requires attention

Comments

@arng40
Copy link
Contributor

arng40 commented May 28, 2024

Describe the issue

In the future, outputs of the statistics classes would be done with PackCollection & TimeHistory & 2 events (3 in total), which is quite verbose and inconvenient for the user to maintain.

Proposed cleanup

I propose 2 alternatives but these suggestions could change:

Main Proposal:
We could only have 2 node to ask When and What is to output.

CompositionalMultiphaseStatistics would now be an output, with two optional attributes:

  • logLevel to enable the reporting in the log, necessary for the user to quickly see the simulation state,
  • outputFile (s?), to allow the output of those statistics in a file (HDF5, CSV...).

Within the code, we would have:

  • To gather the data, CompositionalMultiphaseStatistics (and log it if requested),
  • To contain the data, a CompositionalMultiphaseStatistics::RegionStatistics Group, as proposed by @untereiner in Collect log information in hdf5 #2298,
  • To output the data, the FieldStatisticsBase (a new StatisticsOutput class) which would create automatically the necessary TimeHistoryOutput, PackCollection and their events.
<Outputs>
  <CompositionalMultiphaseStatistics
     name="compflowStatistics"
     flowSolverName="compositionalMultiphaseFVMSolver"
     logLevel="1"
     computeCFLNumbers="1"
     computeRegionStatistics="1" 
     outputFile="singlePhaseStats.hdf" />
</Outputs>

<Events>
  <PeriodicEvent
    name="myStatsOutputEvent"
    timeFrequency="1e5"
    targetExactTimestep="1"
    target="/Outputs/compflowStatistics" />
</Events>

Alternative Proposal

Separate the output file from the statistics declaration, therefore we can have multiple statistics output files inside <Outputs>.
StatsOutput would be an observer of the statistics classes and wouldn't require additional events.

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

<Outputs>
  <StatsOutput
    name="myStatsOutput"
    source="compflowStatistics"
    outputFile="sourceFluxStats.csv" />
</Outputs>

<Events>
  <PeriodicEvent
    name="myStatsOutputEvent"
    timeFrequency="1e5"
    targetExactTimestep="1"
    target="/Tasks/compflowStatistics" />
</Events>

co-authored with @MelReyCG.

@arng40 arng40 added type: cleanup / refactor Non-functional change (NFC) type: new A new issue has been created and requires attention labels May 28, 2024
@arng40 arng40 self-assigned this May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: cleanup / refactor Non-functional change (NFC) type: new A new issue has been created and requires attention
Projects
None yet
Development

No branches or pull requests

1 participant