ENH: Modifications to overPimpleDyMFoam

This commit is contained in:
sergio 2018-10-01 17:05:35 -07:00
parent 3a641275d3
commit ebdb227863
3 changed files with 39 additions and 28 deletions

View File

@ -39,31 +39,18 @@ mesh.setFluxRequired(p.name());
// Add solver-specific interpolations
{
dictionary suppressDict;
{
const wordHashSet& nonInt = Stencil::New(mesh).nonInterpolatedFields();
for (auto fldName : nonInt)
{
suppressDict.add(fldName, true);
}
suppressDict.add("HbyA", true);
suppressDict.add("grad(p)", true);
suppressDict.add("surfaceIntegrate(phi)", true);
suppressDict.add("surfaceIntegrate(phiHbyA)", true);
suppressDict.add("cellMask", true);
suppressDict.add("cellDisplacement", true);
suppressDict.add("interpolatedCells", true);
}
wordHashSet& nonInt =
const_cast<wordHashSet&>(Stencil::New(mesh).nonInterpolatedFields());
nonInt.insert("HbyA");
nonInt.insert("grad(p)");
nonInt.insert("surfaceIntegrate(phi)");
nonInt.insert("surfaceIntegrate(phiHbyA)");
nonInt.insert("cellMask");
nonInt.insert("cellDisplacement");
nonInt.insert("interpolatedCells");
nonInt.insert("cellInterpolationWeight");
const_cast<dictionary&>
(
mesh.schemesDict()
).add
(
"oversetInterpolationSuppressed",
suppressDict,
true
);
}
// Mask field for zeroing out contributions on hole cells

View File

@ -104,8 +104,14 @@ int main(int argc, char *argv[])
Uf *= faceMaskOld;
// Update Uf and phi on new C-I faces
Uf += (1-faceMaskOld)*fvc::interpolate(U);
phi = mesh.Sf() & Uf;
// Zero phi on current H-I
surfaceScalarField faceMask
(
localMin<scalar>(mesh).interpolate(cellMask)
);
phi *= faceMask;
}

View File

@ -1,5 +1,6 @@
// Option 1: interpolate rAU, do not block out rAU on blocked cells
volScalarField rAU("rAU", 1.0/UEqn.A());
mesh.interpolate(rAU);
// Option 2: do not interpolate rAU but block out rAU
//surfaceScalarField rAUf("rAUf", fvc::interpolate(blockedCells*rAU));
@ -23,6 +24,13 @@ if (massFluxInterpolation)
#include "interpolatedFaces.H"
}
if (runTime.outputTime())
{
H.write();
rAU.write();
HbyA.write();
}
if (pimple.nCorrPISO() <= 1)
{
tUEqn.clear();
@ -42,14 +50,13 @@ if (ddtCorr)
MRF.makeRelative(phiHbyA);
// WIP
/*
if (p.needReference())
{
fvc::makeRelative(phiHbyA, U);
adjustPhi(phiHbyA, U, p);
fvc::makeAbsolute(phiHbyA, U);
}
*/
if (adjustFringe)
{
@ -85,7 +92,11 @@ p.relax();
volVectorField gradP(fvc::grad(p));
// Option 2: zero out velocity on blocked out cells
U = HbyA - rAU*cellMask*gradP;
//U = HbyA - rAU*cellMask*gradP;
// Option 3: zero out velocity on blocked out cells
// This is needed for the scalar Eq (k,epsilon, etc)
// which can use U as source term
U = cellMask*(HbyA - rAU*gradP);
U.correctBoundaryConditions();
fvOptions.correct(U);
@ -96,5 +107,12 @@ fvOptions.correct(U);
Uf += n*(phi/mesh.magSf() - (n & Uf));
}
// Make the fluxes relative to the mesh motion
fvc::makeRelative(phi, U);
surfaceScalarField faceMask
(
localMin<scalar>(mesh).interpolate(cellMask)
);
phi *= faceMask;