CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Output Forces Using interDyMFoam (https://www.cfd-online.com/Forums/openfoam-post-processing/207152-output-forces-using-interdymfoam.html)

spaceplumber September 25, 2018 10:48

Output Forces Using interDyMFoam
 
1 Attachment(s)
Hello,

**EDIT: I just managed to solve this problem. As usual all it takes to figure it out yourself is asking for help. Instead of deleting I'll say what I changed in case it would be useful for anyone else. The problem seemed to come from the fact that I had not specified the CofR. I assumed it would not be needed because I didn't need moments and based on documentation I thought it was optional, but forces seems to need it to run. After a few more modifications to get the logging interval I wanted, the code now looks like this:

functions
{
#includeFunc residuals

forces
{
type forces;
libs ("libforces.so");
writeControl adjustableRunTime;
writeInterval 0.01;
patches (walls);
rho rhoInf;
log yes;
rhoInf 1000;
CofR (0 0 0);
}
}

End of edit**

I'm very new to OpenFOAM and have been trying to get a basic slosh simulation running using interDyMFoam. To get myself up to speed, I've been using the slosh tutorial files as examples, but my geometry is just a simple cube in an attempt to reduce errors. I need to output the forces on the walls exerted by the slosh, but keep getting errors when trying to do so using all examples I've found. Right now I'm trying to use this in the controlDict file:
functions
{
#includeFunc residuals

forces
{
type forces;
libs ("libforces.so");
patches (walls);
writeFields yes;
log true;
};
}
But I've been getting this error every time:
keyword origin is undefined in dictionary "C:/PROGRA~1/BLUECF~1/ofuser-of5/run/cubetest/system/controlDict.functions.forces"

file: C:/PROGRA~1/BLUECF~1/ofuser-of5/run/cubetest/system/controlDict.functions.forces from line 61 to line 65.

From function const Foam::entry& Foam::dictionary::lookupEntry(const Foam::word&, bool, bool) const
in file db/dictionary/dictionary.C at line 566.
At the suggestion of someone else's post, I've been trying to run the simulation using blockMesh, setFields, then interDyMFoam -postProcess. The last command was said to produce fewer errors and sometimes work better with forces than using a run file similar to the tutorials.

I've also tried using #include "forces" in the controlDict file with a separate forces file written the same way I currently have it written in the controlDict. This was based off of the propeller tutorial. I received the same error message after trying this.

I haven't been having much luck finding alternative examples or suggestions to try so any help would be much appreciated. Since I'm new to the program, I'm sure it's something simple that I either forgot or misunderstood. In case it's needed, I'm currently running version 5 of OpenFOAM. Thanks in advance!


All times are GMT -4. The time now is 21:18.