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

[blockMesh] How to define a cellzone while using blockMesh

Register Blogs Community New Posts Updated Threads Search

Like Tree19Likes
  • 1 Post By deepbandivadekar
  • 5 Post By Antimony
  • 12 Post By Bloerb
  • 1 Post By deepbandivadekar

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 25, 2017, 15:59
Default How to define a cellzone while using blockMesh
  #1
Senior Member
 
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 9
deepbandivadekar is on a distinguished road
I have a very simple geometry and I have created it using blockMesh only. So there are two blocks: first is the horizontal duct while the second is another smaller duct merging with the first bigger duct at 90deg. See attached pictures for visualisation.

Now I want to define these two blocks as separate cellzones. e.g. say one of them as porous zone. How can I do that? (The related tutorials use SHM or FHM, I want to avoid that)

I also noticed that after running blockMesh, [sets] folder is created in polyMesh. Isn't that created when blockMesh can't use some the faces or points? The [sets] folder for me contains these exact two zones that I mentioned above!! I don't understand why?

1. Is there any way I can perhaps use these region0 and region1 ?

2. If not, is it a good idea to use something like
Code:
  splitMeshRegions -makeCellZones
Attached Images
File Type: png 3DMesh.png (29.6 KB, 96 views)
File Type: png region0.png (28.8 KB, 60 views)
File Type: png region1.png (14.3 KB, 49 views)
njdyck likes this.
deepbandivadekar is offline   Reply With Quote

Old   November 25, 2017, 16:16
Default
  #2
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi,

in your particular case (I am not familiar with the capabilities of blockMesh) I would use setSets and use the sets in order to create a cellZones. Its easy and should be a 3 liner - if you do not have the sets, build a cellSet and based on that, you can create a cellZone.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   November 27, 2017, 01:26
Default
  #3
Senior Member
 
Join Date: Aug 2013
Posts: 407
Rep Power: 16
Antimony is on a distinguished road
Hi,

Not sure how you created your blockMesh, but you can name each block as well. So instead of "region0" and "region1" you could have something like "bigBlock" and "smallBlock"

As Tobi has mentioned you can use setSets to create your cellZones. Alternatively, you can use topoSet and convert these sets (region0 & region1) into cellZones using setToCellZone (Ref: https://github.com/OpenFOAM/OpenFOAM...et/topoSetDict)

Hope this helps.

Cheers,
Antimony
Tobi, Gerhard, hogsonik and 2 others like this.
Antimony is offline   Reply With Quote

Old   November 27, 2017, 05:48
Default
  #4
Senior Member
 
Join Date: Sep 2013
Posts: 353
Rep Power: 21
Bloerb will become famous soon enough
This is how you can create cellZones with blockMesh
Code:
hex (0 1 2 3 4 5 6 7) nameOfCellZone  (1 2 3) simpleGrading (1 1 1)
louisgag, njdyck, nvnkush and 9 others like this.
Bloerb is offline   Reply With Quote

Old   November 27, 2017, 06:13
Default
  #5
Senior Member
 
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 9
deepbandivadekar is on a distinguished road
Whoa, alright. Thanks for your inputs guys. Let me try this out today and I'll update!
deepbandivadekar is offline   Reply With Quote

Old   November 27, 2017, 13:46
Default
  #6
Senior Member
 
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 9
deepbandivadekar is on a distinguished road
OK. Update:

I did not try what Tobi and Antimony suggested as this seemed to work.

Quote:
Originally Posted by Bloerb View Post
This is how you can create cellZones with blockMesh
Code:
hex (0 1 2 3 4 5 6 7) nameOfCellZone  (1 2 3) simpleGrading (1 1 1)
It created the required zones in "cellZones" file.

However when I run the solver (porousSimpleFoam) am now getting "floating point exception (core dumped)" error. The log.porousSimpleFoam file has only this:

Code:
Starting time loop

Time = 1

GAMG:  Solving for p, Initial residual = 1, Final residual = 855359.7971, No Iterations 1000
time step continuity errors : sum local = 2261772.402, global = -549976.5525, cumulative = -549976.5525
smoothSolver:  Solving for epsilon, Initial residual = 0.9989955956, Final residual = 0.04815760269, No Iterations 16
smoothSolver:  Solving for k, Initial residual = 1, Final residual = 0.02483197907, No Iterations 2
ExecutionTime = 625 s  ClockTime = 649 s

Time = 2
1. The time step continuity error is a very big number. Could it be related to this error?
2. While defining the interface boundaries (for the two ducts), I had used mergePatchPairs to project the smaller surface onto the larger surface. "Type" for both of these was wall. Is that a wrong choice? I was a bit skeptical about this since considering my geometry only part of the bigger duct bottom is the real wall while the interface should allow flow.

I have attached my fvSolution and fvScheme files here for reference.

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

ddtSchemes
{
    default         steadyState;
}

gradSchemes
{
    default         Gauss linear;
}

divSchemes
{
    default         none;

    div(phi,U)      bounded Gauss upwind;
    div((nuEff*dev(T(grad(U))))) Gauss linear;
    div(phi,epsilon) bounded Gauss upwind;
    div(phi,k)      bounded Gauss upwind;
}

laplacianSchemes
{
    default          Gauss linear corrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         corrected;
}

fluxRequired
{
    default         no;
    p               ;
}
fvSolution
Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    p
    {
        solver          GAMG;
        tolerance       1e-08;
        relTol          0.05;
        smoother        GaussSeidel;
        cacheAgglomeration on;
        nCellsInCoarsestLevel 20;
        agglomerator    faceAreaPair;
        mergeLevels     1;
    }

    "(U|k|epsilon)"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        nSweeps         2;
        tolerance       1e-07;
        relTol          0.1;
    }
}

SIMPLE
{
    nUCorrectors    2;
    nNonOrthogonalCorrectors 0;
}

relaxationFactors
{
    fields
    {
        p               0.3;
    }
    equations
    {
        U               0.7;
        k               0.9;
        epsilon         0.9;
    }
}
deepbandivadekar is offline   Reply With Quote

Old   November 28, 2017, 10:49
Default
  #7
Senior Member
 
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 9
deepbandivadekar is on a distinguished road
Alright. I found a work around. Although I do not know what is the reason for this.

I shifted the underrelaxation factor for U from equations to fields brackets. And this worked. Which brings up new question. I'm going to open a new thread to clarity about that.

Update: and the thread is here: Difference between "fields" and "equations" relaxation sub-directories in fvSolution

Thank you folks for your help.
andresLearns likes this.
deepbandivadekar is offline   Reply With Quote

Reply

Tags
blockmesh, cellzones, mergepatchpairs, porous


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
HELP----Surface Reaction UDF Ashi Fluent UDF and Scheme Programming 1 May 19, 2020 22:13
UDF: trying to implement a Kinetic Equation source term er.mkumar Fluent UDF and Scheme Programming 35 March 22, 2019 11:20
[Salome] SALOME : How to define several CellZone utawalpa OpenFOAM Meshing & Mesh Conversion 0 March 23, 2018 14:19
Installing OF 1.6 on Mac OS X gschaider OpenFOAM Installation 129 June 19, 2010 10:23
[blockMesh] Is it possible to define a CONSTANT in the blockMesh file? om3ro OpenFOAM Meshing & Mesh Conversion 2 March 19, 2010 03:14


All times are GMT -4. The time now is 04:15.