Repository navigation
Update simpleFoam's boundaries at OpenFOAM's points - #111
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.
simpleFoam's steady step now updates its boundaries where OpenFOAM's simpleFoam does, as pimpleFoam's step already did. It also relaxes totalPressure's patch value with p, and takes the first pressure pass's non-orthogonal gradient after that update.
OpenFOAM: each boundary condition updates in the constructor or evaluate of its own field's equation (
fvMatrix.C:396,fvPatchField.C:336-344). simpleFoam's order (simpleFoam.C:112-117) is pimpleFoam's with one outer and one inner corrector:pEqn.H), from U's patch values and the flux as they stand;turbulence->correct(), from U's and k's patch values;p.relax()blends p's patch values with prevIter as well as its cells (GeometricField::relax). A totalPressure face then holds the relaxed value until the next pressure assembly sets it again, andU = HbyA - rAtU*grad(p)and the next momentum assembly read it;fvc::grad(p)insidefvm::laplacian, after that constructor'supdateCoeffs. totalPressure'supdateCoeffswrites its face value at once (operator==).brae before: the steady step made every one of those updates at the momentum assembly, from the flux the iteration started with, and the turbulent inlets from U's refValue. totalPressure's value was written unrelaxed.
Change (one fix per commit):
step()takes pimpleStep's update points throughenterOpenFoamUpdatePoints(); the flagpimpleUpdatePoints_is renamedofUpdatePoints_.rhoSimpleStepkeeps its points: nothing there is witnessed yet. ControlBRAE_CONTROL_STEADY_UPDATE_POINTS_LEGACY=1.deviceRelaxTotalPressure), with prevIter stored where freestream's is. ControlBRAE_CONTROL_TOTAL_PRESSURE_UNRELAXED=1.grad(p)again once totalPressure has been updated, instead of reusing the momentum predictor's, which read the stored values. This also reaches pimpleFoam on a non-orthogonal mesh with totalPressure. ControlBRAE_CONTROL_PASS0_GRAD_BEFORE_TOTAL_PRESSURE=1.Gate: new
tests/simple_update_points_vs_openfoam.sh(label slow).e4c67534)p.relax()leaves 0.7 × −0.231)dumpSimpleFoamagainst brae's stage dumps put HbyA and phiHbyA at 1.6e-15 and the pressure system's coefficients at 1.7e-16, with the solved p 1.5e-08 off. The iteration was exact once the two outlet faces' stored values (relaxed leftovers on faces that had turned to outflow) were zeroed. That named the pass-0 gradient.Also measured (not held here):
Regressions (one node, four GH200, against develop
e4c67534, each tree built and run on the same node, one tree at a time):coupledinterfacescheme_vs_openfoam, four manifest-drift checks, three bump2D tutorials, motorBike and two turbulentFlatPlate tutorials). Nothing else is red.ctest_cache_selftestwas also red on the candidate. It fails on develop's own build when rerun (7 of 7 runs; 9 of 10 on the candidates). Itsdata_changedarm rewrites a file at the same size straight after atouch, and the cache's (size, mtime) check does not see the rewrite on that filesystem. Not touched here.No tolerance was loosened.