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

feat: Temperature dependent single phase thermal conductivity #3135

Merged

Conversation

sytuannguyen
Copy link
Contributor

@sytuannguyen sytuannguyen commented May 22, 2024

This PR is part of the project for non-linear thermal constitutive behavior from TotalEnergies. It tackles the problem of linear temperature dependent single phase effective thermal conductivity of porous medium.

thermalConductivity = defaultThermalConductivity + dThermalConductivity_dT * (T - T_reference)

where defaultThermalConductivity, dThermalConductivity_dT and T_reference are given in the xml inputs. The existing linear model in GEOS corresponds to the particular case of a constant thermal conductivity, i.e. dThermalConductivity_dT = 0.

  • Implement the non linear thermal constitutive model
  • Update the thermal single phase flow with respect to non linear thermal behavior
  • Update xml files to add new inputs: dThermalConductivity_dT and T_reference
  • Integrated test
  • Unit test
  • Validation example: doc and Python script for validation

Copy link
Contributor

@herve-gross herve-gross left a comment

Choose a reason for hiding this comment

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

Thank you Sy Tuan. Lots of change in this PR, but everything looks in order.

@sytuannguyen sytuannguyen marked this pull request as ready for review June 26, 2024 01:38
@sytuannguyen sytuannguyen added ci: run CUDA builds Allows to triggers (costly) CUDA jobs ci: run integrated tests Allows to run the integrated tests in GEOS CI flag: requires rebaseline Requires rebaseline branch in integratedTests labels Jun 26, 2024
Copy link

codecov bot commented Jun 26, 2024

Codecov Report

Attention: Patch coverage is 86.25000% with 11 lines in your changes missing coverage. Please review.

Project coverage is 56.59%. Comparing base (6f9c1b4) to head (6e7b2f6).
Report is 91 commits behind head on develop.

Files with missing lines Patch % Lines
...Solvers/fluidFlow/ThermalSinglePhaseFVMKernels.hpp 46.15% 7 Missing ⚠️
...onductivity/SinglePhaseThermalConductivityBase.hpp 0.00% 2 Missing ⚠️
...malConductivity/SinglePhaseThermalConductivity.cpp 98.11% 1 Missing ⚠️
...onductivity/SinglePhaseThermalConductivityBase.cpp 66.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3135      +/-   ##
===========================================
+ Coverage    56.58%   56.59%   +0.01%     
===========================================
  Files         1064     1064              
  Lines        89715    89752      +37     
===========================================
+ Hits         50763    50793      +30     
- Misses       38952    38959       +7     

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

} );
}

void SinglePhaseThermalConductivity::updateFromTemperature( arrayView1d< real64 const > const & temperature ) const
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is not really how things are usually done in GEOS since we usually have these update functions in the kernelWrapper objects.

Copy link
Contributor Author

@sytuannguyen sytuannguyen Aug 13, 2024

Choose a reason for hiding this comment

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

Before this PR, there is an "update" function here, I just replace it by this function. By doing so, I did not intend to change the architecture design of GEOS.

Copy link
Collaborator

@CusiniM CusiniM left a comment

Choose a reason for hiding this comment

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

Can we find a better name to replace ThermalConductivityGradientComponents?

@@ -11,7 +11,7 @@
targetRegions="{ region }">
<NonlinearSolverParameters
newtonTol="1.0e-6"
newtonMaxIter="10"/>
newtonMaxIter="100"/>
Copy link
Collaborator

Choose a reason for hiding this comment

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

why? is this case taking 100 nonlinear iterations?

Copy link
Contributor

Choose a reason for hiding this comment

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

20 would be sufficient

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This number is to ensure the convergence of the benchmark case

Copy link
Member

Choose a reason for hiding this comment

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

I should converge in 20. if not, then something is wrong.

Copy link
Contributor

Choose a reason for hiding this comment

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

I can confirm that it converges in 20.

return SinglePhaseThermalConductivityBase::deliverClone( name, parent );
}

void SinglePhaseThermalConductivity::initializeRockFluidState( arrayView2d< real64 const > const & initialPorosity ) const
Copy link
Collaborator

Choose a reason for hiding this comment

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

well, can we change it? I don't understand why it would use the porosity. And the name is quite confusing.

* @brief Getter for the derivative of effective conductivities in the subRegion w.r.t. temperature
* @return an arrayView of derivative of effective conductivities w.r.t. temperature
*/
arrayView3d< real64 const > dEffectiveConductivity_dT() const { return m_dEffectiveConductivity_dT; }
Copy link
Collaborator

Choose a reason for hiding this comment

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

do you need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, absolutly, adding this term is the core of this implementation for temperature dependent single phase thermal conductivity.

Copy link
Contributor

Choose a reason for hiding this comment

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

Does it need to be in the base class? Can it be in the SinglePhaseThermalConductivity class itself. I can imagine we might later have thermal conductivity models that don't need this.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I meant "do you need this getter"? We have specific ways to grab fields from consitutive models through getField

@jhuang2601
Copy link
Contributor

Can we find a better name to replace ThermalConductivityGradientComponents?

How about ThermalConductivityGradient?

@sytuannguyen
Copy link
Contributor Author

Can we find a better name to replace ThermalConductivityGradientComponents?

How about ThermalConductivityGradient?

From my point of view, ThermalConductivityGradientComponents is more appropriate because it stands for the components of the thermal gradient vector, also it is consistent to the existing name ThermalConductivityComponents for the components of the thermal conductivity.

@CusiniM
Copy link
Collaborator

CusiniM commented Aug 25, 2024

This PR still needs a codeowner's review so I cannot merge it. Let's not put in the merge queue PR's that still need approval because they clog it.

@sytuannguyen
Copy link
Contributor Author

This PR still needs a codeowner's review so I cannot merge it. Let's not put in the merge queue PR's that still need approval because they clog it.

What does this means? Do you mean this PR need to be validated by all the 10 code owners or just some of you?

* @brief Getter for the derivative of effective conductivities in the subRegion w.r.t. temperature
* @return an arrayView of derivative of effective conductivities w.r.t. temperature
*/
arrayView3d< real64 const > dEffectiveConductivity_dT() const { return m_dEffectiveConductivity_dT; }
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it need to be in the base class? Can it be in the SinglePhaseThermalConductivity class itself. I can imagine we might later have thermal conductivity models that don't need this.

@CusiniM
Copy link
Collaborator

CusiniM commented Aug 26, 2024

This PR still needs a codeowner's review so I cannot merge it. Let's not put in the merge queue PR's that still need approval because they clog it.

What does this means? Do you mean this PR need to be validated by all the 10 code owners or just some of you?

Only 1 code owner for each folder that was modified by the PR.

@jhuang2601
Copy link
Contributor

Hello @rrsettgast, please take a look on this PR, which is waiting for your approval.

@@ -11,7 +11,7 @@
targetRegions="{ region }">
<NonlinearSolverParameters
newtonTol="1.0e-6"
newtonMaxIter="10"/>
newtonMaxIter="100"/>
Copy link
Member

Choose a reason for hiding this comment

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

I should converge in 20. if not, then something is wrong.

@@ -11,7 +11,7 @@
targetRegions="{ region }">
<NonlinearSolverParameters
newtonTol="1.0e-6"
newtonMaxIter="10"/>
newtonMaxIter="100"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

I can confirm that it converges in 20.

@CusiniM CusiniM merged commit fda7ed2 into develop Sep 5, 2024
22 checks passed
@CusiniM CusiniM deleted the feature/sytuan/temperatureDependentThermalConductivity branch September 5, 2024 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes XML input ci: run CUDA builds Allows to triggers (costly) CUDA jobs ci: run integrated tests Allows to run the integrated tests in GEOS CI flag: requires rebaseline Requires rebaseline branch in integratedTests type: feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants