TUT: Added glTF export example for field and track data

This commit is contained in:
Andrew Heather 2021-11-26 16:06:32 +00:00 committed by Mark Olesen
parent 85b405206d
commit 34b4770949
5 changed files with 184 additions and 2 deletions

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / O peration | Version: v2112 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -20,5 +20,32 @@ sampleFrequency 1;
maxPositions 1000000;
//maxTracks 5;
setFormat gltf;
formatOptions
{
animate yes;
colour yes;
animationInfo
{
colour field;
colourField d;
//min 0;
//max 0.002;
//alpha uniform;
//alphaValue 1;
alpha field;
alphaField d;
normalise yes;
}
}
fields (d);
// ************************************************************************* //

View File

@ -0,0 +1,51 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2112 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object particleTrackProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
cloud reactingCloud1;
sampleFrequency 1;
maxPositions 1000000;
//maxTracks 5;
setFormat gltf;
formatOptions
{
animate yes;
colour yes;
animationInfo
{
colour field;
colourField d;
//min 0;
//max 0.002;
//alpha uniform;
//alphaValue 1;
alpha field;
alphaField d;
normalise yes;
}
}
fields (d);
// ************************************************************************* //

View File

@ -0,0 +1,51 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2112 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object particleTrackProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
cloud reactingCloud1;
sampleFrequency 1;
maxPositions 1000000;
//maxTracks 5;
setFormat gltf;
formatOptions
{
animate no;
colour yes;
fieldInfo
{
d
{
colourMap rainbow;
min 0;
max 0.001;
alpha field; // uniform | field;
//alphaValue 0.1; // uniform alpha value
alphaField d;
normalise yes;
}
}
}
fields (d);
// ************************************************************************* //

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / O peration | Version: v2112 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -52,6 +52,7 @@ maxDeltaT 1;
functions
{
#include "sample"
#include "dataCloud"
#include "vtkCloud"
#include "vtkWrite"

View File

@ -0,0 +1,52 @@
// -*- C++ -*-
sample1
{
type sets;
libs (sampling);
setFormat gltf;
interpolationScheme cellPointFace;
formatOptions
{
// Optionally add colours to fields
// - default: colour map limits set to field limits
colour yes;
fieldInfo
{
T
{
colourMap fire;
alpha field; // uniform | field;
//alphaValue 0.1; // uniform alpha value
alphaField T;
normalise yes;
}
}
}
fields ( p T k epsilon U );
writeControl writeTime;
sets
(
line
{
type face;
axis xyz;
start (0 0.5 0);
end (4 0.5 0.05);
nPoints 10;
}
cells
{
type cellCentre;
}
);
}
// ************************************************************************* //