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

[blockMesh] #codeStream loop inside a blockMeshDict

Register Blogs Community New Posts Updated Threads Search

Like Tree19Likes

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   April 11, 2015, 12:08
Default #codeStream loop inside a blockMeshDict
  #1
Senior Member
 
Francois Beaubert
Join Date: Mar 2009
Location: Lille, France
Posts: 147
Rep Power: 17
francois is on a distinguished road
Hi all,

I would like to use #codeStream to define the points of splines in a blockMeshDict.

Here is the code snippet I use:

Code:
 spline 0 1 ( #codeStream
 {
   codeInclude
   #{
      #include "pointField.H"
   #};

   code
   #{
     label nbPoints = 20;
     for (label i = 0; i < nbPoints; i++)
     {
       scalar xi = 0 + i*$L/(nbPoints-1);
       scalar yi = $Ri - ($Re-$Ri) * (6*pow(xi/$L,5) - 15*pow(xi/$L,4) + 10*pow(xi/$L,3));
        os  << point(xi, -yi, 0) << endl;
        // Info  << point(xi, -yi, 0) << endl;
     }
   #};
  };
   )
The full blockMeshDict file is attached in this post.

I've got this error message:

Code:
--> FOAM FATAL IO ERROR: 
Expected a '(' while reading VectorSpace<Form, Cmpt, nCmpt>, found on line 79 the punctuation token ';'

file: /home/beaubert/OpenFOAM/beaubert-2.3.0/run/convergentMarie/convergentCase/constant/polyMesh/blockMeshDict.edges at line 79.

    From function Istream::readBegin(const char*)
    in file db/IOstreams/IOstreams/Istream.C at line 94.

FOAM exiting
The mesh is fine if I directly put the points coordinates (retrieved with Info) into the blockMeshDict.

Any idea ?
Thanks a lot for your help

Happy foaming
François
Attached Files
File Type: txt blockMeshDict.txt (2.4 KB, 89 views)
francois is offline   Reply With Quote

 


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
[Other] Contribution a new utility: refine wall layer mesh based on yPlus field lakeat OpenFOAM Community Contributions 58 December 23, 2021 02:36
[Other] refineWallLayer Error Yuby OpenFOAM Meshing & Mesh Conversion 2 November 11, 2021 11:04
Star-CCM+ Macro - Loop over just wall boundary conditions jbatchel STAR-CCM+ 5 March 2, 2018 13:42
Pressure distribution on a wall darazsbence CFX 17 October 6, 2015 10:38
How to determine a point is inside a tetrahedral? G.P. Xia Main CFD Forum 16 January 12, 2000 11:15


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