CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[blockMesh] error in using #codeStream for making blockMeshDict

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 9, 2016, 18:12
Default error in using #codeStream for making blockMeshDict
  #1
Senior Member
 
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 15
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, 5 views)
babakflame is offline   Reply With Quote

Old   October 9, 2016, 18:24
Default
  #2
Senior Member
 
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 15
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 Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[blockMesh] #codeStream loop inside a blockMeshDict francois OpenFOAM Meshing & Mesh Conversion 31 March 13, 2021 12:29
[blockMesh] Creating an axisymmetric piston cylinder in blockMeshDict foadsf OpenFOAM Meshing & Mesh Conversion 9 August 23, 2018 07:54
How to create the internalField with #codeStream chun OpenFOAM Running, Solving & CFD 3 May 6, 2017 10:35
[blockMesh] 2:1 refined 2D blockMeshDict with mergePatchPairs? chrisb2244 OpenFOAM Meshing & Mesh Conversion 0 December 1, 2014 23:52
[Other] blockMeshDict not Matching Boundary HassanDarian OpenFOAM Meshing & Mesh Conversion 0 March 19, 2014 13:30


All times are GMT -4. The time now is 10:24.