Repository navigation
Rewrite level-set coupling; fix rhoPhi, curvature and patch bugs - #2
Merged
Merged
Conversation
… viscosity and patch bugs
Closed
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.
Rewrites the level-set side of the solver as one class and fixes the
coupling bugs found along the way. Closes #1.
Structure
levelSetCoupledMixtureclass (src/levelSetCoupledMixture). Itderives from
immiscibleIncompressibleTwoPhaseMixtureand owns the signeddistance, Heaviside and curvature fields, the redistance step, and the
property blending. It replaces
mappingPsi.H,solveLsFunction.H,calcNewCurvature.Hand theconst_castonmixture.nu().constant/levelSetPropertiesis gone. The settings move to an optionallevelSet { ... }sub-dictionary oftransportProperties, and every entryhas a default.
nuandsigmaare no longer duplicated.cellSizeis given.psifield is no longer read, so0/psiis not needed. Written fieldsare now
levelSet[m],heavisideandlevelSetCurvature.correctPhi.His renamed tocorrectMeshPhi.H. On macOS'scase-insensitive filesystem, a local
correctPhi.Hshadows OpenFOAM'sCorrectPhi.H.rebuilt at the start of every time step, which repeated the same work.
Fixes
rhocame from the Heaviside, butrhoPhiwas still the VOF mass flux.rhoPhiis now built from the sameHeaviside face density, and
UEqnremoves the residualddt(rho) + div(rhoPhi).UEqnandpEqncalledmixture.surfaceTensionForce(), which uses the VOF curvature, and theCfield was only written out. They now use
sigma*kappa_LS*snGrad(H)(curvatureFrom levelSet, the default).nu = H nu1 + (1-H) nu2withrho = H rho1 + (1-H) rho2, sorho*nuwas not the blendedmu. It nowblends
muand divides by the blendedrho.Handdeltawere never set. The cell loops leftthem at 0 on every patch, so walls and processor patches saw
rho = rho2.That made
snGrad(rho)andpwrong at walls and broke parallel runs.The Heaviside is now evaluated on the whole field.
psi0/mag(psi0)gave NaN in any cell withalpha = 0.5exactly. It nowgives a sign of 0 there.
(GPL-3.0). This adds
LICENSE(GPL-3.0) and keeps the OpenFOAM copyrightlines.
Tutorial and CI
(centre of mass and rise velocity, every step), and drops the stale
psi,alpha.water.organdlevelSetProperties.Verification
Hysing et al. (2009) test case 2 on a 1/h = 80 mesh, run with v2606. The
reference is TP2D (Table XIII).
main(before)volumeFractionmain, the bubble does not conserve mass. About 60% of the airdissolves (min alpha.water ends at 0.11) and spurious currents reach
Co = 3.
so it comes from the resolution and schemes, not from the coupling.
cAlphais now 1. WithcAlpha 0the late-time rise islow: yc(3) = 1.092.
UEqnchanges yc by less than 0.002.Vmax2 0.2299 (1.985) and yc(3) 1.1099. TP2D at 1/h = 160 gives 0.2570
(0.743), 0.2522 (2.023) and 1.1377. Mass is conserved. The first peak stays
about 6% low after refinement, so that is still open.
v2512.