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

[blockMesh] Domain selection

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 18, 2023, 10:10
Default Domain selection
  #1
New Member
 
Filippo Pucci
Join Date: Aug 2023
Posts: 18
Rep Power: 3
filpucfd is on a distinguished road
Hello,

I am generating a multi-region geometry for a conjugate heat transfer problem.

I am using the blockMeshDict to generate what will then give me the solid region, while I import as a triSurfaceMesh the two fluid domains with snappyHexMesh.

At the moment, I have the length of the solid equal to that of the fluid:
---------------------------------------------------------------
| ////////////////////////////////////////////////// solid |
| ////////////////////////////////////////////////// fluid1 |
| ////////////////////////////////////////////////// solid |
| ////////////////////////////////////////////////// fluid2 |
| ////////////////////////////////////////////////// |solid |
---------------------------------------------------------------
However, this is not efficient, as part of the length at the beginning and towards the end of the fluid domains is intended for flow development. I would like to select only part of the solid to be kept in the mesh as a solid region, while maintaining the full bounding box and get all the fluid elements I need???

---------------------------------------------------------------
| ------------////////////////------------ solid |
| ////////////////////////////////////////////////// fluid1 |
| ------------////////////////------------ solid |
| ////////////////////////////////////////////////// fluid2 |
| ------------////////////////------------ solid |
---------------------------------------------------------------

I hope I was clear.
Thank you in advance for your help!

Last edited by filpucfd; October 24, 2023 at 10:53.
filpucfd is offline   Reply With Quote

Old   October 20, 2023, 05:29
Default
  #2
New Member
 
Filippo Pucci
Join Date: Aug 2023
Posts: 18
Rep Power: 3
filpucfd is on a distinguished road
I have managed to get what I want using two different approaches:

1. Define three cylinder domains in blockMesh (with the central being the one I'd like to keep) and just import the fluid geometries stl in with SnappyHexMesh - although I considered it quite inefficient and I found the second method

2. Defined a simple block domain in blockMesh and then defined a cylinder (searchableCylinder) in the geometry function of SHM, along with the fluid stls.

HOWEVER, this works only with a simplified geometry.
If I try to use the same strategy with my actual geometry, it seems like that it doesn't work.
It's like one of the fluid regions absorbs the cells that I would like to assign to the cellZones.

Can anyone help? Does it depend on the refinement of the blockMesh or on the refinement levels I would assign to my SHM surfaces/features?
Or is there another reason?

This is my castellatedMesh

Code:
geometry
{
    unrem_fluid1_cat.stl
    {
    	type distributedTriSurfaceMesh; //triSurfaceMesh;
    	name fluid1;
    	//scale 0.01;
    }
    unrem_fluid2_cat.stl
    {
    	type distributedTriSurfaceMesh;
    	name fluid2;
    	//scale 0.01;
    }
    
    
    cylinder
    {
    	type searchableCylinder;
    	point1 (0. 0. 0.);
    	point2 (0. 0. 1.);
    	radius $solRad;
    }
    
}


// Settings for the castellatedMesh generation.
castellatedMeshControls
{

    // Refinement parameters
    // ~~~~~~~~~~~~~~~~~~~~~

    // If local number of cells is >= maxLocalCells on any processor
    // switches from from refinement followed by balancing
    // (current method) to (weighted) balancing before refinement.
    maxLocalCells 999999999;

    // Overall cell limit (approximately). Refinement will stop immediately
    // upon reaching this number so a refinement level might not complete.
    // Note that this is the number of cells before removing the part which
    // is not 'visible' from the keepPoint. The final number of cells might
    // actually be a lot less.
    maxGlobalCells 999999999;

    // The surface refinement loop might spend lots of iterations
    // refining just a few cells. This setting will cause refinement
    // to stop if <= minimumRefine are selected for refinement. Note:
    // it will at least do one iteration (unless the number of cells
    // to refine is 0)
    minRefinementCells 5000; // 10

    // Number of buffer layers between different levels.
    // 1 means normal 2:1 refinement restriction, larger means slower
    // refinement.
    nCellsBetweenLevels 1; //2
    
    //interfaceRefine true;
    //maxLoadUnbalance 0;
    


    // Explicit feature edge refinement
    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    // Specifies a level for any cell intersected by its edges.
    // This is a featureEdgeMesh, read from constant/triSurface for now.
    features
    (
    	
        {
            file "unrem_fluid1_cat.eMesh";    //"geom.eMesh" // .extendedFeatureEdgeMesh;
            level 0; //1
        }
        {
            file "unrem_fluid2_cat.eMesh";    //"geom.eMesh";
            level 0; //1
        }
    	
    );



    // Surface based refinement
    // ~~~~~~~~~~~~~~~~~~~~~~~~

    // Specifies two levels for every surface. The first is the minimum level,
    // every cell intersecting a surface gets refined up to the minimum level.
    // The second level is the maximum level. Cells that 'see' multiple
    // intersections where the intersections make an
    // angle > resolveFeatureAngle get refined up to the maximum level.

    refinementSurfaces
    {
        fluid1
        {
            // Surface-wise min and max refinement level
            level (0 0);
            regions 
            {
            	inlet1     { level ( 0 0 ); patchInfo { type patch; } }
            	outlet1    { level ( 0 0 ); patchInfo { type patch; } }
		walls1    { level ( 0 0 ); patchInfo { type wall; } }
            }
            faceZone fluid1;
            faceType boundary; //baffle
            cellZone fluid1;
            cellZoneInside inside;
            
        }
        fluid2
        {
            // Surface-wise min and max refinement level
            level (0 0);
            regions 
            {
            	inlet2     { level ( 0 0 ); patchInfo { type patch; } }
            	outlet2    { level ( 0 0 ); patchInfo { type patch; } }
		walls2    { level ( 0 0 ); patchInfo { type wall; } }
            }
            faceZone fluid2;
            faceType boundary; //baffle
            cellZone fluid2;
            cellZoneInside inside;
            
        }
        
        
        //"(fluid1|fluid2)"
        cylinder
        {
                level (0 0);
                cellZone solid;
                faceZone solid;
                faceType boundary;
                cellZoneInside inside;
        }
        
    }

    // Resolve sharp angles
    resolveFeatureAngle 5;


    // Region-wise refinement
    // ~~~~~~~~~~~~~~~~~~~~~~

    // Specifies refinement level for cells in relation to a surface. One of
    // three modes
    // - distance. 'levels' specifies per distance to the surface the
    //   wanted refinement level. The distances need to be specified in
    //   descending order.
    // - inside. 'levels' is only one entry and only the level is used. All
    //   cells inside the surface get refined up to the level. The surface
    //   needs to be closed for this to be possible.
    // - outside. Same but cells outside.

    refinementRegions
    {
        //refinementBox
        //{
        //    mode inside;
        //    levels ((1E15 4));
        //}
    }

    limitRegions
    {
    
    	fluid1
    	{
    		mode inside;
    		levels ((0 0));
    	}
    	fluid2
    	{
    		mode inside;
    		levels ((0 0));
    	}
    
    }
    // Mesh selection
    // ~~~~~~~~~~~~~~

    // After refinement patches get added for all refinementSurfaces and
    // all cells intersecting the surfaces get put into these patches. The
    // section reachable from the locationInMesh is kept.
    // NOTE: This point should never be on a face, always inside a cell, even
    // after refinement.
    locationInMesh (0.0001 0.0001 0.0001); // Offset from (0 0 0) to avoid 
                                           //coinciding with face or edge
    /*
    locationsInMesh
    (
        (( 0.0001 0.0001  0.0001) solid)
    );
    */

    // Whether any faceZones (as specified in the refinementSurfaces)
    // are only on the boundary of corresponding cellZones or also allow
    // free-standing zone faces. Not used if there are no faceZones.
    allowFreeStandingZoneFaces false;
}
EDIT: I solved the problem. The STL file, once remeshed, it was causing this. I am using an unremeshed version and it works.

Last edited by filpucfd; November 14, 2023 at 04:04.
filpucfd 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
Small domain and large domain with local scouring NTNHAN REEF3D 4 March 10, 2023 23:12
OF10 fvModels selects whole domain despite selection certain cellZone geth03 OpenFOAM Running, Solving & CFD 0 December 12, 2022 10:32
Atmospheric BCs for domain with a single boundary serving as both the inlet & outlet Newtonian OpenFOAM Running, Solving & CFD 0 July 21, 2022 15:07
[ICEM] How to generate an unstructured mesh for a 2 fluid domain rotor in ICEM CFD Hazem24 ANSYS Meshing & Geometry 0 December 21, 2020 07:52
Pressure distribution on a wall darazsbence CFX 17 October 6, 2015 11:38


All times are GMT -4. The time now is 20:52.