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

PVT Tables logging improvements #3003

Closed
wants to merge 131 commits into from
Closed

PVT Tables logging improvements #3003

wants to merge 131 commits into from

Conversation

arng40
Copy link
Contributor

@arng40 arng40 commented Feb 27, 2024

This PR follows the #2984 that aim to standardize logs.
Currently PVT tables are only accessible throught .csv files.
In this PR, logs will indicate which csv files are generated along with their associate path

CSV Generated to inputFiles/compositionalMultiphaseWell/test.xml/fluid1_phaseModel1_PhillipsBrineDensity_table.csv :
---------------------------------------------------------------------------------------
|                    fluid1_phaseModel1_PhillipsBrineDensity_table                    |
---------------------------------------------------------------------------------------
|  The fluid1_phaseModel1_PhillipsBrineDensity_table PVT table exceeding 500 rows.    |
|  To visualize the tables, go to the generated csv                                   |
---------------------------------------------------------------------------------------

In addition to csv files, PVT Tables with dimensions n <= 2 can be written in log by meetings 2 conditions :

  • have sufficient log lovel
  • Rows in the table < 500 lines
CSV Generated to inputFiles/compositionalMultiphaseWell/test.xml/fluid1_phaseModel1_PhillipsBrineViscosity_table.csv
---------------------------------------------------------
|    fluid1_phaseModel1_PhillipsBrineViscosity_table    |
---------------------------------------------------------
|    temperature [C]     |       viscosity [Pa*s]       |
---------------------------------------------------------
|          0.01          |          0.0017914           |
|           10           |           0.001306           |
|           20           |          0.0010016           |
|           25           |           0.00089            |
|           30           |          0.0007972           |
---------------------------------------------------------

…feature/dudes/table-layout"

This reverts commit 8f74cfa.
Copy link
Contributor

@MelReyCG MelReyCG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some refactor suggestions

Comment on lines 208 to 218

if( printInCsv || ( printInLog && m_CO2EnthalpyTable->numDimensions() >= 3 ) )
{
m_CO2EnthalpyTable->printInCSV( m_CO2EnthalpyTable->getName() );
m_brineEnthalpyTable->printInCSV( m_brineEnthalpyTable->getName() );
}
if( printInLog && m_CO2EnthalpyTable->numDimensions() <= 2 )
{
m_CO2EnthalpyTable->print( m_CO2EnthalpyTable->getName() );
m_brineEnthalpyTable->print( m_brineEnthalpyTable->getName() );
m_CO2EnthalpyTable->printInLog( m_CO2EnthalpyTable->getName() );
m_brineEnthalpyTable->printInLog( m_brineEnthalpyTable->getName() );
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, you are assuming that m_CO2EnthalpyTable and m_brineEnthalpyTable have the same dimensions. m_CO2EnthalpyTable is "choosing" the formatting for m_brineEnthalpyTable.
But this assomption is wrong, they does not have the same layout !

You could do two if for each tables, or you could create a function that factorize this choice, something like TableFunction::print( bool printInCsv, bool printInLog ).
Factorizing can be a good thing as there we need 13 of these conditions.

Comment on lines 240 to 253
bool isClone = true;
if( getParent().getName() == "Constitutive" )
{
string sectionOutput;
string sectionName = "Section : PVT Table generation";

sectionOutput = GEOS_FMT( "\n{:=^{}}\n", "=", sectionName.size() + 5 );
sectionOutput += GEOS_FMT( "{:^{}}\n", sectionName, sectionName.size() + 5 );
sectionOutput += GEOS_FMT( "{:=^{}}\n\n", "=", sectionName.size() + 5 );

std::cout << sectionOutput;

isClone = false;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do this job without this if ? The relation with the "Constitutive" parent is external to this class. If possible, I think that doing with your isClone parameter is clearer and more maintainable.

Comment on lines 244 to 250
string sectionName = "Section : PVT Table generation";

sectionOutput = GEOS_FMT( "\n{:=^{}}\n", "=", sectionName.size() + 5 );
sectionOutput += GEOS_FMT( "{:^{}}\n", sectionName, sectionName.size() + 5 );
sectionOutput += GEOS_FMT( "{:=^{}}\n\n", "=", sectionName.size() + 5 );

std::cout << sectionOutput;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a reminder to keep that in mind, those sections layout will need to be factorized in a dedicated PR.

@arng40 arng40 marked this pull request as ready for review April 24, 2024 15:32
Copy link

codecov bot commented May 27, 2024

Codecov Report

Attention: Patch coverage is 90.02079% with 48 lines in your changes missing coverage. Please review.

Project coverage is 53.76%. Comparing base (d3783ad) to head (ac0cec8).
Report is 99 commits behind head on develop.

Files Patch % Lines
...reComponents/mesh/generators/WellGeneratorBase.cpp 4.00% 24 Missing ⚠️
src/coreComponents/fileIO/Table/TableFormatter.cpp 97.05% 5 Missing ⚠️
src/coreComponents/common/DataTypes.hpp 0.00% 4 Missing ⚠️
src/coreComponents/fileIO/Table/TableData.cpp 87.87% 4 Missing ⚠️
...oreComponents/fileIO/Table/unitTests/testTable.cpp 96.73% 3 Missing ⚠️
...e/fluid/multifluid/reactive/ReactiveBrineFluid.cpp 81.81% 2 Missing ⚠️
src/coreComponents/fileIO/Table/TableLayout.cpp 92.00% 2 Missing ⚠️
...tTests/constitutiveTests/testCO2BrinePVTModels.cpp 50.00% 2 Missing ⚠️
src/coreComponents/functions/TableFunction.cpp 98.00% 1 Missing ⚠️
...s/constitutiveTests/testCO2SpycherPruessModels.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3003      +/-   ##
===========================================
+ Coverage    53.57%   53.76%   +0.19%     
===========================================
  Files         1003     1010       +7     
  Lines        85297    85695     +398     
===========================================
+ Hits         45695    46075     +380     
- Misses       39602    39620      +18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants