Skip to content
Snippets Groups Projects
Commit ebdb2278 authored by sergio's avatar sergio
Browse files

ENH: Modifications to overPimpleDyMFoam

parent 3a641275
No related branches found
No related tags found
No related merge requests found
...@@ -39,31 +39,18 @@ mesh.setFluxRequired(p.name()); ...@@ -39,31 +39,18 @@ mesh.setFluxRequired(p.name());
// Add solver-specific interpolations // Add solver-specific interpolations
{ {
dictionary suppressDict; wordHashSet& nonInt =
{ const_cast<wordHashSet&>(Stencil::New(mesh).nonInterpolatedFields());
const wordHashSet& nonInt = Stencil::New(mesh).nonInterpolatedFields();
for (auto fldName : nonInt) nonInt.insert("HbyA");
{ nonInt.insert("grad(p)");
suppressDict.add(fldName, true); nonInt.insert("surfaceIntegrate(phi)");
} nonInt.insert("surfaceIntegrate(phiHbyA)");
suppressDict.add("HbyA", true); nonInt.insert("cellMask");
suppressDict.add("grad(p)", true); nonInt.insert("cellDisplacement");
suppressDict.add("surfaceIntegrate(phi)", true); nonInt.insert("interpolatedCells");
suppressDict.add("surfaceIntegrate(phiHbyA)", true); nonInt.insert("cellInterpolationWeight");
suppressDict.add("cellMask", true);
suppressDict.add("cellDisplacement", true);
suppressDict.add("interpolatedCells", true);
}
const_cast<dictionary&>
(
mesh.schemesDict()
).add
(
"oversetInterpolationSuppressed",
suppressDict,
true
);
} }
// Mask field for zeroing out contributions on hole cells // Mask field for zeroing out contributions on hole cells
......
...@@ -104,8 +104,14 @@ int main(int argc, char *argv[]) ...@@ -104,8 +104,14 @@ int main(int argc, char *argv[])
Uf *= faceMaskOld; Uf *= faceMaskOld;
// Update Uf and phi on new C-I faces // Update Uf and phi on new C-I faces
Uf += (1-faceMaskOld)*fvc::interpolate(U); Uf += (1-faceMaskOld)*fvc::interpolate(U);
phi = mesh.Sf() & Uf; phi = mesh.Sf() & Uf;
// Zero phi on current H-I
surfaceScalarField faceMask
(
localMin<scalar>(mesh).interpolate(cellMask)
);
phi *= faceMask;
} }
......
// Option 1: interpolate rAU, do not block out rAU on blocked cells // Option 1: interpolate rAU, do not block out rAU on blocked cells
volScalarField rAU("rAU", 1.0/UEqn.A()); volScalarField rAU("rAU", 1.0/UEqn.A());
mesh.interpolate(rAU);
// Option 2: do not interpolate rAU but block out rAU // Option 2: do not interpolate rAU but block out rAU
//surfaceScalarField rAUf("rAUf", fvc::interpolate(blockedCells*rAU)); //surfaceScalarField rAUf("rAUf", fvc::interpolate(blockedCells*rAU));
...@@ -23,6 +24,13 @@ if (massFluxInterpolation) ...@@ -23,6 +24,13 @@ if (massFluxInterpolation)
#include "interpolatedFaces.H" #include "interpolatedFaces.H"
} }
if (runTime.outputTime())
{
H.write();
rAU.write();
HbyA.write();
}
if (pimple.nCorrPISO() <= 1) if (pimple.nCorrPISO() <= 1)
{ {
tUEqn.clear(); tUEqn.clear();
...@@ -42,14 +50,13 @@ if (ddtCorr) ...@@ -42,14 +50,13 @@ if (ddtCorr)
MRF.makeRelative(phiHbyA); MRF.makeRelative(phiHbyA);
// WIP // WIP
/*
if (p.needReference()) if (p.needReference())
{ {
fvc::makeRelative(phiHbyA, U); fvc::makeRelative(phiHbyA, U);
adjustPhi(phiHbyA, U, p); adjustPhi(phiHbyA, U, p);
fvc::makeAbsolute(phiHbyA, U); fvc::makeAbsolute(phiHbyA, U);
} }
*/
if (adjustFringe) if (adjustFringe)
{ {
...@@ -85,7 +92,11 @@ p.relax(); ...@@ -85,7 +92,11 @@ p.relax();
volVectorField gradP(fvc::grad(p)); volVectorField gradP(fvc::grad(p));
// Option 2: zero out velocity on blocked out cells // 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(); U.correctBoundaryConditions();
fvOptions.correct(U); fvOptions.correct(U);
...@@ -96,5 +107,12 @@ fvOptions.correct(U); ...@@ -96,5 +107,12 @@ fvOptions.correct(U);
Uf += n*(phi/mesh.magSf() - (n & Uf)); Uf += n*(phi/mesh.magSf() - (n & Uf));
} }
// Make the fluxes relative to the mesh motion // Make the fluxes relative to the mesh motion
fvc::makeRelative(phi, U); fvc::makeRelative(phi, U);
surfaceScalarField faceMask
(
localMin<scalar>(mesh).interpolate(cellMask)
);
phi *= faceMask;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment