ENH: overset: additional debug. See #810.

This commit is contained in:
mattijs
2018-08-27 09:19:35 +01:00
parent be96876a18
commit 168b246873
2 changed files with 75 additions and 22 deletions

View File

@ -53,7 +53,6 @@ mesh.setFluxRequired(p.name());
suppressDict.add("cellMask", true); suppressDict.add("cellMask", true);
suppressDict.add("cellDisplacement", true); suppressDict.add("cellDisplacement", true);
suppressDict.add("interpolatedCells", true); suppressDict.add("interpolatedCells", true);
suppressDict.add("cellInterpolationWeight", true);
} }
const_cast<dictionary&> const_cast<dictionary&>

View File

@ -1642,6 +1642,7 @@ Foam::cellCellStencils::inverseDistance::inverseDistance
// Protect local fields from interpolation // Protect local fields from interpolation
nonInterpolatedFields_.insert("cellInterpolationWeight"); nonInterpolatedFields_.insert("cellInterpolationWeight");
nonInterpolatedFields_.insert("cellTypes"); nonInterpolatedFields_.insert("cellTypes");
nonInterpolatedFields_.insert("maxMagWeight");
// Read zoneID // Read zoneID
this->zoneID(); this->zoneID();
@ -2066,6 +2067,9 @@ bool Foam::cellCellStencils::inverseDistance::update()
if (debug&2) if (debug&2)
{ {
// Dump mesh
mesh_.time().write();
// Dump stencil // Dump stencil
mkDir(mesh_.time().timePath()); mkDir(mesh_.time().timePath());
OBJstream str(mesh_.time().timePath()/"injectionStencil.obj"); OBJstream str(mesh_.time().timePath()/"injectionStencil.obj");
@ -2100,7 +2104,54 @@ bool Foam::cellCellStencils::inverseDistance::update()
cellInterpolationWeight_.instance() = mesh_.time().timeName(); cellInterpolationWeight_.instance() = mesh_.time().timeName();
cellInterpolationWeight_.write(); cellInterpolationWeight_.write();
// Dump max weight
{
volScalarField maxMagWeight
(
IOobject
(
"maxMagWeight",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh_,
dimensionedScalar(dimless, Zero),
zeroGradientFvPatchScalarField::typeName
);
forAll(cellStencil_, celli)
{
const scalarList& wghts = cellInterpolationWeights_[celli];
forAll(wghts, i)
{
if (mag(wghts[i]) > mag(maxMagWeight[celli]))
{
maxMagWeight[celli] = wghts[i];
}
}
if (mag(maxMagWeight[celli]) > 1)
{
const pointField& cc = mesh_.cellCentres();
Pout<< "cell:" << celli
<< " at:" << cc[celli]
<< " zone:" << zoneID[celli]
<< " donors:" << cellStencil_[celli]
<< " weights:" << wghts
<< " coords:"
<< UIndirectList<point>(cc, cellStencil_[celli])
<< " donorZone:"
<< UIndirectList<label>(zoneID, cellStencil_[celli])
<< endl;
}
}
maxMagWeight.correctBoundaryConditions();
maxMagWeight.write();
}
// Dump cell types // Dump cell types
{
volScalarField volTypes volScalarField volTypes
( (
IOobject IOobject
@ -2123,6 +2174,9 @@ bool Foam::cellCellStencils::inverseDistance::update()
} }
volTypes.correctBoundaryConditions(); volTypes.correctBoundaryConditions();
volTypes.write(); volTypes.write();
}
// Dump stencil // Dump stencil
mkDir(mesh_.time().timePath()); mkDir(mesh_.time().timePath());