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: Introduce full tensor permeability #2822

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

Conversation

CusiniM
Copy link
Collaborator

@CusiniM CusiniM commented Nov 15, 2023

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

void ConstantPermeability::postProcessInput()
{
GEOS_ERROR_IF( m_diagonalPermeabilityTensor[0] < 0.0 && m_symmetricFullPermeabilityTensor[0] < 0.0,
"Either a diagonal permeability tensor or a full tensor must be provided.");
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
"Either a diagonal permeability tensor or a full tensor must be provided.");
"Either a diagonal permeability tensor or a symmetric full tensor must be provided.");

@castelletto1
Copy link
Contributor

castelletto1 commented Nov 27, 2023

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
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
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
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
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
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.

weight = LvArray::tensorOps::AiBi< 3 >( cellToFace, faceConormal );
// Matteo: this one also has to change!
LvArray::tensorOps::hadamardProduct< 3 >( dWeight_dCoef, cellToFace, faceNormal );
Copy link
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.

@jafranc
Copy link
Contributor

jafranc commented Nov 28, 2023

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spe11 spe11-required-feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants