From 2e8e411ada5f4c2b9873ab29246b546f530784d6 Mon Sep 17 00:00:00 2001 From: arng40 Date: Mon, 22 Dec 2025 15:23:53 +0100 Subject: [PATCH 1/3] fix singlePhaseStats --- .../fluidFlow/SinglePhaseStatistics.cpp | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseStatistics.cpp b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseStatistics.cpp index ab76d6cf7bf..8998a9de506 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseStatistics.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseStatistics.cpp @@ -72,16 +72,16 @@ void SinglePhaseStatistics::registerDataOnMesh( Group & meshBodies ) { std::ofstream outputFile( m_outputDir + "/" + regionNames[i] + ".csv" ); outputFile << - GEOS_FMT( "Time [{}]", units::getSymbol( units::Unit::Time ))<< - GEOS_FMT( "Average pressure [{}]", units::getSymbol( units::Unit::Pressure ))<< - GEOS_FMT( "Min pressure [{}]", units::getSymbol( units::Unit::Pressure ))<< - GEOS_FMT( "Max pressure [{}]", units::getSymbol( units::Unit::Pressure ))<< - GEOS_FMT( "Min delta pressure [{}]", units::getSymbol( units::Unit::Pressure ))<< - GEOS_FMT( "Max delta pressure [{}]", units::getSymbol( units::Unit::Pressure )) << - GEOS_FMT( "Min temperature [{}]", units::getSymbol( units::Unit::Temperature ))<< - GEOS_FMT( "Average temperature [{}]", units::getSymbol( units::Unit::Temperature ))<< - GEOS_FMT( "Max temperature [{}]", units::getSymbol( units::Unit::Temperature ))<< - GEOS_FMT( "Total dynamic pore volume [{}]", units::getSymbol( units::Unit::ReservoirVolume ) ) << + GEOS_FMT( "Time [{}]", units::getSymbol( units::Unit::Time ))<< "," << + GEOS_FMT( "Min pressure [{}]", units::getSymbol( units::Unit::Pressure ))<< "," << + GEOS_FMT( "Average pressure [{}]", units::getSymbol( units::Unit::Pressure ))<< "," << + GEOS_FMT( "Max pressure [{}]", units::getSymbol( units::Unit::Pressure ))<< "," << + GEOS_FMT( "Min delta pressure [{}]", units::getSymbol( units::Unit::Pressure ))<< "," << + GEOS_FMT( "Max delta pressure [{}]", units::getSymbol( units::Unit::Pressure )) << "," << + GEOS_FMT( "Min temperature [{}]", units::getSymbol( units::Unit::Temperature ))<< "," << + GEOS_FMT( "Average temperature [{}]", units::getSymbol( units::Unit::Temperature ))<< "," << + GEOS_FMT( "Max temperature [{}]", units::getSymbol( units::Unit::Temperature ))<< "," << + GEOS_FMT( "Total dynamic pore volume [{}]", units::getSymbol( units::Unit::ReservoirVolume ) ) << "," << GEOS_FMT( "Total fluid mass [{}]", units::getSymbol( units::Unit::Mass )); outputFile << std::endl; outputFile.close(); From c73a68e2a98f7f1f9a92439a3121cd36a854f4d3 Mon Sep 17 00:00:00 2001 From: arng40 Date: Mon, 22 Dec 2025 15:29:18 +0100 Subject: [PATCH 2/3] xsd --- src/coreComponents/schema/schema.xsd | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/coreComponents/schema/schema.xsd b/src/coreComponents/schema/schema.xsd index 524c0e52517..6f03bb9ca76 100644 --- a/src/coreComponents/schema/schema.xsd +++ b/src/coreComponents/schema/schema.xsd @@ -3653,8 +3653,9 @@ Information output from lower logLevels is added with the desired log level +Frequency of pressure update is set in SinglePhase/CompositionalMultiphaseStatistics definition. +Setting cycleFrequency='1' will update the pressure every timestep, note that is a lagged property in constraint propertiesNote the event associated with the statists task must be entered before the solver event. +--> From 80141803dfaef35750f0ccb148b63e6d15b569c9 Mon Sep 17 00:00:00 2001 From: arng40 Date: Mon, 22 Dec 2025 15:54:05 +0100 Subject: [PATCH 3/3] use table fonctions --- .../fluidFlow/SinglePhaseStatistics.cpp | 29 ++++++++++--------- src/coreComponents/schema/schema.xsd | 2 +- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseStatistics.cpp b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseStatistics.cpp index 8998a9de506..839ed5b2be9 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseStatistics.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseStatistics.cpp @@ -70,20 +70,23 @@ void SinglePhaseStatistics::registerDataOnMesh( Group & meshBodies ) // write output header if( m_writeCSV > 0 && MpiWrapper::commRank() == 0 ) { + TableLayout tableLayout( { + TableLayout::Column().setName( GEOS_FMT( "Time [{}]", units::getSymbol( units::Unit::Time ))), + TableLayout::Column().setName( GEOS_FMT( "Min pressure [{}]", units::getSymbol( units::Unit::Pressure ))), + TableLayout::Column().setName( GEOS_FMT( "Average pressure [{}]", units::getSymbol( units::Unit::Pressure ))), + TableLayout::Column().setName( GEOS_FMT( "Max pressure [{}]", units::getSymbol( units::Unit::Pressure ))), + TableLayout::Column().setName( GEOS_FMT( "Min delta pressure [{}]", units::getSymbol( units::Unit::Pressure ))), + TableLayout::Column().setName( GEOS_FMT( "Max delta pressure [{}]", units::getSymbol( units::Unit::Pressure )) ), + TableLayout::Column().setName( GEOS_FMT( "Min temperature [{}]", units::getSymbol( units::Unit::Temperature ))), + TableLayout::Column().setName( GEOS_FMT( "Average temperature [{}]", units::getSymbol( units::Unit::Temperature ))), + TableLayout::Column().setName( GEOS_FMT( "Max temperature [{}]", units::getSymbol( units::Unit::Temperature ))), + TableLayout::Column().setName( GEOS_FMT( "Total dynamic pore volume [{}]", units::getSymbol( units::Unit::ReservoirVolume ) )), + TableLayout::Column().setName( GEOS_FMT( "Total fluid mass [{}]", units::getSymbol( units::Unit::Mass ))) + } ); + + TableCSVFormatter csvFormatter( tableLayout ); std::ofstream outputFile( m_outputDir + "/" + regionNames[i] + ".csv" ); - outputFile << - GEOS_FMT( "Time [{}]", units::getSymbol( units::Unit::Time ))<< "," << - GEOS_FMT( "Min pressure [{}]", units::getSymbol( units::Unit::Pressure ))<< "," << - GEOS_FMT( "Average pressure [{}]", units::getSymbol( units::Unit::Pressure ))<< "," << - GEOS_FMT( "Max pressure [{}]", units::getSymbol( units::Unit::Pressure ))<< "," << - GEOS_FMT( "Min delta pressure [{}]", units::getSymbol( units::Unit::Pressure ))<< "," << - GEOS_FMT( "Max delta pressure [{}]", units::getSymbol( units::Unit::Pressure )) << "," << - GEOS_FMT( "Min temperature [{}]", units::getSymbol( units::Unit::Temperature ))<< "," << - GEOS_FMT( "Average temperature [{}]", units::getSymbol( units::Unit::Temperature ))<< "," << - GEOS_FMT( "Max temperature [{}]", units::getSymbol( units::Unit::Temperature ))<< "," << - GEOS_FMT( "Total dynamic pore volume [{}]", units::getSymbol( units::Unit::ReservoirVolume ) ) << "," << - GEOS_FMT( "Total fluid mass [{}]", units::getSymbol( units::Unit::Mass )); - outputFile << std::endl; + outputFile << csvFormatter.headerToString(); outputFile.close(); } } diff --git a/src/coreComponents/schema/schema.xsd b/src/coreComponents/schema/schema.xsd index c55fa2462d8..80750753fcd 100644 --- a/src/coreComponents/schema/schema.xsd +++ b/src/coreComponents/schema/schema.xsd @@ -8404,7 +8404,7 @@ The expected format is "{ waterMax, oilMax }", in that order--> - +