diff --git a/applications/solvers/interFSFFoam/UEqn.H b/applications/solvers/interFSFFoam/UEqn.H index 8d2e26f..73c525b 100644 --- a/applications/solvers/interFSFFoam/UEqn.H +++ b/applications/solvers/interFSFFoam/UEqn.H @@ -25,7 +25,7 @@ ( - ghf*fvc::snGrad(rho) - fvc::snGrad(p_rgh) - - fvc::snGrad(pc) + + fvc::snGrad(pc) ) * mesh.magSf() + phic ) diff --git a/applications/solvers/interFSFFoam/pEqn.H b/applications/solvers/interFSFFoam/pEqn.H index 99df68d..041172b 100644 --- a/applications/solvers/interFSFFoam/pEqn.H +++ b/applications/solvers/interFSFFoam/pEqn.H @@ -28,7 +28,7 @@ surfaceScalarField phig ( phic*rAUf - - fvc::snGrad(pc)*rAUf*mesh.magSf() + + fvc::snGrad(pc)*rAUf*mesh.magSf() - ghf*fvc::snGrad(rho)*rAUf*mesh.magSf() ); @@ -76,7 +76,7 @@ // Make the fluxes relative to the mesh motion fvc::makeRelative(phi, U); - p == p_rgh + rho*gh + pc; + p == p_rgh + rho*gh - pc; if (p_rgh.needReference()) { @@ -87,7 +87,7 @@ pressureReference.refValue() - getRefCellValue(p, pressureReference.refCell()) ); - p_rgh = p - rho*gh - pc; + p_rgh = p - rho*gh + pc; } if (!correctPhi) diff --git a/applications/solvers/interFSFFoam/pcEqn.H b/applications/solvers/interFSFFoam/pcEqn.H index e9a5451..6fd0733 100644 --- a/applications/solvers/interFSFFoam/pcEqn.H +++ b/applications/solvers/interFSFFoam/pcEqn.H @@ -68,35 +68,35 @@ while (pimple.correctNonOrthogonal()) 1.0 ); // phic = pcEqn.flux(); - phic = fcf*mesh.magSf(); - phicFilt = - pos(phic)*mag(phic - fvc::snGrad(pc)*mesh.magSf()) - - (1.0 - pos(phic))*mag(phic - fvc::snGrad(pc)*mesh.magSf()); + phic = (fcf - fvc::snGrad(pc))*mesh.magSf(); +// phicFilt = +// pos(phic)*mag(phic) +// - (1.0 - pos(phic))*mag(phic); // phic = mag(deltaf)/(mag(deltaf) + mixture.deltaN())*fvc::snGrad(pc)*mesh.magSf(); // phic = fvc::snGrad(pc)*mesh.magSf(); -// const dimensionedScalar phicAvg -// ( -// dimensionSet(dimForce/dimLength), -// // average(mag(fcf))/(average(pos(mag(fcf))) + SMALL) -// // average(mag(fcf)) -// cPhicThresholdCoeff*gSum(mag(phic.field())) -// /gSum(SMALL + pos(mag(phic.field()) - SMALL)) -// ); -// -// Info<< "phicAvg = " << phicAvg.value() << nl; - -// phic -= -// max -// ( -// min -// ( -// phic, -// phicAvg -// ), -// - phicAvg -// ); - - phic -= cPhicThresholdCoeff*phicFilt; + const dimensionedScalar phicAvg + ( + dimensionSet(dimForce/dimLength), +// average(mag(fcf))/(average(pos(mag(fcf))) + SMALL) +// average(mag(fcf)) + cPhicThresholdCoeff*gSum(mag(fcf.field()*mesh.magSf())) + /gSum(SMALL + pos(mag(fcf.field()) - SMALL)) + ); + + Info<< "phicAvg = " << phicAvg.value() << nl; + + phic -= + max + ( + min + ( + phic, + phicAvg + ), + - phicAvg + ); + +// phic -= cPhicThresholdCoeff*phicFilt; } } diff --git a/tests/dropletRelaxation2D/src/system/blockMeshDict b/tests/dropletRelaxation2D/src/system/blockMeshDict index 491e8eb..66adab5 100644 --- a/tests/dropletRelaxation2D/src/system/blockMeshDict +++ b/tests/dropletRelaxation2D/src/system/blockMeshDict @@ -20,8 +20,8 @@ boxWidth 10.0; boxHeight 10.0; boxDepth 1.0; -Nx 40; -Ny 40; +Nx 80; +Ny 80; Nz 1; box0Nx $Nx; diff --git a/tests/dropletRelaxation2D/src/system/fvSchemes b/tests/dropletRelaxation2D/src/system/fvSchemes index 479f6ac..e9f518f 100644 --- a/tests/dropletRelaxation2D/src/system/fvSchemes +++ b/tests/dropletRelaxation2D/src/system/fvSchemes @@ -26,8 +26,8 @@ gradSchemes divSchemes { - div(rhoPhi,U) Gauss linearUpwind grad(U); -// div(rhoPhi,U) Gauss vanLeerV; +// div(rhoPhi,U) Gauss linearUpwind grad(U); + div(rhoPhi,U) Gauss vanLeerV; div(phi,alpha) Gauss interfaceCompression vanLeer 1; // div(phi,alpha) Gauss PLICU interfaceCompression vanLeer 1; // div(phi,alpha) Gauss MPLIC; diff --git a/tests/dropletRelaxation2D/src/system/fvSolution b/tests/dropletRelaxation2D/src/system/fvSolution index ec41dfa..fdd6a47 100644 --- a/tests/dropletRelaxation2D/src/system/fvSolution +++ b/tests/dropletRelaxation2D/src/system/fvSolution @@ -35,7 +35,7 @@ solvers cShCoeff 0.98; nKappaSmoothers 2; // cPhicFilterCoeff 0.1; - cPhicThresholdCoeff 0.01; + cPhicThresholdCoeff 0.05; } ".*(rho|rhoFinal)" @@ -112,7 +112,7 @@ PIMPLE { momentumPredictor no; nOuterCorrectors 2; - nCorrectors 2; + nCorrectors 5; nNonOrthogonalCorrectors 0; pRefCell 0; @@ -159,7 +159,7 @@ relaxationFactors // phicFinal 1; // fcf 0.7; // fcfFinal 1; - fcfFilt 0.5; + fcfFilt 0.7; fcfFiltFinal 1; } equations