mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
TUT: Added glTF export example for field and track data
This commit is contained in:
committed by
Mark Olesen
parent
85b405206d
commit
34b4770949
@ -1,7 +1,7 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
| ========= | |
|
| ========= | |
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
| \\ / O peration | Version: v2106 |
|
| \\ / O peration | Version: v2112 |
|
||||||
| \\ / A nd | Website: www.openfoam.com |
|
| \\ / A nd | Website: www.openfoam.com |
|
||||||
| \\/ M anipulation | |
|
| \\/ M anipulation | |
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
@ -20,5 +20,32 @@ sampleFrequency 1;
|
|||||||
|
|
||||||
maxPositions 1000000;
|
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);
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -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);
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -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);
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -1,7 +1,7 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
| ========= | |
|
| ========= | |
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
| \\ / O peration | Version: v2106 |
|
| \\ / O peration | Version: v2112 |
|
||||||
| \\ / A nd | Website: www.openfoam.com |
|
| \\ / A nd | Website: www.openfoam.com |
|
||||||
| \\/ M anipulation | |
|
| \\/ M anipulation | |
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
@ -52,6 +52,7 @@ maxDeltaT 1;
|
|||||||
|
|
||||||
functions
|
functions
|
||||||
{
|
{
|
||||||
|
#include "sample"
|
||||||
#include "dataCloud"
|
#include "dataCloud"
|
||||||
#include "vtkCloud"
|
#include "vtkCloud"
|
||||||
#include "vtkWrite"
|
#include "vtkWrite"
|
||||||
|
|||||||
52
tutorials/lagrangian/reactingParcelFoam/filter/system/sample
Normal file
52
tutorials/lagrangian/reactingParcelFoam/filter/system/sample
Normal 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;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
Reference in New Issue
Block a user