Add corrected and limitedCorrected faceNormalGradient schemes#477
Draft
HendriceH wants to merge 2 commits into
Draft
Add corrected and limitedCorrected faceNormalGradient schemes#477HendriceH wants to merge 2 commits into
HendriceH wants to merge 2 commits into
Conversation
|
Thank you for your PR, here are some useful tips:
|
Implement non-orthogonality correction for surface normal gradients: - Rename updateNonOrthDeltaCoeffs(Vec3) to updateNonOrthCorrectionVec3s in GeometrySchemeFactory and BasicGeometryScheme to match its actual purpose, and implement the correction vector computation: corrVec[f] = n̂ - delta * nonOrthDeltaCoeff - Add corrected scheme: snGrad = nonOrthDeltaCoeff*(phi_N - phi_O) + corrVec · (w*grad(phi)_O + (1-w)*grad(phi)_N) - Add limitedCorrected scheme: same as corrected but with a limiter that bounds the correction relative to the orthogonal part. Accepts limitCoeff from TokenList or Dictionary (default 0.333). - Both schemes use a fused single kernel per face group and reuse GaussGreenGrad for cell-centred gradient computation. - Add unit tests on a 1D uniform mesh (orthogonal, corrVec=0) verifying that corrected and limitedCorrected reduce to uncorrected.
Expose hasImplicitCorrection()/implicitCorrection() virtual interface on FaceNormalGradientFactory so corrected and limitedCorrected schemes can contribute a deferred correction term to the implicit Laplacian RHS. - faceNormalGradient.hpp: add default-false hasImplicitCorrection() and default no-op implicitCorrection() virtuals; add forwarders on wrapper - corrected.hpp/cpp: override to return true; add computeCorrectionTerm free function (corrVec · interpGrad per internal face, zero on boundary) - limitedCorrected.hpp/cpp: same; add computeLimitedCorrectionTerm with limiter = min(lc*|ortho| / ((1-lc)*|corr| + ROOTVSMALL), 1) - gaussGreenLaplacian.cpp: after matrix assembly, call implicitCorrection and accumulate corrFlux = corrTerm * gamma * |Sf| onto RHS owner/neighbour
6f466ff to
bf9d5fa
Compare
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.
Implement non-orthogonality correction for surface normal gradients:
Rename updateNonOrthDeltaCoeffs(Vec3) to updateNonOrthCorrectionVec3s in GeometrySchemeFactory and BasicGeometryScheme to match its actual purpose, and implement the correction vector computation: corrVec[f] = n̂ - delta * nonOrthDeltaCoeff
Add corrected scheme: snGrad = nonOrthDeltaCoeff*(phi_N - phi_O)
Add limitedCorrected scheme: same as corrected but with a limiter that bounds the correction relative to the orthogonal part. Accepts limitCoeff from TokenList or Dictionary (default 0.333).
Both schemes use a fused single kernel per face group and reuse GaussGreenGrad for cell-centred gradient computation.
Add unit tests on a 1D uniform mesh (orthogonal, corrVec=0) verifying that corrected and limitedCorrected reduce to uncorrected.