CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   SetFieldsDict: Non uniform density (https://www.cfd-online.com/Forums/openfoam-solving/117443-setfieldsdict-non-uniform-density.html)

physics1 May 8, 2013 12:37

SetFieldsDict: Non uniform density
 
For my simulation I have a circular density area that i would like to put a
gaussian density distribution inside. To do this I am trying to use codestream inside the setFieldsDict. Below is what my dictionary looks like.

FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object setFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

defaultFieldValues
(
volScalarFieldValue rho 1
);

regions
(
sphereToCell
{
centre (0 0 0);
radius 1000;
fieldValues
(
#codeStream
{
codeOptions
#{

#};
codeInclude
#{

#};
code
#{

#};
}
volScalarFieldValue rho 100
);
}
);

But when I run setFields i keep getting this error:

wmake error: file 'Make/linuxGccDPOpt/objectFiles' could not be created in /home/adparo/Documents/MultiTest/multiTest2/dynamicCode/_a45e8e741fc6fd0ed5b8baeed94b2e884fb3af7e


--> FOAM FATAL IO ERROR:
Failed wmake "dynamicCode/_a45e8e741fc6fd0ed5b8baeed94b2e884fb3af7e/platforms/linuxGccDPOpt/lib/libcodeStream_a45e8e741fc6fd0ed5b8baeed94b2e884fb3 af7e.so"


file: /home/adparo/Documents/MultiTest/multiTest2/system/setFieldsDict from line 12 to line 14.

From function functionEntries::codeStream::execute(..)
in file db/dictionary/functionEntries/codeStream/codeStream.C at line 195.

FOAM exiting


Am I allowed to use codestream in setFields and if so what am i doing wrong.

physics1 May 8, 2013 16:35

So I edited the file so it now reads:

regions
(
sphereToCell
{
centre (0 0 0);
radius 1000;
fieldValues
(
#codeStream
{
codeOptions
#{
-I$WM_PROJECT_DIR/src/finiteVolume/fields/volFields\
-I$HOME/Documents
#};
codeInclude
#{
#include "volFields.H"
//#include "volFieldsFwd.H"
#};
code
#{
scalar x= 0;
//vector centre = (0 0 0);
//#include "createRad.H"
//volScalarField rhoi = 100*e^(-rad/1000)
#};
}
volScalarFieldValue rho 100
);
}


and is now giving me this error:

could not open file volFields.H for source file codeStreamTemplate.C
/home/adparo/Documents/MultiTest/multiTest2/system/setFieldsDict::#codeStream:32:23: fatal error: volFields.H: No such file or directory
compilation terminated.
make: *** [Make/linuxGccDPOpt/codeStreamTemplate.o] Error 1


--> FOAM FATAL IO ERROR:
Failed wmake "dynamicCode/_ab18aa727a6ee6ffed86f40a5f1c0c2b0a0197c7/platforms/linuxGccDPOpt/lib/libcodeStream_ab18aa727a6ee6ffed86f40a5f1c0c2b0a01 97c7.so"


file: /home/adparo/Documents/MultiTest/multiTest2/system/setFieldsDict from line 12 to line 14.
From function functionEntries::codeStream::execute(..)
in file db/dictionary/functionEntries/codeStream/codeStream.C at line 195.

FOAM exiting

I have the path to the exact file listed in codeOptions but it still cannot find the header file. What am I doing wrong?


All times are GMT -4. The time now is 09:25.