CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

Coded function object- strainRate

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 5, 2024, 12:46
Default Coded function object- strainRate
  #1
New Member
 
GaspA
Join Date: Jan 2023
Location: Switzerland - Valais
Posts: 10
Rep Power: 4
GaspA is on a distinguished road
Hello,
I am trying to calculate the strain rate during the calculation and write it as an ASCII file in the temps folder.
My idea is simply to write the sqrt(2.0)*mag(symm(grad(U))) function in a functionObjects in system/controlDict.
I am using OpenFoam 11.
I took as a basis the example provided with the openfoam.org documentation.
https://cpp.openfoam.org/v11/classFo...ionObject.html


And it works...... No surprises

Quote:

writeMagU
{
libs ("libutilityFunctionObjects.so");
type coded;
codeWrite
#{
// Lookup U
const volVectorField& U = mesh().lookupObject<volVectorField>("U");
// Write
mag(U)().write();
#};
}
When I try to replace the formula entered, using for example grad(U) or fvc::grad(U) it does not work. Compilation errror "error: ‘fvc’ has not been declared"

What is surprising is that by replacing "codeWrite" with "code", the compilation works but it is impossible to write the file.

Can someone tell me how to integrate the formula sqrt(2.0)*mag(symm(grad(U))) into such a function?

Thank you.

GaspA
GaspA is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
../externals/cgns/hdf5/H5public.h:63:10: fatal error: mpi.h: No such file or director Mohsin1 SU2 8 November 25, 2023 04:46
interFoam and scalarTransport function object with fvOptions sources fusij OpenFOAM Running, Solving & CFD 4 April 18, 2022 08:12
[mesh manipulation] RefineMesh Error and Foam warning jiahui_93 OpenFOAM Meshing & Mesh Conversion 4 March 3, 2018 12:32
[mesh manipulation] refineMesh Error mohsen.boojari OpenFOAM Meshing & Mesh Conversion 3 March 1, 2018 23:07
[blockMesh] non-orthogonal faces and incorrect orientation? nennbs OpenFOAM Meshing & Mesh Conversion 7 April 17, 2013 06:42


All times are GMT -4. The time now is 12:06.