CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

questions about porous zone multiregion case

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 23, 2021, 14:34
Default questions about porous zone multiregion case
  #1
Senior Member
 
Alan w
Join Date: Feb 2021
Posts: 261
Rep Power: 6
boffin5 is on a distinguished road
Hi,
My case is the simulation of a car radiator, and with help I have completed the mesh setup. This consists of 2 regions, one for the fluid (air) and the other for the solid (the radiator) which will be the porous zone. Also for realism there is a fairing, as shown in the attached image.
I want to run this first simply as 1.) an airflow through the radiator case, and then 2.) as a heat transfer case with a heated radiator. My question today concerns setting up 1.), the simple airflow case.


Following blockMesh, I run splitMeshRegions -cellZones; this creates the two regions. Now, I need to use fvOptions to assign DarcyForchheimer coefficients to set the porous properties of the radiator. Here is where my knowledge gets a bit shaky: fvOptions needs to know a cellZone for the properties. The splitmesh function creates regions. So I used topoSet surfaceToCell to create a cellZone from the radiator stl file. However, I discovered that the surfaceToCell function does not actually split the cells at the radiator surface interface (see image of what it captures).


So how to tell fvOptions which cellZone to use? The splitmesh function created a seemingly appropriate region (see the 3rd image showing the radiator), but do I need to convert this into a cellZone to feed into fvOptions? Is so, how do I do this? Do need to create fluid to solid interface faces? Attached is a zip file of my system folder, and it also includes the radiator stl file.

When I get this resolved, I want to include the heat transfer element into the simulation, but that is part 2.) which is waiting in the wings.


Thanks again for all your help!
Attached Images
File Type: png solid-region.png (184.5 KB, 24 views)
File Type: png radiator-with-fairing.png (184.0 KB, 22 views)
File Type: png surfaceToCell.png (163.4 KB, 26 views)
Attached Files
File Type: zip system.zip (14.1 KB, 5 views)
boffin5 is offline   Reply With Quote

Old   September 23, 2021, 23:00
Default
  #2
Senior Member
 
Alan w
Join Date: Feb 2021
Posts: 261
Rep Power: 6
boffin5 is on a distinguished road
Sorry if anyone spent time looking at my problem; I wasn't optimistic that I would find an answer, but I just discovered regionToCell as a topoSet option. So I'll give it a try. Hoping for success, touch wood, but I may come crawling back!
boffin5 is offline   Reply With Quote

Old   September 24, 2021, 17:04
Default problem with topoSet in creating cellZone
  #3
Senior Member
 
Alan w
Join Date: Feb 2021
Posts: 261
Rep Power: 6
boffin5 is on a distinguished road
Well, I tried but there is a problem. After the initial commands in my radiator case, which create fluid and solid regions, I can't make topoSet create a cellZone for the solid region. I need this cellZone to feed into fvOptions so that the darcyForchheimer coefficients can be defined. Attached are images of my radiator and fairing, and zip files of the constant/triSurface and system folders.

This is my run command sequence:
blockMesh
surfaceFeatures
snappyHexMesh -overwrite
splitMeshRegions -cellZones -overwrite
topoSet
foamToVTK -cellSet porousZone

I followed this example I found for the lines in topoSet:
Code:
actions
(    
       { name    porousCells;
        type    cellSet;
        action  new;
        source regionToCell;
        sourceInfo  {
            set       solid;      // line to indicate which region to use
            nErode    0;
            insidePoints  ((2.1365 -0.2025 0.1097));  // centroid of the radiator
            }            
        }
        
     {  name    porousZone;
        type    cellZoneSet;
        action  new;
        source  setToCellZone;
        sourceInfo  {
            set   porousCells;
                }
     }

);
But when I ran topoSet I got this error message:
Code:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create polyMesh for time = 0

Reading topoSetDict

Time = 0
    mesh not changed.
Created cellSet porousCells
    Applying source regionToCell
    Adding all cells of connected region containing points 1((2.1365 -0.2025 0.1097)) ...
    Loading subset solid to delimit search region.


--> FOAM FATAL ERROR: 
Cannot find directory "polyMesh/sets" in times "0" down to constant

    From function virtual Foam::IOobject Foam::fileOperation::findInstance(const Foam::IOobject&, Foam::scalar, const Foam::word&) const
    in file global/fileOperations/fileOperation/fileOperation.C at line 818.

FOAM exiting
So, in topoSetDict, under sourceInfo I tried changed the word 'set' to 'region' and got this message:
Code:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create polyMesh for time = 0

Reading topoSetDict

Time = 0
    mesh not changed.
Created cellSet porousCells
    Applying source regionToCell
    Adding all cells of connected region containing points 1((2.1365 -0.2025 0.1097)) ...
    Found location (2.1365 -0.2025 0.1097) in cell 37327 on processor 0 in global region 0 out of 1 regions.
    cellSet porousCells now size 338697
Created cellZoneSet porousZone
    Applying source setToCellZone
    Adding all cells from cellSet porousCells ...
    cellZoneSet porousZone now size 338697
End
The problem is, that the porousZone of size 338697 is the entire domain of the blockMesh; the regionToCell function did not stop at the radiator, but just went everywhere.
How do I edit topoSetDict to capture the solid region as a cellZone?
Attached Images
File Type: png radiator-with-fairing.png (184.0 KB, 10 views)
Attached Files
File Type: zip triSurface.zip (2.1 KB, 3 views)
File Type: zip system 2.zip (11.6 KB, 3 views)
boffin5 is offline   Reply With Quote

Old   September 25, 2021, 16:40
Default conflict between splitMeshRegions and checkMesh - or is it?
  #4
Senior Member
 
Alan w
Join Date: Feb 2021
Posts: 261
Rep Power: 6
boffin5 is on a distinguished road
In the process of trying to figure out my problems with the radiator case, I noted the output messages after running splitMeshRegions -CellZones -overwrite, and checkMesh.


From splitMeshRegions, I get:
Code:
Create time

Create mesh for time = 0

Creating single patch per inter-region interface.

Trying to match regions to existing cell zones.


Number of regions:2

Writing region per cell file (for manual decomposition) to "constant/cellToRegion"

Writing region per cell as volScalarField to "0/cellToRegion"

Region    Cells
------    -----
0    325137
1    13560

Region    Zone    Name
------    ----    ----
0    0    fluid
1    1    solid
This shows the number of regions as 2, one for fluid, and one for solid. It seems to indicate that there are 2 cellZones. Then I run checkMesh, which shows:
Code:
Create time

Create polyMesh for time = 0

Time = 0

Mesh stats
    points:           372959
    faces:            1049893
    internal faces:   1013037
    cells:            338697
    faces per cell:   6.09078
    boundary patches: 7
    point zones:      0
    face zones:       1
    cell zones:       2

Overall number of cells of each type:
    hexahedra:     326205
    prisms:        1442
    wedges:        0
    pyramids:      0
    tet wedges:    0
    tetrahedra:    0
    polyhedra:     11050
    Breakdown of polyhedra by number of faces:
        faces   number of cells
            4   3
            5   139
            6   1310
            7   106
            8   37
            9   8363
           11   34
           12   891
           14   1
           15   150
           18   16

Checking topology...
    Boundary definition OK.
    Cell to face addressing OK.
    Point usage OK.
    Upper triangular ordering OK.
    Face vertices OK.
    Number of regions: 1 (OK).
It says that there are 2 cellZones, but only 1 region. But this conflicts with the splitMeshRegion message, which says there are 2 regions. I don't get it. Any ideas? After running foamToVTK -cellSet porousZone, it still shows the porousZone occupying the entire blockMesh domain.
boffin5 is offline   Reply With Quote

Old   September 26, 2021, 15:50
Default
  #5
Senior Member
 
Alan w
Join Date: Feb 2021
Posts: 261
Rep Power: 6
boffin5 is on a distinguished road
Murphy's Law is alive and well. After fighting with topoSet and then giving up and making posts with pleas for help, and while waiting hopefully for responses, I was poking around and ran into a topoSet clue. This involves 'useSurfaceOrientation.'


So I edited topoSetDict as thus:


actions (
{ name porousCells;
type cellSet;
action new;
source surfaceToCell;
sourceInfo {
file "constant/triSurface/radiator.stl";
outsidePoints ();
useSurfaceOrientation true;
includeCut false;
includeInside true;
includeOutside false;
nearDistance -1;
curvature -1;
}
}
{ name porousZone;
type cellZoneSet;
action new;
source setToCellZone;
sourceInfo {
set porousCells;
}
}
)


Then, after running the meshing commands, and foamToVTK -cellSet porousZone,
there it was, the radiator, proudly sitting there in its cuboid glory!


Now, I will attempt to run the case.
boffin5 is offline   Reply With Quote

Old   November 12, 2022, 15:33
Default
  #6
New Member
 
Marius
Join Date: Sep 2022
Posts: 23
Rep Power: 3
Counterdoc is on a distinguished road
Thanks for sharing!
Counterdoc is offline   Reply With Quote

Reply


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
FLUENT porous zone inputs eishinsnsayshin FLUENT 19 April 17, 2020 04:40
contact detection and porous zone 1993saurav FLUENT 0 July 18, 2019 23:20
Cluster ID's not contiguous in compute-nodes domain. ??? Shogan FLUENT 1 May 28, 2014 15:03
[GAMBIT] periodic faces not matching Aadhavan ANSYS Meshing & Geometry 6 August 31, 2013 11:25
Free surface boudary conditions with SOLA-VOF Fan Main CFD Forum 10 September 9, 2006 12:24


All times are GMT -4. The time now is 17:32.