CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Native Meshers: blockMesh

error in using #codeStream for making blockMeshDict

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   October 9, 2016, 18:12
Default error in using #codeStream for making blockMeshDict
  #1
Senior Member
 
Bobi
Join Date: Oct 2012
Location: Chicago, Illinois
Posts: 392
Rep Power: 7
babakflame is on a distinguished road
Dear Fellows
I am trying to use #codeStream in blockMeshDict file to create a simple grid. The following is my blockMeshDict file initial lines:

Code:
convertToMeters 1;

vertices  #codeStream
{
    codeInclude
    #{
        #include "pointField.H"
    #};
    code
    #{
        pointField points(8);
        points[0] = point(0 0 0);
        points[1] = point(2 0 0);
        points[2] = point(2 0.05 0);
        points[3] = point(0 0.05 0);
        points[4] = point(0 0 0.05);    
        points[5] = point(2 0 0.05);
        points[6] = point(2 0.05 0.05);
        points[7] = point(0 0.05 0.05);

        os << points;
    #};
};

blocks
(
    hex (0 1 2 3 4 5 6 7) (280 7 1) simpleGrading (1 1 1)

);
During compilation of grid, it returns the following error:

Code:
home/babak/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/Vector.H:58:7: note:   no known conversion for argument 1 from ‘int’ to ‘const Foam::Vector<double>&’
/home/babak/Desktop/second_version_simulations/Coarse_Grid/X_10/j0_1/constant/polyMesh/blockMeshDict::#codeStream:34:20: error: expected primary-expression before ‘(’ token
/home/babak/Desktop/second_version_simulations/Coarse_Grid/X_10/j0_1/constant/polyMesh/blockMeshDict::#codeStream:34:23: error: expected ‘)’ before numeric constant
make: *** [Make/linux64GccDPOpt/codeStreamTemplate.o] Error 1
Would some one please hint me where did I make mistake in writing #codeStream??

The full blockMeshDict file is attached as well.

The above grid compiles with removing code stream and defining vertices normally

Regards
Attached Files
File Type: txt blockMeshDict.txt (1.7 KB, 0 views)
babakflame is offline   Reply With Quote

Old   October 9, 2016, 18:24
Default
  #2
Senior Member
 
Bobi
Join Date: Oct 2012
Location: Chicago, Illinois
Posts: 392
Rep Power: 7
babakflame is on a distinguished road
Oh Gosh. Problem Solved.
points Should be defined like this:

Code:
code
    #{
        pointField points(8);
        points[0] = point(0, 0,       0);
        points[1] = point(2, 0,       0);
        points[2] = point(2, 0.05,    0);
        points[3] = point(0, 0.05,    0);
        points[4] = point(0, 0,    0.05);    
        points[5] = point(2, 0,    0.05);
        points[6] = point(2, 0.05, 0.05);
        points[7] = point(0, 0.05, 0.05);

        os << points;
    #};
I had missed commas inside the parenthesis.
babakflame is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
#codeStream loop inside a blockMeshDict francois OpenFOAM Native Meshers: blockMesh 23 October 24, 2015 13:32
2:1 refined 2D blockMeshDict with mergePatchPairs? chrisb2244 OpenFOAM Native Meshers: blockMesh 0 December 2, 2014 00:52
blockMeshDict not Matching Boundary HassanDarian OpenFOAM Meshing & Mesh Conversion 0 March 19, 2014 14:30
Using #codeStream to set initial field for parallel run Hisham OpenFOAM Running, Solving & CFD 7 June 25, 2012 09:48
A script for combining two blockMeshDict yingfeng OpenFOAM Native Meshers: blockMesh 0 August 26, 2009 16:05


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