retain backward compatibility with OF4

This commit is contained in:
danielque
2020-08-06 20:02:56 +02:00
parent 3b29d96c05
commit a83d0290c9
3 changed files with 6 additions and 2 deletions

View File

@ -54,7 +54,11 @@ FinesFields::FinesFields
velFieldName_(propsDict_.lookupOrDefault<word>("velFieldName","U")),
U_(sm.mesh().lookupObject<volVectorField> (velFieldName_)),
voidfractionFieldName_(propsDict_.lookupOrDefault<word>("voidfractionFieldName","voidfraction")),
#if OPENFOAM_VERSION_MAJOR < 5
voidfraction_(const_cast<volScalarField&>(sm.mesh().lookupObject<volScalarField>(voidfractionFieldName_))),
#else
voidfraction_(sm.mesh().lookupObjectRef<volScalarField> (voidfractionFieldName_)),
#endif
UsFieldName_(propsDict_.lookupOrDefault<word>("granVelFieldName","Us")),
UsField_(sm.mesh().lookupObject<volVectorField> (UsFieldName_)),
pFieldName_(propsDict_.lookupOrDefault<word>("pFieldName","p")),

View File

@ -102,7 +102,7 @@ particleCellVolume::particleCellVolume
if(writeToFile_)
{
fileName path(particleCloud_.IOM().createTimeDir("postProcessing/particleCellVolume"));
filePtr_ = new OFstream(path/"particleCellVolume.txt");
filePtr_.set(new OFstream(path/"particleCellVolume.txt"));
filePtr_() << "# time | total particle volume in cells | total volume of cells with particles | average volume fraction | min(voidfraction) | max(voidfraction)" << endl;
}
}

View File

@ -131,7 +131,7 @@ volWeightedAverage::volWeightedAverage
if(writeToFile_)
{
fileName path(particleCloud_.IOM().createTimeDir("postProcessing/volWeightedAverage"));
filePtr_ = new OFstream(path/"volWeightedAverage.txt");
filePtr_.set(new OFstream(path/"volWeightedAverage.txt"));
}
}