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

[snappyHexMesh] Removes patches needed in boundary file

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By simrego

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 8, 2020, 15:00
Default Removes patches needed in boundary file
  #1
New Member
 
Join Date: Jun 2020
Posts: 5
Rep Power: 6
SMDpel is on a distinguished road
Hello,

I am having some trouble with SnappyHexMesh removing several zero-sized patches. The patches I need are inlet and outlet, and I am unsure as to why they are zero sized, as I defined them firstly using Salome so they were different solids in the .stl file and then set the refinement levels to 1, as you can see below:

Code:
/
castellatedMesh on;
snap            off;
addLayers       off;

geometry
{
     CAC  
    {
        type            triSurfaceMesh;
        file		"CAC.stl";
        regions
        {
         CAC		{name Solid; }
        }
    }
            
     ChargeAir
      {
    	type 		triSurfaceMesh;
    	file		"ChargeAir.stl";
    	regions
    	{
    	   ChargeAir	   {name ChargeAir; }
    	   inlet 	   {name inlet; }
    	   outlet 	   {name outlet; }
    	}
      }
      
      CoolAir
      {
    	type 		triSurfaceMesh;
    	file		"CoolAir.stl";
/*    	regions*/
/*    	{*/
/*    	   CoolAir	   { name CoolAir; }*/
/*    	}*/
      }
};
// ============================================================== CASTELLATION ============================================================== \\

castellatedMeshControls
{
	MaxLocalCells 10000000; // Max number of cells per CPU core
	MaxGlobalCells 20000000; // Max number of cells to use before deletion
	minRefinementCells 0 ; // Allowable number of bad cells during refinement
	MaxLoadUnbalance 0.006; 
	nCellsBetweenLevels 4; // expansion factor between high & low refinement zone
	allowFreeStandingZoneFaces false;
	
    features
    (
    	{file "CAC.eMesh"; levels ((1 1));}
    	{file "ChargeAir.eMesh"; levels ((1 1));}
    	{file "CoolAir.eMesh"; level 1;}
    );
    

    refinementSurfaces
    {
        "CAC_*"
        {
            level	    (1 1);	
            faceZone        CAC;
            cellZone        CAC;
            cellZoneInside inside;
            regions
             {
              	Solid        
              	{ 
              		level (1 1); patchInfo { type wall; } 
              	}  
     	    }	
      	}
      		
        "ChargeAir_*"
        {
            level 	    (1 1);  
            faceZone        ChargeAir;
            cellZone        ChargeAir;
            cellZoneInside  inside;
            regions
            {
            	inlet               { level (1 1); patchInfo { type patch; } }
                outlet              { level (1 1); patchInfo { type patch; } }
                ChargeAir           { level (1 1); patchInfo { type wall; } }
            }
        }
        
        CoolAir
        {
           level 	    (1 1);  
           faceZone        CoolAir;
           cellZone        CoolAir;
           cellZoneInside  inside;
        }
    }

    refinementRegions
    {
    }

    locationInMesh (0 0.02 0.02);

    resolveFeatureAngle 0;
}
The blockMesh currently covers the whole area and is extremely fine, as there were issues with resolution.

When I run splitMeshRegions, I get a boundary file which looks like this:

Code:
4
(
    defaultFaces
    {
        type            empty;
        inGroups        List<word> 1(empty);
        nFaces          9693;
        startFace       1822857;
    }
    oldInternalFaces
    {
        type            empty;
        inGroups        List<word> 1(empty);
        nFaces          34081;
        startFace       1832550;
    }
    CAC_to_ChargeAir
    {
        type            mappedWall;
        inGroups        List<word> 1(wall);
        nFaces          741841;
        startFace       1866631;
        sampleMode      nearestPatchFace;
        sampleRegion    ChargeAir;
        samplePatch     ChargeAir_to_CAC;
    }
    CAC_to_CoolAir
    {
        type            mappedWall;
        inGroups        List<word> 1(wall);
        nFaces          779779;
        startFace       2608472;
        sampleMode      nearestPatchFace;
        sampleRegion    CoolAir;
        samplePatch     CoolAir_to_CAC;
    }
)

// ************************************************************************* //
.

Is there any way to get snappyHexMesh to keep the patches?

Thanks in advance.

################################################## ###########Solution############################### ################################################## #:
The .stl files must be separate, you can not have regions of Solid regionname to endsolid regionname, they must be individual stl files. It's quite easy to use Salome to do this and have a closed surface in the end.

Cheers

Last edited by SMDpel; September 10, 2020 at 20:09. Reason: FIXED PROBLEM FOR MULTIREGION MESHING
SMDpel is offline   Reply With Quote

Old   September 9, 2020, 06:52
Default
  #2
Senior Member
 
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14
simrego is on a distinguished road
Hi!


Can you share your geometry and background mesh? And the resulted mesh boundary befor the splitMeshRegions?


And also I guess you are looking at the wrong boundary file. You have your inlet/outlet in the chargeAir region (cellZone), but you are looking at the CAC region.
simrego is offline   Reply With Quote

Old   September 9, 2020, 11:17
Default
  #3
New Member
 
Join Date: Jun 2020
Posts: 5
Rep Power: 6
SMDpel is on a distinguished road
Thanks for the reply!

Unfortunately, I cannot share the geometry as it's confidential. And yes, thank you for pointing that out; I was looking in the wrong boundary file. However, the boundary file for charge air is similar and missing the inlet and outlet:

Code:
    location    "constant/ChargeAir/polyMesh";
    object      boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

4
(
    defaultFaces
    {
        type            empty;
        inGroups        List<word> 1(empty);
        nFaces          11865;
        startFace       10468674;
    }
    oldInternalFaces
    {
        type            empty;
        inGroups        List<word> 1(empty);
        nFaces          11801;
        startFace       10480539;
    }
    ChargeAir_to_CAC
    {
        type            mappedWall;
        inGroups        List<word> 1(wall);
        nFaces          741291;
        startFace       10492340;
        sampleMode      nearestPatchFace;
        sampleRegion    CAC;
        samplePatch     CAC_to_ChargeAir;
    }
    ChargeAir_to_CoolAir
    {
        type            mappedWall;
        inGroups        List<word> 1(wall);
        nFaces          19477;
        startFace       11233631;
        sampleMode      nearestPatchFace;
        sampleRegion    CoolAir;
        samplePatch     CoolAir_to_ChargeAir;
    }
)

// ************************************************************************* //
Before splitmeshregions, the same boundaries occur, except without the ChargeAir_to_CoolAir patches.

I think it's due to snappyHexMesh removing these zero sized patches, as seen here:
Code:
Doing final balancing
---------------------

Found 14580 zoned faces to keep together.
Found 0 separated coupled faces to keep together.

Removing zero-sized patches:
    Solid type wall at position 1
    Solid_slave type wall at position 2
    inlet type patch at position 3
    inlet_slave type patch at position 4
    outlet type patch at position 5
    outlet_slave type patch at position 6
    ChargeAir type wall at position 7
    ChargeAir_slave type wall at position 8
    CoolAir type wall at position 9
    CoolAir_slave type wall at position 10
SMDpel is offline   Reply With Quote

Old   September 9, 2020, 11:31
Default
  #4
Senior Member
 
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14
simrego is on a distinguished road
Check If the patch is present but under a different name. The inlet and outlet patches are internals? So on the other side of the patches you have an another region? I guess it is since you have a zero sized patch called inlet and inlet_slave, also outlet and outlet_slave. So I think you have your patches (az least needed patch faces) but they will be in the chargeAir_to_CAC or in the chargeAir_to_CoolAir patches.


But it is pretty hard to tell blindly. I'm just guessing.
SMDpel likes this.
simrego is offline   Reply With Quote

Old   September 9, 2020, 11:38
Default
  #5
New Member
 
Join Date: Jun 2020
Posts: 5
Rep Power: 6
SMDpel is on a distinguished road
Thank you!

I am sorry that you're having to guess blindly. Is there any way of checking inside a patch? I assumed because they're being deleted in snappyHexMesh that they would not appear anywhere.

Should the patches be on the edge of my blockMesh? Or are they okay being inside? I should mention that this is a multiregion mesh I'm trying to produce.
SMDpel is offline   Reply With Quote

Old   September 9, 2020, 12:20
Default
  #6
Senior Member
 
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14
simrego is on a distinguished road
Yes I figured it out that you have a multiRegion case. And I guess this is the source of your "problem". So in multi region if you have a patch (now inlet patch) between two regions, it won'T be called inlet. it will be in the "<sourceRegionName>_to_<targetRegionname>" patch. So the faces from the inlet patch will be moved to the "<sourceRegionName>_to_<targetRegionname>" patch and the inlet patch will be empty and snappy will delete it.
Open your resulted mesh in paraview and check the patches only (turn off the internal mesh) in the ChargeAir region. If you will see the faces which should be in the inlet patch, probably this will be your problem.
simrego is offline   Reply With Quote

Old   September 9, 2020, 13:23
Default
  #7
New Member
 
Join Date: Jun 2020
Posts: 5
Rep Power: 6
SMDpel is on a distinguished road
Yeah, I see the faces that should be the inlet patch included in the "ChargeAir_to_.." patches.

Is there any way to stop this from happening? I don't really know of any other way, and I would really prefer to keep it all in snappyHexMesh.

cheers
SMDpel is offline   Reply With Quote

Old   September 9, 2020, 13:31
Default
  #8
Senior Member
 
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14
simrego is on a distinguished road
Probably there is, but honestly I have never did something like this. How can you have an inlet if in the neighbor region there is something? It seems impossible to me.


But if you check this:
https://github.com/OpenFOAM/OpenFOAM...ppyHexMeshDict
at line 199, you can change the faceType but as I mentioned I have never did something like this. It is still seems impossible to me in the physical world.
simrego is offline   Reply With Quote

Old   September 9, 2020, 14:03
Default
  #9
New Member
 
Join Date: Jun 2020
Posts: 5
Rep Power: 6
SMDpel is on a distinguished road
Actually, in my model, there isn't a neighbour region: the inlet is on the boundary of the model, please see a limited view attached:



This is an stl file, but this is on the boundary of my domain, and should be fine?

Last edited by SMDpel; September 9, 2020 at 14:04. Reason: Picture didn't load
SMDpel is offline   Reply With Quote

Reply

Tags
multiregion, patches, zero-sized


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] swak4foam for OpenFOAM 4.0 mnikku OpenFOAM Community Contributions 80 May 17, 2022 09:06
[swak4Foam] funkyDoCalc with OF2.3 massflow NiFl OpenFOAM Community Contributions 14 November 25, 2020 04:30
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 20:08
ParaView Compilation jakaranda OpenFOAM Installation 3 October 27, 2008 12:46


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