ENH: checkMesh: do not create wallDist unless in fvSchemes. See #71

This commit is contained in:
mattijs
2019-09-19 14:37:38 +01:00
committed by Andrew Heather
parent 88c1626b5b
commit 61dfa9b544

View File

@ -502,16 +502,25 @@ void Foam::writeFields
if (selectedFields.found("wallDistance")) if (selectedFields.found("wallDistance"))
{ {
// Wall distance // See if wallDist.method entry in fvSchemes before calling factory
//const volScalarField& y = wallDist::New(mesh).y(); // method of wallDist. Have 'failing' version of wallDist::New instead?
volScalarField y("wallDistance", wallDist::New(mesh).y()); const dictionary& schemesDict =
Info<< " Writing wall distance to " << y.name() << endl; static_cast<const fvSchemes&>(mesh).schemesDict();
y.write(); if (schemesDict.found("wallDist"))
{
if (schemesDict.subDict("wallDist").found("method"))
{
// Wall distance
volScalarField y("wallDistance", wallDist::New(mesh).y());
Info<< " Writing wall distance to " << y.name() << endl;
y.write();
// Wall-reflection vectors // Wall-reflection vectors
//const volVectorField& n = wallDist::New(mesh).n(); //const volVectorField& n = wallDist::New(mesh).n();
//Info<< " Writing wall normal to " << n.name() << endl; //Info<< " Writing wall normal to " << n.name() << endl;
//n.write(); //n.write();
}
}
} }
Info<< endl; Info<< endl;