mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: extended runTimePostProcessing (#1206)
- Extended runTimePostProcessing to include access to "live"
simulation objects such a geometry patches and sampled surfaces
stored on the "functionObjectObjects" registry.
- Add 'live' runTimePostProcessing of cloud data.
Extracts position and fields from the cloud via its objectRegistry writer
- For the "live" simulation objects, there are two new volume filters
that work directly with the OpenFOAM volume fields:
* iso-surface
* cutting planes
Both use the VTK algorithms directly and support multiple values.
Eg, can make multiple iso-levels or multiple planes parallel to each
other.
- When VTK has been compiled with MPI-support, parallel rendering will
be used.
- Additional title text properties (shadow, italic etc)
- Simplified handling of scalar-bar and visibility switches
- Support multiple text positions. Eg, for adding watermark text.
This commit is contained in:
committed by
Andrew Heather
parent
03e6aa1a6d
commit
42fbf6d38c
281
etc/caseDicts/annotated/runTimePostProcessingDict
Normal file
281
etc/caseDicts/annotated/runTimePostProcessingDict
Normal file
@ -0,0 +1,281 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v1812 |
|
||||
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object runTimePostProcessingDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// Type of functionObject
|
||||
type runTimePostProcessing;
|
||||
|
||||
// Where to load it from
|
||||
libs ("librunTimePostProcessing.so");
|
||||
|
||||
// Function object enabled flag
|
||||
enabled true;
|
||||
|
||||
// When to output the average fields
|
||||
writeControl writeTime;
|
||||
|
||||
//- Optionally disable parallel VTK rendering, default = true
|
||||
// parallel true;
|
||||
|
||||
//- The output characteristics
|
||||
output
|
||||
{
|
||||
//- The name stem for output images
|
||||
name image;
|
||||
|
||||
//- The image dimensions
|
||||
width 1400;
|
||||
height 1050;
|
||||
}
|
||||
|
||||
|
||||
//- The camera settings
|
||||
camera
|
||||
{
|
||||
// If camera is moving, optionally provide start and end times
|
||||
// startPosition 0.2;
|
||||
// endPosition 0.75;
|
||||
|
||||
// Total number of frames to generate
|
||||
nFrameTotal 1;
|
||||
|
||||
// Parallel projection flag
|
||||
parallelProjection yes;
|
||||
|
||||
// clipBox is optional
|
||||
|
||||
position (385 -560 650);
|
||||
focalPoint (160 90 60);
|
||||
up (0.06 0.7 0.7);
|
||||
|
||||
position ( -41.95 -247.55 426.87 );
|
||||
focalPoint ( 146 76 40 );
|
||||
up ( 0.3646 0.6194 0.6953 );
|
||||
|
||||
zoom 1.5;
|
||||
// clipBox (-10 18 0)(280 160 76);
|
||||
clipBox (-30 0 0)(300 200 80);
|
||||
}
|
||||
|
||||
|
||||
// Default colours
|
||||
// - If select to colourBy colour, these values are used unless
|
||||
// they are locally overridden
|
||||
colours
|
||||
{
|
||||
background (0.317647 0.341176 0.431373);
|
||||
background2 (0.317647 0.341176 0.431373);
|
||||
text (0.75 0.75 0.75);
|
||||
edge (1 0 0);
|
||||
surface (0.5 0.5 0.5);
|
||||
line (1 0 0);
|
||||
point (0.5 0.5 0.5);
|
||||
}
|
||||
|
||||
|
||||
// Line data
|
||||
lines
|
||||
{
|
||||
streamline
|
||||
{
|
||||
type functionObjectLine;
|
||||
functionObject streamLines;
|
||||
colourMap rainbow;
|
||||
representation tube;
|
||||
visible true;
|
||||
tubeRadius 0.5;
|
||||
colourBy field;
|
||||
field U;
|
||||
range (0 20);
|
||||
opacity 1;
|
||||
scalarBar
|
||||
{
|
||||
visible no;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Surface data
|
||||
surfaces
|
||||
{
|
||||
geom
|
||||
{
|
||||
type geometry;
|
||||
files ("<case>/myGeometry.vtp");
|
||||
renderMode phong;
|
||||
representation surface;
|
||||
edgeColour (0.5 0.5 0.5);
|
||||
visible yes;
|
||||
featureEdges none;
|
||||
opacity 1.0;
|
||||
}
|
||||
|
||||
surf1
|
||||
{
|
||||
type functionObjectSurface;
|
||||
functionObject planes.plane0;
|
||||
liveObject true;
|
||||
colourMap coolToWarm;
|
||||
|
||||
representation surface;
|
||||
maxGlyphLength 0.1;
|
||||
smooth true;
|
||||
visible yes;
|
||||
|
||||
featureEdges none;
|
||||
colourBy field;
|
||||
field U;
|
||||
range (0 20);
|
||||
opacity 1;
|
||||
|
||||
scalarBar
|
||||
{
|
||||
visible no;
|
||||
}
|
||||
}
|
||||
|
||||
patches
|
||||
{
|
||||
type patches;
|
||||
patches ( buildings ground );
|
||||
nearCellValue true;
|
||||
smooth true;
|
||||
colourMap coolToWarm;
|
||||
representation surface;
|
||||
representation glyph;
|
||||
|
||||
// maxGlyphLength 5;
|
||||
maxGlyphLength 0;
|
||||
visible yes;
|
||||
featureEdges none;
|
||||
colourBy field;
|
||||
|
||||
field U;
|
||||
range (0 20);
|
||||
|
||||
opacity 1;
|
||||
scalarBar
|
||||
{
|
||||
visible no;
|
||||
position (0.8 0.1);
|
||||
vertical yes;
|
||||
fontSize 16;
|
||||
titleSize 18;
|
||||
title "velocity [m/s]";
|
||||
labelFormat "%6.2f";
|
||||
numberOfLabels 5;
|
||||
|
||||
bold yes;
|
||||
italic yes;
|
||||
shadow yes;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
cutting
|
||||
{
|
||||
type plane;
|
||||
planeType pointAndNormal;
|
||||
|
||||
pointAndNormalDict
|
||||
{
|
||||
point (100 100 50);
|
||||
normal (1 0 0);
|
||||
}
|
||||
|
||||
offsets (0 100 200);
|
||||
|
||||
smooth true;
|
||||
colourMap coolToWarm;
|
||||
representation surface;
|
||||
|
||||
representation glyph;
|
||||
|
||||
// maxGlyphLength 5;
|
||||
maxGlyphLength 0;
|
||||
visible yes;
|
||||
featureEdges none;
|
||||
|
||||
colourBy field;
|
||||
colourField U;
|
||||
field U;
|
||||
range (0 20);
|
||||
|
||||
opacity 1;
|
||||
scalarBar
|
||||
{
|
||||
visible no;
|
||||
}
|
||||
}
|
||||
|
||||
iso
|
||||
{
|
||||
type iso;
|
||||
values (0 4 8);
|
||||
|
||||
smooth true;
|
||||
colourMap coolToWarm;
|
||||
representation surface;
|
||||
|
||||
representation glyph;
|
||||
|
||||
// maxGlyphLength 5;
|
||||
maxGlyphLength 0;
|
||||
visible yes;
|
||||
featureEdges none;
|
||||
|
||||
colourBy field;
|
||||
colourField U;
|
||||
field U;
|
||||
range (0 20);
|
||||
|
||||
colourField k;
|
||||
field k;
|
||||
range (0 20);
|
||||
|
||||
colourBy field;
|
||||
colourField U;
|
||||
field U;
|
||||
range (0 20);
|
||||
|
||||
opacity 1;
|
||||
scalarBar
|
||||
{
|
||||
visible no;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Text data
|
||||
text
|
||||
{
|
||||
text1
|
||||
{
|
||||
string "buildings";
|
||||
position (0.5 0.15);
|
||||
halign centre;
|
||||
size 18;
|
||||
opacity 0.4;
|
||||
bold yes;
|
||||
italic yes;
|
||||
shadow yes;
|
||||
visible yes;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
107
etc/caseDicts/postProcessing/visualization/runTimePostPro.cfg
Normal file
107
etc/caseDicts/postProcessing/visualization/runTimePostPro.cfg
Normal file
@ -0,0 +1,107 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v1812 |
|
||||
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
type runTimePostProcessing;
|
||||
|
||||
libs ("librunTimePostProcessing.so");
|
||||
|
||||
writeControl writeTime;
|
||||
|
||||
// Output characteristics
|
||||
output
|
||||
{
|
||||
//- The name stem for output images
|
||||
name image;
|
||||
|
||||
//- The image dimensions
|
||||
width 1400;
|
||||
height 1050;
|
||||
}
|
||||
|
||||
|
||||
// Some convenient colour schemes
|
||||
colourScheme
|
||||
{
|
||||
black
|
||||
{
|
||||
background (0 0 0);
|
||||
text (0.75 0.75 0.75);
|
||||
edge (1 0 0);
|
||||
surface (0.5 0.5 0.5);
|
||||
line (1 0 0);
|
||||
point (0.5 0.5 0.5);
|
||||
}
|
||||
|
||||
blueGradient
|
||||
{
|
||||
background (1 1 1);
|
||||
background2 (0 0 1);
|
||||
text (0 0 0);
|
||||
edge (1 0 0);
|
||||
surface (0.5 0.5 0.5);
|
||||
line (1 0 0);
|
||||
point (0.5 0.5 0.5);
|
||||
}
|
||||
|
||||
greyGradient
|
||||
{
|
||||
background (0.5 0.5 0.5);
|
||||
background2 (0.7 0.7 0.7);
|
||||
text (1 1 1);
|
||||
edge (1 0 0);
|
||||
surface (0.5 0.5 0.5);
|
||||
line (1 0 0);
|
||||
point (0.5 0.5 0.5);
|
||||
}
|
||||
|
||||
paraview
|
||||
{
|
||||
background (0.317647 0.341176 0.431373);
|
||||
text (0.75 0.75 0.75);
|
||||
edge (1 0 0);
|
||||
surface (0.5 0.5 0.5);
|
||||
line (1 0 0);
|
||||
point (0.5 0.5 0.5);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Some typical scalarBar settings
|
||||
scalarBar
|
||||
{
|
||||
right
|
||||
{
|
||||
visible true;
|
||||
vertical true;
|
||||
position (0.8 0.1);
|
||||
size (0.1 0.75);
|
||||
fontSize 16;
|
||||
labelFormat "%f";
|
||||
numberOfLabels 5;
|
||||
bold yes;
|
||||
italic yes;
|
||||
shadow yes;
|
||||
}
|
||||
|
||||
bottom
|
||||
{
|
||||
visible true;
|
||||
vertical false;
|
||||
position (0.2 0.1);
|
||||
size (0.6 0.1);
|
||||
fontSize 16;
|
||||
labelFormat "%f";
|
||||
numberOfLabels 5;
|
||||
bold yes;
|
||||
italic yes;
|
||||
shadow yes;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -820,6 +820,7 @@ DebugSwitches
|
||||
rotatedBoxToCell 0;
|
||||
rotatingPressureInletOutletVelocity 0;
|
||||
rotatingTotalPressure 0;
|
||||
runTimePostPro::geometryBase 0;
|
||||
sampledPatch 0;
|
||||
sampledPlane 0;
|
||||
sampledSet 0;
|
||||
|
||||
Reference in New Issue
Block a user