CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Starting field averaging using libFunctionObject after certain time (https://www.cfd-online.com/Forums/openfoam-programming-development/92306-starting-field-averaging-using-libfunctionobject-after-certain-time.html)

eelcovv May 7, 2013 11:51

solution to non updating trackDict
 
The answer can be found in the function object source code: the fileModificationSkew si not allowed to be too large. Just create a directory

$HOME/.OpenFOAM/2.2.x

or what ever you version is, copy $WM_PROJECT_DIR/etc/controlDict to this directory and modify the line

fileModificationSkew 30 to something smaller.

Then an update of a dictionary being tracked will result in a reread of it.

Regards
Eelco

eelcovv May 15, 2013 16:06

reread the subdictionaries from an regIOobject
 
One more question on this topic

When a dictionary is re-read after an file-update, only the content at the 'top-level is read, not the sub-dictionaries. This can be seen in the file

$FOAM_SRC/OpenFOAM/db/regIOobject/regIOobjectRead.C, line 285-292. It says: reread object name(), which is the name of the dictionary.

however, sometimes you want to read the subdictionaries as well. For instance in kinematicCloudProperties, you want to update the mass flow rate of the injectors by modifying the file during the run.

Is there an easy way to force OF to re-read the subdictionaries during a run ?

Well, not so important, but it would be handy

Thanks for the hints!
Regards
Eelco

mwaqas November 19, 2014 08:53

Hello Everyone

I am beginner in OpenFoam, may be my question looks very busy, I am sorry for that.
I am using fieldAverage to get time-averaged of velocity. I get the time-averaged file in respective time step folder but I don't know how can I view this average field using paraview. When I load my case to paraview, it shows only entities which are present in "0" folder. It does not show averaged field i.e. UMean

Regards
Waqas

mmmn036 October 19, 2015 02:25

Hello Steven,

I am using 2.2.x version of OpenFoam. The averaging utility you attached give me a compilation error. Do you have an updated version of this utility? I greatly appreciate your support.

MMMN

jiaojiao December 7, 2015 22:06

compile field meet error
 
Hi, Steven !I also want to start field averaging at a certain time when the field is fully developed.I down load the field.zip and unzip it.Then I put the directory at the path home/OpenFoam and run 'wmake libso' to compile it. But it come to error like this:
[hpc@hpcserver:~/OpenFOAM/field$ wmake libso
SOURCE=fieldAverage/fieldAverage/fieldAverage.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam222/src/finiteVolume/lnInclude -I/opt/openfoam222/src/meshTools/lnInclude -I/opt/openfoam222/src/lagrangian/basic/lnInclude -I/opt/openfoam222/src/sampling/lnInclude -IlnInclude -I. -I/opt/openfoam222/src/OpenFOAM/lnInclude -I/opt/openfoam222/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/fieldAverage.o
In file included from /opt/openfoam222/src/OpenFOAM/lnInclude/className.H:34:0,
from /opt/openfoam222/src/OpenFOAM/lnInclude/typeInfo.H:57,
from /opt/openfoam222/src/OpenFOAM/lnInclude/token.H:46,
from /opt/openfoam222/src/OpenFOAM/lnInclude/Istream.H:47,
from /opt/openfoam222/src/OpenFOAM/lnInclude/ISstream.H:39,
from /opt/openfoam222/src/OpenFOAM/lnInclude/IOstreams.H:38,
from /opt/openfoam222/src/OpenFOAM/lnInclude/VectorSpace.C:27,
from /opt/openfoam222/src/OpenFOAM/lnInclude/VectorSpace.H:171,
from /opt/openfoam222/src/OpenFOAM/lnInclude/Vector.H:44,
from /opt/openfoam222/src/OpenFOAM/lnInclude/vector.H:39,
from /opt/openfoam222/src/OpenFOAM/lnInclude/fieldTypes.H:35,
from /opt/openfoam222/src/finiteVolume/lnInclude/volFieldsFwd.H:37,
from fieldAverage/fieldAverage/fieldAverage.H:88,
from fieldAverage/fieldAverage/fieldAverage.C:26:
/opt/openfoam222/src/OpenFOAM/lnInclude/debugName.H:45:11: error: ?.ddFoam?.has not been declared
class add##Tag##ToDebug \
^
/opt/openfoam222/src/OpenFOAM/lnInclude/debugName.H:125:5: note: in expansion of macro ?.egisterDebugSwitchWithName?
registerDebugSwitchWithName(Type, Type, Type::typeName_())
^
/opt/openfoam222/src/OpenFOAM/lnInclude/className.H:145:5: note: in expansion of macro ?.efineDebugSwitch?
defineDebugSwitch(Type, DebugSwitch)
^
fieldAverage/fieldAverage/fieldAverage.C:34:1: note: in expansion of macro ?.efineTypeNameAndDebug?
defineTypeNameAndDebug(Foam::fieldAverage, 0);
^
/opt/openfoam222/src/OpenFOAM/lnInclude/debugName.H:46:5: error: expected unqualified-id before ?.?.token
: \
^
/opt/openfoam222/src/OpenFOAM/lnInclude/debugName.H:125:5: note: in expansion of macro ?.egisterDebugSwitchWithName?
registerDebugSwitchWithName(Type, Type, Type::typeName_())
^
/opt/openfoam222/src/OpenFOAM/lnInclude/className.H:145:5: note: in expansion of macro ?.efineDebugSwitch?
defineDebugSwitch(Type, DebugSwitch)
^
fieldAverage/fieldAverage/fieldAverage.C:34:1: note: in expansion of macro ?.efineTypeNameAndDebug?
defineTypeNameAndDebug(Foam::fieldAverage, 0);
^
make: *** [Make/linux64GccDPOpt/fieldAverage.o] Error 1]
could you tell me how to fix the errors ?
Quote:

Originally Posted by stevenvanharen (Post 323555)
Hi Eelco,

We had the same problem, we added a keyword 'after' to the fieldAverage function. This will delay averaging untill the specified time is reached (this is specified in controlDict).

You can unzip this folder and compile it (wmake libso), in the controlDict which is in the folder you can see how to use it.

I hope this solves your problem, please let me know if you have any more questions.

Regards,

Steven


jiaojiao December 7, 2015 22:28

Hello, do you solver the problem caused by the different version? My OPENFOAM is the 2.2.2version.
Quote:

Originally Posted by mmmn036 (Post 568969)
Hello Steven,

I am using 2.2.x version of OpenFoam. The averaging utility you attached give me a compilation error. Do you have an updated version of this utility? I greatly appreciate your support.

MMMN



All times are GMT -4. The time now is 15:22.