mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: surface writer for surfaceNoise was not Time-aware
- the updated surface writers must be explicitly tagged as being Time-aware (useTimeDir) to have them splice Time (in this case freq) into the output path. The older writers worked in the opposite way. They extracted a time value from the naming of the output directory (which was fragile).
This commit is contained in:
committed by
Andrew Heather
parent
a2906d4302
commit
255e47356c
@ -235,7 +235,7 @@ Foam::scalar surfaceNoise::writeSurfaceData
|
||||
{
|
||||
Info<< " processing " << title << " for frequency " << freq << endl;
|
||||
|
||||
const fileName outDir(outDirBase/Foam::name(freq));
|
||||
const instant freqInst(freq, Foam::name(freq));
|
||||
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
@ -277,16 +277,20 @@ Foam::scalar surfaceNoise::writeSurfaceData
|
||||
|
||||
if (writeSurface)
|
||||
{
|
||||
// Time-aware, with time spliced into the output path
|
||||
writerPtr_->beginTime(freqInst);
|
||||
|
||||
writerPtr_->open
|
||||
(
|
||||
surf.points(),
|
||||
surf.surfFaces(),
|
||||
(outDir / fName),
|
||||
(outDirBase / fName),
|
||||
false // serial - already merged
|
||||
);
|
||||
|
||||
writerPtr_->write(title, allData);
|
||||
|
||||
writerPtr_->endTime();
|
||||
writerPtr_->clear();
|
||||
}
|
||||
|
||||
@ -304,16 +308,20 @@ Foam::scalar surfaceNoise::writeSurfaceData
|
||||
|
||||
if (writeSurface)
|
||||
{
|
||||
// Time-aware, with time spliced into the output path
|
||||
writerPtr_->beginTime(freqInst);
|
||||
|
||||
writerPtr_->open
|
||||
(
|
||||
surf.points(),
|
||||
surf.surfFaces(),
|
||||
(outDir / fName),
|
||||
(outDirBase / fName),
|
||||
false // serial - already merged
|
||||
);
|
||||
|
||||
writerPtr_->write(title, data);
|
||||
|
||||
writerPtr_->endTime();
|
||||
writerPtr_->clear();
|
||||
}
|
||||
|
||||
@ -442,6 +450,9 @@ bool surfaceNoise::read(const dictionary& dict)
|
||||
dict.subOrEmptyDict("writeOptions").subOrEmptyDict(writerType)
|
||||
);
|
||||
|
||||
// Use outputDir/TIME/surface-name
|
||||
writerPtr_->useTimeDir() = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user