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 Thermal Expansion Coefficient #3185

Open
wants to merge 68 commits into
base: develop
Choose a base branch
from

Conversation

sytuannguyen
Copy link
Contributor

@sytuannguyen sytuannguyen commented Jun 25, 2024

This PR implement the non-linear Thermo-Elastic behavior related to non constant Thermal Expansion Coefficient (TEC). Either a linear law or a table could be considered for defining TEC vs Temperature.

  • Update the Porous Solid/Solid Base constitutive behavior to allow temperature dependent TEC
  • Implement TEC table
  • Example, Doc, Python script for validation
  • Integrated tests
  • Include thermally-induced stress in effective stress update

@sytuannguyen sytuannguyen self-assigned this Jun 25, 2024
@sytuannguyen sytuannguyen marked this pull request as ready for review July 1, 2024 01:59
@sytuannguyen sytuannguyen added the ci: run CUDA builds Allows to triggers (costly) CUDA jobs label Jul 1, 2024
Copy link

codecov bot commented Jul 1, 2024

Codecov Report

Attention: Patch coverage is 68.94410% with 50 lines in your changes missing coverage. Please review.

Project coverage is 57.18%. Comparing base (b3592de) to head (36ecb80).

Files with missing lines Patch % Lines
.../coreComponents/constitutive/solid/PorousSolid.hpp 0.00% 33 Missing ⚠️
...rc/coreComponents/constitutive/solid/SolidBase.hpp 46.15% 7 Missing ⚠️
...oreComponents/constitutive/solid/DruckerPrager.hpp 50.00% 2 Missing ⚠️
...nents/constitutive/solid/DruckerPragerExtended.hpp 50.00% 2 Missing ⚠️
...Components/constitutive/solid/ElasticIsotropic.hpp 66.66% 2 Missing ⚠️
...tutive/solid/ElasticIsotropicPressureDependent.hpp 50.00% 2 Missing ⚠️
...eComponents/constitutive/solid/ModifiedCamClay.hpp 50.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3185      +/-   ##
===========================================
+ Coverage    56.82%   57.18%   +0.35%     
===========================================
  Files         1154     1159       +5     
  Lines        99983   100133     +150     
===========================================
+ Hits         56818    57263     +445     
+ Misses       43165    42870     -295     

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

@sytuannguyen sytuannguyen force-pushed the feature/sytuan/temperatureDependentTEC branch from 5fe7e2f to f9c5e54 Compare July 1, 2024 06:41
@sytuannguyen sytuannguyen marked this pull request as draft July 1, 2024 06:43
@sytuannguyen sytuannguyen marked this pull request as ready for review July 11, 2024 02:22
@sytuannguyen sytuannguyen added ci: run integrated tests Allows to run the integrated tests in GEOS CI changes XML input flag: requires rebaseline Requires rebaseline branch in integratedTests type: feature New feature or request labels Jul 11, 2024
@sytuannguyen sytuannguyen changed the title Temperature dependent Thermal Expansion Coefficient A new feature : Temperature dependent Thermal Expansion Coefficient Jul 11, 2024
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.

Great work, Sy Tuan.

LvArray::tensorOps::symAddIdentity< 3 >( totalStress, thermalStressIncrement );

// Save rock stress including the contribution of temperature change.
m_solidUpdate.saveStress( k, q, totalStress );
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice change for computing effective stress to include thermal component.

@jhuang2601
Copy link
Contributor

Hello @rrsettgast and @CusiniM, this PR is almost ready for merge and would appreciate if you take a final review.

@jhuang2601
Copy link
Contributor

jhuang2601 commented Oct 9, 2024

This failure is always reported for GEOS CI / Rockylinux CUDA (8, clang 17.0.6, cuda 12.5.1):

The following tests FAILED:
	 90 - testLifoStorage (Subprocess aborted)
Errors while running CTest

The problem is being handled by #3387

@jhuang2601 jhuang2601 requested a review from npillardou October 10, 2024 15:47
src/coreComponents/constitutive/solid/PorousSolid.hpp Outdated Show resolved Hide resolved
real64 dThermalExpansionCoefficient_dTemperature;
real64 thermalExpansionCoefficient;

if( m_drainedTECTableName == nullptr || m_drainedTECTableName[0] == '\0' )
Copy link
Collaborator

Choose a reason for hiding this comment

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

what's happening here? This seems hacky and it's in a device function...

Copy link
Contributor Author

@sytuannguyen sytuannguyen Nov 7, 2024

Choose a reason for hiding this comment

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

Yes this is a hack to pass the GPU build after many trials & errors. It is welcome if you have another solution that is more suitable to you.

Copy link
Collaborator

Choose a reason for hiding this comment

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

what is this trying to achieve? Can you present to us at one of the dedicated dev meetings what you are trying to do.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe cast m_drainedTECTableName into a bool on host and then pass the bool to PorousSolidUpdates.

src/coreComponents/constitutive/solid/PorousSolid.hpp Outdated Show resolved Hide resolved
src/coreComponents/constitutive/solid/SolidBase.cpp Outdated Show resolved Hide resolved
@@ -121,11 +133,31 @@ class SolidBaseUpdates
* @return the thermalExpansionCoefficient of element k
*/
GEOS_HOST_DEVICE
real64 getThermalExpansionCoefficient( localIndex const k ) const
virtual real64 getThermalExpansionCoefficient( localIndex const k ) const
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do you want this to be virtual? It's okay if you are just trying to enforce that function is implemented everywhere but keep in mind that there are no vtables on device. These functions can't be used as proper virtual functions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

virtual is added to make it consistent with the existing getters of bulk and shear moduli.

Comment on lines +36 to +38
// Test that the default TEC derivative w.r.t. temperature and the default reference temperature are nil.
EXPECT_DOUBLE_EQ( updates.m_dThermalExpansionCoefficient_dTemperature, 0 );
EXPECT_DOUBLE_EQ( updates.m_referenceTemperature, 0 );
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we need these tests? I mean having self-contained tests for the constitutive models is a good idea but it's unclear to me why you need to test this. Aren't you assigning this as default value?

Copy link
Contributor Author

@sytuannguyen sytuannguyen Nov 7, 2024

Choose a reason for hiding this comment

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

These unit tests were added to pass one of the CI build that requires to cover a certain % of the code. Again, I am totally ok if you have another option that is more suitable to you.

Copy link
Collaborator

Choose a reason for hiding this comment

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

that CI test is not mandatory for merging.

static constexpr char const * dThermalExpansionCoefficient_dTemperatureString() { return "dDrainedTEC_dT"; }
static constexpr char const * referenceTemperatureString() { return "referenceTemperature"; }

static constexpr char const * drainedTECTableNameString() { return "drainedTECTableName"; }
Copy link
Contributor

Choose a reason for hiding this comment

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

I would add a validator here. To ensure that if the user provides a table name, then the relevant TableFunction exists.

using namespace geos;
using namespace ::geos::constitutive;

TEST( CeramicDamageTests, testThermalExpansionAndTemperature )
Copy link
Contributor

Choose a reason for hiding this comment

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

I expected this to test some of the kernel functions. Is there a plan for that perhaps?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes XML input ci: run code coverage enables running of the code coverage CI jobs ci: run CUDA builds Allows to triggers (costly) CUDA jobs ci: run integrated tests Allows to run the integrated tests in GEOS CI flag: ready for review 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.

5 participants