tutorials/incompressibleFluid/pitzDailySteady: Added strainRate coded functionObject

to demonstrate how easy it is to add field post-processing to cases.
This commit is contained in:
Henry Weller
2023-09-18 11:38:54 +01:00
parent 597121a4a7
commit 58cb08d8cd
2 changed files with 34 additions and 0 deletions

View File

@ -63,6 +63,8 @@ functions
) )
#includeFunc writeObjects(kEpsilon:G) #includeFunc writeObjects(kEpsilon:G)
#includeFunc strainRate(writeControl=writeTime)
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -0,0 +1,32 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
type coded;
// Load the library containing the 'coded' functionObject
libs ("libutilityFunctionObjects.so");
name strainRate;
codeInclude
#{
#include "fvcGrad.H"
#};
codeWrite
#{
const volVectorField& U(mesh().lookupObject<volVectorField>("U"));
volScalarField::New
(
"strainRate",
sqrt(2.0)*mag(symm(fvc::grad(U)))
)->write();
#};
// ************************************************************************* //