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: add analytical leakoff #3525

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

feat: add analytical leakoff #3525

wants to merge 5 commits into from

Conversation

Guotong-Ren
Copy link
Contributor

add Carter's law to complement the fracture propagation in the elastic media.

// mid-point rule in time
//localRhs[localRow] += m_leakoffConst * area[kfe] * dens[kfe][0] / sqrt(time + dt / 2.0 - m_fractureCreationTime[kfe]);
localRhs[localRow] += m_leakoffConst * area[kfe] * dens[kfe][0] / sqrt(time + dt / 2.0 - m_fractureCreationTime[kfe]);
std::cout << "creation time " << kfe << " " << m_fractureCreationTime[kfe] << std::endl;
Copy link
Contributor

Choose a reason for hiding this comment

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

remove debug

@paveltomin paveltomin added the ci: run CUDA builds Allows to triggers (costly) CUDA jobs label Jan 28, 2025
[&]( localIndex const,
FaceElementSubRegion const & subRegion )
{
std::size_t regionSize = subRegion.size();
Copy link
Contributor

Choose a reason for hiding this comment

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

replace size_t with localIndex

arrayView1d< integer const > const elemGhostRank = subRegion.ghostRank();

const int numDof = 1;
const int numEqn = 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

int -> integer

Copy link
Collaborator

Choose a reason for hiding this comment

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

these can be constexpr

forAll< serialPolicy >( regionSize,
[&] GEOS_HOST_DEVICE ( localIndex const kfe ) mutable
{
if ( elemGhostRank[kfe] >= 0 || time == m_fractureCreationTime[kfe] ) return;
Copy link
Contributor

Choose a reason for hiding this comment

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

<= for time comparison here? or some epsilon?

globalIndex dofIndices[numDof]{};
real64 localJacobian[numEqn][numDof]{};
forAll< serialPolicy >( regionSize,
[&] GEOS_HOST_DEVICE ( localIndex const kfe ) mutable
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure if mutable is needed

Copy link
Collaborator

Choose a reason for hiding this comment

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

as a matter of fact, I don't think mutable device lambdas are supported

Copy link
Contributor

@paveltomin paveltomin left a comment

Choose a reason for hiding this comment

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

fix code style

@@ -256,6 +264,11 @@ class HydrofractureSolver : public POROMECHANICS_SOLVER
// flag to determine whether or not to apply lagging update for the fracture stencil weights
integer m_isLaggingFractureStencilWeightsUpdate;

// record to fracture cell creatition time
std::vector<double> m_fractureCreationTime;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
std::vector<double> m_fractureCreationTime;
array1d<real64> m_fractureCreationTime;

std::vector<double> m_fractureCreationTime;

// analytical leakoff coefficient
real64 m_leakoffConst;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
real64 m_leakoffConst;
real64 m_leakoffCoefficient;

?

@@ -179,6 +179,8 @@ class HydrofractureSolver : public POROMECHANICS_SOLVER

constexpr static char const * isLaggingFractureStencilWeightsUpdateString() { return "isLaggingFractureStencilWeightsUpdate"; }

constexpr static char const * leakoffConstString() {return "leakoffConst"; }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
constexpr static char const * leakoffConstString() {return "leakoffConst"; }
constexpr static char const * leakoffCoefficientString() {return "leakoffCoefficient"; }

?

const int localRow = presDofNumber[kfe] - rankOffset;
for( integer idof = 0; idof < numDof; ++idof )
dofIndices[idof] = presDofNumber[kfe] + idof;
localJacobian[0][0] = m_leakoffConst * area[kfe] * dDens_dPressure[kfe][0] / sqrt(time + dt / 2.0 - m_fractureCreationTime[kfe]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

use LvArray::sqrt

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.

Do we really need this analytical model? What we have should actually be better.

@Guotong-Ren
Copy link
Contributor Author

Do we really need this analytical model? What we have should actually be better.

I am a numerical believer too. but when it shows strong transient effects, especially during the fracturing, enormous refinement near the fracture is seen to match the theoretical solution. That is why I think this feature can complement applications to some extent and also maintain a quite good level of preciseness. I will show our studies next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci: run CUDA builds Allows to triggers (costly) CUDA jobs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants