mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: surfaceFieldValue - set surface output info for run-time post-processing
If the 'writeFields' option is set in surfaceFieldValue, e.g.
surface1
{
type surfaceFieldValue;
libs (fieldFunctionObjects);
operation none;
fields (p);
regionType patch;
name walls;
// Create a surface in VTK format
writeFields yes;
surfaceFormat vtk;
}
... the surface can now be used in runTimePostProcessing, e.g.:
surfaces
{
surfaceFieldValueOutput
{
type functionObjectSurface;
representation surface;
liveObject no;
field p;
colourBy field;
range (0 120000);
functionObject surface1;
}
}
Note: setting 'liveObject' to 'no' to suppress warnings due to the surface
not being retrieved from the object registry (default = 'yes') - this surface
can [currently] only be read from disk.
This commit is contained in:
@ -397,8 +397,14 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::writeValues
|
|||||||
|
|
||||||
surfaceWriterPtr_->nFields() = 1; // Needed for VTK legacy
|
surfaceWriterPtr_->nFields() = 1; // Needed for VTK legacy
|
||||||
|
|
||||||
|
fileName outputName =
|
||||||
surfaceWriterPtr_->write(fieldName, allValues);
|
surfaceWriterPtr_->write(fieldName, allValues);
|
||||||
|
|
||||||
|
// Case-local file name with "<case>" to make relocatable
|
||||||
|
dictionary propsDict;
|
||||||
|
propsDict.add("file", time_.relativePath(outputName, true));
|
||||||
|
this->setProperty(fieldName, propsDict);
|
||||||
|
|
||||||
surfaceWriterPtr_->clear();
|
surfaceWriterPtr_->clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user