Repository navigation
Write and read CrankNicolson's restart state - #109
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.
A pimpleFoam restart under CrankNicolson continues the run as OpenFOAM's does. brae now writes and reads the old levels and CrankNicolson's ddtCorr fields, and OpenFOAM can now restart from brae's CrankNicolson write at all. Follows #108.
OpenFOAM:
fvmDdtasks for every field's old-old level unconditionally, soU_0,k_0andepsilon_0are written from the first step (GeometricField.C:923-940).phi_0is written from the step after ddtCorr creates phi's old-old level.ddtCorrDdt0(U)andddtCorrDdt0(phi)are AUTO_WRITE from their creation.startTimeIndex_-2, so both coefficients are 1 + ocCoeff at once, and it is evaluated on the first restarted step from the old levels read (CrankNicolsonDdtScheme.C:48-61, 102-165).brae before:
ddt0(k)andddt0(epsilon)were written dimensionless ("Different dimensions for '(a - b)'").writeVolFieldRawtook boundary values and ignored them, writing every calculated patch asuniform 0.Change:
ddt0(...)files carry their field's dimensions over time.U_0,k_0,epsilon_0/omega_0/nuTilda_0,phi_0(from the step OpenFOAM starts writing it) andddtCorrDdt0(U|phi)with their patch values.ddt0(U)seeds the old levels as Write and read backward's old levels across restarts #105 does for backward (renamedsetOldLevelsRestart). Withoutddt0(U), OpenFOAM's restart is a cold CrankNicolson start, and so is brae's.ddtCorrDdt0(U|phi)are read as a pair, with start index -2. phi's old-old level counts as existing whenphi_0was read.deltaTSave_, as for backward.writeVolFieldRawwrites the boundary values it is given.o - oobefore scaling, as OpenFOAM does; scaling first left 3e-17 where OpenFOAM writes 0.BRAE_CONTROL_CN_NO_CORR_RESTART=1: the ddtCorr fields are neither written nor read;BRAE_CONTROL_BACKWARD_NO_OLD_READ=1(now either scheme): the old levels are not seeded.Gate:
tests/pimple_cranknicolson_vs_openfoam.shgains restart arms for C9 (CrankNicolson 0.9), restarting from the third step and judged within the gate's 1e-8:ecaa29ed)ddt0(U|k)1.6e-11ddt0(epsilon)is held off the 472 cells next to an epsilonWallFunction patch (1.5e-12). At those cells it is 1.8e-02, which is reported: OpenFOAM's first-stepepsilon_0is the copyoldTime()makes after the wall function has set those cells, and the epsilon equation replaces their rows with the wall function's values.Regressions (one GH200; this branch against develop
ecaa29ed, built and run on the same node, one tree at a time):setOldLevelsRestartincluded), plus the registration and audit tests.Not covered:
ddt0's patch values as zero. OpenFOAM'sfvmDdtreads only the internal field.ddt0(epsilon)andddt0(omega)differ, as above.ddtCorrDdt0files.No tolerance was changed.