Repository navigation
Apply CrankNicolson's ddtCorr as OpenFOAM does - #108
Merged
Merged
Conversation
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.
pimpleFoam under CrankNicolson applies OpenFOAM's
fvc::ddtCorr, which brae omitted with a notice.OpenFOAM:
CrankNicolsonDdtScheme::fvcDdtPhiCorr(.C:1262-1320) keeps two DDt0Fields of its own,ddtCorrDdt0(U)andddtCorrDdt0(phi). The correction isddt0_,.C:102-165), and evaluated once a step after that (evaluate,.C:170-180):ddt0 = rDtCoef0*(old - oldOld) - offCentre(ddt0).rDtCoef = coef/deltaTandrDtCoef0 = coef0/deltaT0.coefis1 + ocCoeffafter the start step, andcoef0after the step following it; both are 1 before that (.C:184-226).offCentremultiplies by ocCoeff when ocCoeff is below 1 (.C:249-260).fvmDdtasks for it unconditionally. phi's is created at the first evaluation as a copy ofphi.oldTime(), sodphidt0starts from zero whileddt0does not.brae before: under CrankNicolson the correction was omitted with a notice. On incompressible/pimpleFoam/RAS/pitzDaily from rest at CrankNicolson 0.9, p was 2.3 off OpenFOAM at step 2 and 1.0e+02 by step 5. With ddtCorr off in both codes, the same case agrees to 5e-11 (RAS and laminar), so the whole gap was this term.
Change:
fvcDdtUfCorr) and cyclic or AMI interfaces keep the notice and omit the term.BRAE_CONTROL_CN_NO_DDTCORR=1.Gate: new
tests/pimple_cranknicolson_vs_openfoam.sh(label slow). pitzDaily from rest at a fixed deltaT 1e-4, six steps, every solve tight, ddtCorr on. Every entry of p, U, k, epsilon and nut, and phi, at steps 1-6 within 1e-8:191bc2dc)Regressions (one GH200; this branch against develop
191bc2dc, built and run on the same node, one tree at a time):gpu_ddt_cnincluded), restart, backward and CrankNicolson test, plus the registration and audit tests.Not covered:
ddtCorrDdt0(U),ddtCorrDdt0(phi),U_0andphi_0, which OpenFOAM does.fvcDdtUfCorr, and cyclic or AMI interfaces (notice, term omitted).No tolerance was changed.