CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

codeStream in SetFieldsDict

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 5, 2013, 11:28
Default codeStream in SetFieldsDict
  #1
New Member
 
Join Date: Jul 2012
Posts: 13
Rep Power: 14
physics1 is on a distinguished road
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.
physics1 is offline   Reply With Quote

Old   June 14, 2013, 11:58
Default
  #2
New Member
 
xiaoweii
Join Date: Mar 2012
Posts: 7
Rep Power: 14
xiaow_g is on a distinguished road
Just follow the instructions in the error information:
adding to the InfoSwitches setting in the system controlDict(not the case controlDict):
allowSystemOperations 1
xiaow_g is offline   Reply With Quote

Reply

Tags
codestream, setfields


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
setFieldsDict, alpha1, free surface, wigley kolloff OpenFOAM Pre-Processing 10 April 3, 2015 06:05
Change deltaT using codeStream whatsoever OpenFOAM Running, Solving & CFD 1 April 30, 2013 03:53
Using #codeStream to set initial field for parallel run Hisham OpenFOAM Running, Solving & CFD 7 June 25, 2012 10:48
Using codestream in controlDict pad OpenFOAM Running, Solving & CFD 0 April 11, 2012 04:59
Bogus setFieldsDict in damBreak4phase{,Fine} tutorial cases mwild OpenFOAM Bugs 1 August 10, 2010 10:36


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