Skip to content

feat: Introduce full tensor permeability#2822

Open
CusiniM wants to merge 16 commits into
developfrom
feature/cus-cas/fullTensorPerm
Open

feat: Introduce full tensor permeability#2822
CusiniM wants to merge 16 commits into
developfrom
feature/cus-cas/fullTensorPerm

Conversation

@CusiniM

@CusiniM CusiniM commented Nov 15, 2023

Copy link
Copy Markdown
Collaborator

@castelletto1 should be usable but I have not tested it yet.

Comment thread src/coreComponents/finiteVolume/BoundaryStencil.hpp Outdated
Comment thread src/coreComponents/constitutive/permeability/ConstantPermeability.cpp Outdated
@castelletto1

castelletto1 commented Nov 27, 2023

Copy link
Copy Markdown
Collaborator

I confirm it works. I ran an incompressible single-phase flow quarter five spot problem without gravity on two domains. The first case, the domain is aligned with the Cartesian axes and the permeability tensor is diagonal. In the second case, the domain is obtained by rotating the aligned domain and consistently updating the permeability tensor, which becomes full tensor. In both cases the grid is K-orthogonal and TPFA is correct. The computed Jacobian matrices are the same. Below two snapshots with details for the same cell (Id 52) in both domains.

aligned

rotated

I temporarily added xml and vtk files to reproduce the results in ./inputFiles/singlePhaseFlow/fullTensorPermeability
We may end up adding a new smoke test.

@karimifard, @jafranc, @francoishamon: have a look and share if you think this is headed in the correct direction.

@jafranc jafranc added the spe11 spe11-required-feature label Nov 28, 2023
m_permeability[ei][q][1] = m_permeabilityComponents[1];
m_permeability[ei][q][2] = m_permeabilityComponents[2];
for ( int c=0; c < 6; c++)
m_permeability[ei][q][c] = m_symmetricFullPermeabilityTensor[c];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't we enforce positiveness of diagonal component here ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We should really throw an error earlier if someone inputs a negative value but, for now, I am using the default negative value to distinguish whether a diagonal or a full tensor was provided so I need to improve that logic fist.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

One option would be to simply provide 2 R1Tensors one for the main diagonal and one for the off diagonal terms and have the off diagonal components default to 0.0 if not provided.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just noticed that the order would be imposed by LvArray::Ri_eq_symAijBj implicitly :/

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

yes, and it's different from the one used by vtk.

LvArray::tensorOps::Ri_eq_symAijBj< 3 >( faceConormal, coef, faceNormal );
weight = LvArray::tensorOps::AiBi< 3 >( cellToFace, faceConormal );
// Matteo: this one also has to change!
LvArray::tensorOps::hadamardProduct< 3 >( dWeight_dCoef, cellToFace, faceNormal );

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am not sure about how this one should change.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

#2822 (comment)

This should be addressed first

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@castelletto1 do you know how it should be changed?

@jafranc

jafranc commented Nov 28, 2023

Copy link
Copy Markdown
Contributor

I confirm it works. I ran an incompressible single-phase flow quarter five spot problem without gravity on two domains. The first case, the domain is aligned with the Cartesian axes and the permeability tensor is diagonal. In the second case, the domain is obtained by rotating the aligned domain and consistently updating the permeability tensor, which becomes full tensor. In both cases the grid is K-orthogonal and TPFA is correct. The computed Jacobian matrices are the same. Below two snapshots with details for the same cell (Id 52) in both domains.

aligned

rotated

I temporarily added xml and vtk files to reproduce the results in ./inputFiles/singlePhaseFlow/fullTensorPermeability We may end up adding a new smoke test.

@karimifard, @jafranc, @francoishamon: have a look and share if you think this is headed in the correct direction.

I let @karimifard and @francoishamon, who are more expert than I am, tell if it is what they had in mind.
It looks like a right start and not adding too much complexity. There will be some bookkeeping traps along the road though and I like @CusiniM 's idea to have one tensor for the diag and one for off-diag so the full tensor case is use as the base and off-diag zeroed out by default.

CusiniM and others added 3 commits March 13, 2024 10:16
@CusiniM CusiniM changed the title Introduce full tensor permeability feat: Introduce full tensor permeability Jul 8, 2024
@paveltomin paveltomin added the ci: run integrated tests Allows to run the integrated tests in GEOS CI label Aug 8, 2025
@paveltomin
paveltomin removed the request for review from ryar9534 August 8, 2025 19:55
@paveltomin

paveltomin commented Aug 8, 2025

Copy link
Copy Markdown
Collaborator

@castelletto1 can we just merge this?

@rrsettgast

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Copilot AI requested review from OmarDuran and bd713 as code owners July 20, 2026 23:42

Copilot AI commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved. I merged develop into this branch and fixed the conflicts in src/coreComponents/constitutive/permeability/CarmanKozenyPermeability.cpp and src/coreComponents/constitutive/permeability/ConstantPermeability.hpp in commit 13ceacd.

@rrsettgast rrsettgast added the ci: run CUDA builds Allows to triggers (costly) CUDA jobs label Jul 21, 2026
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 ci: run integrated tests Allows to run the integrated tests in GEOS CI spe11 spe11-required-feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants