Skip to content

Commit

Permalink
FSF solver
Browse files Browse the repository at this point in the history
AlexGubkin committed Oct 20, 2022
1 parent acf9a24 commit e13bb2f
Showing 6 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion applications/solvers/interFSFFoam/UEqn.H
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@
(
- ghf*fvc::snGrad(rho)
- fvc::snGrad(p_rgh)
- fvc::snGrad(pc)
+ fvc::snGrad(pc)
) * mesh.magSf()
+ phic
)
6 changes: 3 additions & 3 deletions applications/solvers/interFSFFoam/pEqn.H
Original file line number Diff line number Diff line change
@@ -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)
54 changes: 27 additions & 27 deletions applications/solvers/interFSFFoam/pcEqn.H
Original file line number Diff line number Diff line change
@@ -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;
}
}
4 changes: 2 additions & 2 deletions tests/dropletRelaxation2D/src/system/blockMeshDict
Original file line number Diff line number Diff line change
@@ -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;
4 changes: 2 additions & 2 deletions tests/dropletRelaxation2D/src/system/fvSchemes
Original file line number Diff line number Diff line change
@@ -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;
6 changes: 3 additions & 3 deletions tests/dropletRelaxation2D/src/system/fvSolution
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e13bb2f

Please sign in to comment.