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

[blockMesh] block.H file not found using block class

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 15, 2017, 06:03
Smile block.H file not found using block class
  #1
New Member
 
Join Date: May 2017
Location: France
Posts: 2
Rep Power: 0
Silth is on a distinguished road
Hi every body !

I'm very new to openFoam and until now, this forum has been very helpful, so I start with a great thanks !

My problem is the following :

I'm trying to do a simulation in a tube in which there is repetitive obstacle.
And I would like to be able to change the parameters (height, wide, distance between obstacles...) without having to modify all the points every time.

Therefor, I've been using the cylinder tutorial to try to mesh this tube.
I managed to create the vertices's by cooping the tutorial, so I'm using a for loop in a codestream and it's working.

Code:
vertices #codeStream
{
    codeInclude
    #{
        #include "pointField.H"
    #};

    code
    #{
        pointField points(19);
        points[0]  = point(0.5, 0, -0.5);
        points[1]  = point(1, 0, -0.5);
        points[2]  = point(2, 0, -0.5);
        points[3]  = point(2, 0.707107, -0.5);
        points[4]  = point(0.707107, 0.707107, -0.5);
        points[5]  = point(0.353553, 0.353553, -0.5);
        points[6]  = point(2, 2, -0.5);
        points[7]  = point(0.707107, 2, -0.5);
        points[8]  = point(0, 2, -0.5);
        points[9]  = point(0, 1, -0.5);
        points[10] = point(0, 0.5, -0.5);
        points[11] = point(-0.5, 0, -0.5);
        points[12] = point(-1, 0, -0.5);
        points[13] = point(-2, 0, -0.5);
        points[14] = point(-2, 0.707107, -0.5);
        points[15] = point(-0.707107, 0.707107, -0.5);
        points[16] = point(-0.353553, 0.353553, -0.5);
        points[17] = point(-2, 2, -0.5);
        points[18] = point(-0.707107, 2, -0.5);

        // Duplicate z points
        label sz = points.size();
        points.setSize(2*sz);
        for (label i = 0; i < sz; i++)
        {
            const point& pt = points[i];
            points[i+sz] = point(pt.x(), pt.y(), -pt.z());
        }

    // Duplicate all vertices
    for (label j = 0; j < 2; j++)
    {
               label sx = points.size();
            points.setSize(2*sx);
               for (label i = 0; i < sx; i++)
            {
                   const point& pt = points[i];
            points[i+sx] = point(pt.x()+4, pt.y(), pt.z());
             }
    }

        os  << points;
    #};
};
Now, I would like to create the blocks, the same way, by using the block class (in block.H file) with a for loop.

But every time I try to run blockMesh, the error is that:

error : no such file or directory

I've been trying few things:

Code:
blocks #codeStream
{
    codeInclude
    #{

    #include "block.H"
    #};

    block block(1);

    block[0].points = (5, 4, 9, 10, 24, 23, 28, 29);
but it return that there is no block.H file, and that block was not declared.

I also tried to do a new blockMesh utility that I called "generator" where I just copied the blockMesh utility and tried to add new libraries in the Make/options file.

Make/options:
Code:
EXE_INC = \
     -I$(OBJECTS_DIR) \
    -I$(LIB_SRC)/mesh/blockMesh/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude \
    -I$(LIB_SRC)/dynamicMesh/lnInclude

EXE_LIBS = \
    -L$(FOAM_LIBBIN)/libOSspecific.o \
    -L$(FOAM_LIBBIN)/dummy -lPstream \
    -lz \
    -lblockMesh \
    -lmeshTools \
    -ldynamicMesh
Make/files:
Code:
generator.C

EXE = $(FOAM_USER_APPBIN)/utilites/mesh/generation/generator
But block.H is still not found.

I even tried a barbarous way, by adding every files one by one with the full path :

Code:
blocks #codeStream
{
    codeInclude
    #{

    #include </opt/openfoam240/src/mesh/blockMesh/curvedEdges/curvedEdgeList.H>
        #include </opt/openfoam240/src/mesh/blockMesh/blockDescriptor/blockDescriptor.H>
    #include </opt/openfoam240/src/mesh/blockMesh/block/block.H>
    #};
but at some point, curevdEdgeListe.H is not found.

So I hope I explained my problem clearly and in the correct place.
Hope also that you can help me.

Thank you for reading,
Silth

Last edited by Silth; May 15, 2017 at 10:57.
Silth is offline   Reply With Quote

Old   May 16, 2017, 11:26
Default
  #2
New Member
 
Join Date: May 2017
Location: France
Posts: 2
Rep Power: 0
Silth is on a distinguished road
I think I find a solution. I'll learn how to do it with a .m4 file
Silth is offline   Reply With Quote

Reply

Tags
block, block.h, blockmesh, class, headers

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
[Other] Tabulated thermophysicalProperties library chriss85 OpenFOAM Community Contributions 62 October 2, 2022 04:50
[swak4Foam] Installation Problem with OF 6 version Aurel OpenFOAM Community Contributions 14 November 18, 2020 17:18
[swak4Foam] swak4foam building problem GGerber OpenFOAM Community Contributions 54 April 24, 2015 17:02
centOS 5.6 : paraFoam not working yossi OpenFOAM Installation 2 October 9, 2013 02:41
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 20:08


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