CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   codeStream in SetFieldsDict (http://www.cfd-online.com/Forums/openfoam-solving/114114-codestream-setfieldsdict.html)

physics1 March 5, 2013 11:28

codeStream in SetFieldsDict
 
Hi Everyone,
Im trying to initalize a non uniform density region inside set fields using the codeStream command shown below:

defaultFieldValues
(
volScalarFieldValue rho 1
);

regions
(
sphereToCell
{
centre (0 0 0);
radius 1000;
fieldValues
(
#codeStream
{
codeInclude
#{
#include "createRad.H"
#}
code
#{
volScalarFieldValue alpha1 10*e^(-rad/1000);
#}
}
);

}

);

but when I run setFields i get

FOAM FATAL IO ERROR:
Loading a shared library using case-supplied code is not enabled by default
because of security issues. If you trust the code you can enable this
facility be adding to the InfoSwitches setting in the system controlDict:

allowSystemOperations 1
The system controlDict is either
~/.OpenFOAM/$WM_PROJECT_VERSION/controlDict
or
$WM_PROJECT_DIR/etc/controlDict

file: /home/adparo/Documents/MultiTest/multiTest2/system/setFieldsDict from line 10 to line 15.
From function functionEntries::codeStream::execute(..)
in file db/dynamicLibrary/dynamicCode/dynamicCode.C at line 81.

FOAM exiting

Is it possible to use codestream in setFields and if not is there another way to do this? Later on i need to initalize with multiple density regions on my mesh each with different densities.

xiaow_g June 14, 2013 10:58

Just follow the instructions in the error information:
adding to the InfoSwitches setting in the system controlDict(not the case controlDict):
allowSystemOperations 1


All times are GMT -4. The time now is 14:53.