Draft
Conversation
Comment on lines
+161
to
+167
| for( localIndex i = 0; i < NF; ++i ) | ||
| { | ||
| for( localIndex j = 0; j < NF; ++j ) | ||
| { | ||
| M[i][j] = 0.0; | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
Suggested change
| for( localIndex i = 0; i < NF; ++i ) | |
| { | |
| for( localIndex j = 0; j < NF; ++j ) | |
| { | |
| M[i][j] = 0.0; | |
| } | |
| } | |
| LvArray::tensorOps::fill< NF, NF >( M, 0.0 ); |
Comment on lines
+280
to
+323
| // 4) U = I - Q Q^T | ||
| real64 U[ NF ][ NF ] = {{0}}; | ||
| LvArray::tensorOps::addIdentity< NF >( U, -1.0 ); | ||
| LvArray::tensorOps::Rij_add_AikAjk< NF, 3 >( U, Qmat ); | ||
| LvArray::tensorOps::scale< NF, NF >( U, -1.0 ); | ||
|
|
||
| // 5) A^{-1} * U * A^{-1} | ||
| real64 invA[ NF ]; | ||
| for( localIndex i = 0; i < NF; ++i ) | ||
| { | ||
| invA[i] = 1.0 / A[i]; | ||
| } | ||
|
|
||
| // temp = A^{-1} * U | ||
| real64 temp[ NF ][ NF ]; | ||
| for( localIndex i = 0; i < NF; ++i ) | ||
| { | ||
| for( localIndex j = 0; j < NF; ++j ) | ||
| { | ||
| temp[i][j] = invA[i] * U[i][j]; | ||
| } | ||
| } | ||
|
|
||
| // Usc = A^{-1} * U * A^{-1} | ||
| real64 Usc[ NF ][ NF ]; | ||
| for( localIndex i = 0; i < NF; ++i ) | ||
| { | ||
| for( localIndex j = 0; j < NF; ++j ) | ||
| { | ||
| Usc[i][j] = temp[i][j] * invA[j]; | ||
| } | ||
| } | ||
|
|
||
| // 6) M = CKCt + (v / t) * Usc | ||
| real64 tParam = 2.0 * ( elemPerm[0] + elemPerm[1] + elemPerm[2] ); | ||
| real64 scale = elemVolume / tParam; | ||
|
|
||
| for( localIndex i = 0; i < NF; ++i ) | ||
| { | ||
| for( localIndex j = 0; j < NF; ++j ) | ||
| { | ||
| M[i][j] = CKCt[i][j] + scale * Usc[i][j]; | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
Suggested change
| // 4) U = I - Q Q^T | |
| real64 U[ NF ][ NF ] = {{0}}; | |
| LvArray::tensorOps::addIdentity< NF >( U, -1.0 ); | |
| LvArray::tensorOps::Rij_add_AikAjk< NF, 3 >( U, Qmat ); | |
| LvArray::tensorOps::scale< NF, NF >( U, -1.0 ); | |
| // 5) A^{-1} * U * A^{-1} | |
| real64 invA[ NF ]; | |
| for( localIndex i = 0; i < NF; ++i ) | |
| { | |
| invA[i] = 1.0 / A[i]; | |
| } | |
| // temp = A^{-1} * U | |
| real64 temp[ NF ][ NF ]; | |
| for( localIndex i = 0; i < NF; ++i ) | |
| { | |
| for( localIndex j = 0; j < NF; ++j ) | |
| { | |
| temp[i][j] = invA[i] * U[i][j]; | |
| } | |
| } | |
| // Usc = A^{-1} * U * A^{-1} | |
| real64 Usc[ NF ][ NF ]; | |
| for( localIndex i = 0; i < NF; ++i ) | |
| { | |
| for( localIndex j = 0; j < NF; ++j ) | |
| { | |
| Usc[i][j] = temp[i][j] * invA[j]; | |
| } | |
| } | |
| // 6) M = CKCt + (v / t) * Usc | |
| real64 tParam = 2.0 * ( elemPerm[0] + elemPerm[1] + elemPerm[2] ); | |
| real64 scale = elemVolume / tParam; | |
| for( localIndex i = 0; i < NF; ++i ) | |
| { | |
| for( localIndex j = 0; j < NF; ++j ) | |
| { | |
| M[i][j] = CKCt[i][j] + scale * Usc[i][j]; | |
| } | |
| } | |
| // 4) M = CKCt + (v / t) * A^{-1} * ( I - Q Q^T ) * A^{-1} | |
| real64 invA[NF]; | |
| for (localIndex i = 0; i < NF; ++i) | |
| { | |
| invA[i] = real64(1) / A[i]; | |
| } | |
| // scale = elemVolume / tParam, where tParam = 2 * trace(K) | |
| real64 const tParam = real64(2) * (elemPerm[0] + elemPerm[1] + elemPerm[2]); | |
| real64 const scale = elemVolume / tParam; | |
| for (localIndex i = 0; i < NF; ++i) | |
| { | |
| real64 const invAiScaled = scale * invA[i]; | |
| real64 const qi0 = Qmat[i][0]; | |
| real64 const qi1 = Qmat[i][1]; | |
| real64 const qi2 = Qmat[i][2]; | |
| for (localIndex j = i; j < NF; ++j) | |
| { | |
| // qdot = (Q Q^T)_{ij} = sum_k Qik * Qjk, with k in [0,2] | |
| real64 const qdot = qi0*Qmat[j][0] + qi1*Qmat[j][1] + qi2*Qmat[j][2]; | |
| real64 const u = (i == j ? real64(1) : real64(0)) - qdot; | |
| real64 const mij = CKCt[i][j] + (invAiScaled * invA[j]) * u; | |
| M[i][j] = mij; | |
| M[j][i] = mij; // symmetry fill | |
| } | |
| } |
|
|
||
| for( localIndex i = 0; i < NF; ++i ) | ||
| { | ||
| real64 fCenter[3], fNormal[3]; |
Contributor
There was a problem hiding this comment.
Let's use a consistent nomenclature across inner products, e.g.:
fCentervsfaceCenterfNormalvsfaceNormalvec_cfvscellToFaceVector- ...
Let's keep in mind when refactoring nomenclature, that kernels will eventually be used also for flow within surfaces (faults, fractures). Cell seems appropriate. Instead of faces (or edges), we should probably use the term facets.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.