CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

Need help setting up chtMultiRegion

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 23, 2019, 09:42
Default Need help setting up chtMultiRegion
  #1
New Member
 
Oskar T
Join Date: Sep 2019
Posts: 8
Rep Power: 7
OskarT is on a distinguished road
I am currently learning how to setup a chtMultiRegion problem but I'm having hard time finding a good tutorial or walkthrough on how to set it up.

I have created an incredible easy heat sink which I wish to flow air through. The air will pickup some heat which will be dissipated from the flange which will have an energy flux assigned into it (I believe this is a boundary condition).
I have: A heat sink (solid) inside a "wind-tunnel" (Inlet, Outlet and walls) blowing air.

The sink has been exported from my CAD-software as an '.stl'-file. I have found tutorials showing how to create the mesh and split the regions (using snappyHexMesh) and managed to do just that.

My commands are as follow:
  • blockMesh
  • snappyHexMesh -overwrite
  • splitMeshRegions -cellZones -overwrite

In my boundary condition (0), system and constant folder I now have three folders; domain1, Heater and Outside.
Now I don't know how to continue setting up the boundary conditions and the rest of the case necessary to run a simulation. Any ideas or guidance is appreciated!

snappyHexMeshDict
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1906                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#includeEtc "caseDicts/mesh/generation/snappyHexMeshDict.cfg"
// Which of the steps to run
castellatedMesh true;
snap            false;
addLayers       false;



geometry
{
	Outside
	{
		type	searchableBox;
		min		(-0.1 -0.05 0.001);
		max 	(0.2  0.07 0.1);
	
	}
    Heater
    {
        type triSurfaceMesh;
        file "Faces.stl";
    }
};


castellatedMeshControls
{
	// Specifies a level for any cell intersected by its edges.
    // This is a featureEdgeMesh, read from constant/triSurface for now.
    features
    (
		{ file "Faces.eMesh"; level 3; }
    );



    refinementSurfaces
    {
		Outside
		{
			level	(1 1);
			faceZone	Outside;
			cellZone	Outside;
			cellZoneInside	inside;
		}
        Heater
        {
            level	(2 2);
			faceZone	Heater;
			cellZone	Heater;
			cellZoneInside	inside;
        }

    }
	resolveFeatureAngle 30;
	    refinementRegions
    {
    }
    locationInMesh (0.05 0.01 0.01); // Offset from (0 0 0) to avoid coinciding with face or edge
	allowFreeStandingZoneFaces true;
	maxLocalCells 1500000;
    maxGlobalCells 2000000;
	minRefinementCells 1;
    nCellsBetweenLevels 3;

}



// Settings for the snapping.
snapControls
{
	implicitFeatureSnap true;
	explicitFeatureSnap false;
    nSmoothPatch 3;
    tolerance 2;
    nSolveIter 110;
    nRelaxIter 5;
}




// Settings for the layer addition.
addLayersControls
{
    layers
    {
        "Car.*"
        {
            nSurfaceLayers 15;
        }  
    }

    relativeSizes       false; // false means you specify the minthickness
    expansionRatio      1.15;
//    finalLayerThickness 1e-2;		// Either final or first + expansionRatio must be specified
    minThickness        1e-3;
    firstLayerThickness 2e-3;

//  maxThicknessToMedialRatio 0.6;
	featureAngle 120;

}




// Generic mesh quality settings. At any undoable phase these determine
// where to undo.
meshQualityControls
{
    minTetQuality -1e+30;
}

/*writeFlags
(
//    scalarLevels
    layerSets
    layerFields
); */

mergeTolerance 1e-6;

// ************************************************************************* //
blockMeshDict
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1906                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

scale   1;

vertices
(
    (-0.1 -0.05 -0.001) // 0
    ( 0.2 -0.05 -0.001) // 1
    ( 0.2  0.07 -0.001) // 2
    (-0.1  0.07 -0.001) // 3
    (-0.1 -0.05 0.1) // 4
    ( 0.2 -0.05 0.1) // 5
    ( 0.2  0.07 0.1) // 6
    (-0.1  0.07 0.1) // 7
);

blocks
(
    hex (0 1 2 3 4 5 6 7) (30 13 10) simpleGrading (1 1 1)
);

edges
(
);

boundary
(
    Sym1
    {
        type symmetryPlane;
        faces
        (
            (0 1 5 4)
        );
    }
    Sym2
    {
        type symmetryPlane;
        faces
        (
            (3 7 6 2)
        );
    }
    Inlet
    {
        type patch;
        faces
        (
            (0 4 7 3)
        );
    }
    Outlet
    {
        type patch;
        faces
        (
            (1 2 6 5)
        );
    }
    Ground
    {
        type wall;
        faces
        (
            (0 3 2 1)
        );
    }
    Top
    {
        type symmetryPlane;
        faces
        (
            (7 6 5 4)
        );
    }
);


// ************************************************************************* //
STL-file of the heat sink
Code:
solid Volume
  facet normal	-4.440892098500626e-19	  -0.001	  3.3306690738754697e-19	  
    outer loop
      vertex		0.0	  	0.0	  	0.0	  
      vertex		0.02	  	-8.881784197001253e-18	  	7.771561172376097e-18	  
      vertex		0.02	  	-3.731384267595481e-18	  	0.015463560104370118	  
    endloop
  endfacet
  facet normal	-4.440892098500626e-19	  -0.001	  3.3306690738754697e-19	  
    outer loop
      vertex		-8.584000447031584e-18	  	5.150399929405771e-18	  	0.015463560104370118	  
      vertex		0.0	  	0.0	  	0.0	  
      vertex		0.02	  	-3.731384267595481e-18	  	0.015463560104370118	  
    endloop
  endfacet
  facet normal	0.0	  0.0	  0.001	  
    outer loop
      vertex		-7.843851199259514e-18	  	0.003333333253860474	  	0.015463560104370118	  
      vertex		-8.584000447031584e-18	  	5.150399929405771e-18	  	0.015463560104370118	  
      vertex		0.02	  	-3.731384267595481e-18	  	0.015463560104370118	  
    endloop
  endfacet
  facet normal	-0.0	  0.0	  0.001	  
    outer loop
      vertex		-7.843851199259514e-18	  	0.003333333253860474	  	0.015463560104370118	  
      vertex		0.02	  	-3.731384267595481e-18	  	0.015463560104370118	  
      vertex		0.02	  	0.003333333253860474	  	0.015463560104370118	  
    endloop
  endfacet
  facet normal	0.0	  0.001	  -0.0	  
    outer loop
      vertex		-9.251858185612576e-19	  	0.003333333253860474	  	0.003	  
      vertex		-7.843851199259514e-18	  	0.003333333253860474	  	0.015463560104370118	  
      vertex		0.02	  	0.003333333253860474	  	0.015463560104370118	  
    endloop
  endfacet
  facet normal	0.0	  0.001	  0.0	  
    outer loop
      vertex		-9.251858185612576e-19	  	0.003333333253860474	  	0.003	  
      vertex		0.02	  	0.003333333253860474	  	0.015463560104370118	  
      vertex		0.02	  	0.003333333253860474	  	0.003	  
    endloop
  endfacet
  facet normal	0.0	  0.0	  0.001	  
    outer loop
      vertex		1.850371663592295e-19	  	0.008333333015441894	  	0.003	  
      vertex		-9.251858185612576e-19	  	0.003333333253860474	  	0.003	  
      vertex		0.02	  	0.003333333253860474	  	0.003	  
    endloop
  endfacet
  facet normal	-0.0	  0.0	  0.001	  
    outer loop
      vertex		1.850371663592295e-19	  	0.008333333015441894	  	0.003	  
      vertex		0.02	  	0.003333333253860474	  	0.003	  
      vertex		0.02	  	0.008333333015441894	  	0.003	  
    endloop
  endfacet
  facet normal	0.0	  -0.001	  0.0	  
    outer loop
      vertex		1.850371663592295e-19	  	0.008333333015441894	  	0.003	  
      vertex		0.02	  	0.008333333015441894	  	0.003	  
      vertex		0.02	  	0.008333333015441894	  	0.015463560104370118	  
    endloop
  endfacet
  facet normal	0.0	  -0.001	  0.0	  
    outer loop
      vertex		-6.733628598150831e-18	  	0.008333333015441894	  	0.015463560104370118	  
      vertex		1.850371663592295e-19	  	0.008333333015441894	  	0.003	  
      vertex		0.02	  	0.008333333015441894	  	0.015463560104370118	  
    endloop
  endfacet
  facet normal	0.0	  0.0	  0.001	  
    outer loop
      vertex		-6.733628598150831e-18	  	0.008333333015441894	  	0.015463560104370118	  
      vertex		0.02	  	0.008333333015441894	  	0.015463560104370118	  
      vertex		0.02	  	0.011666666984558106	  	0.015463560104370118	  
    endloop
  endfacet
  facet normal	-0.0	  0.0	  0.001	  
    outer loop
      vertex		-5.9934797738952354e-18	  	0.011666666984558106	  	0.015463560104370118	  
      vertex		-6.733628598150831e-18	  	0.008333333015441894	  	0.015463560104370118	  
      vertex		0.02	  	0.011666666984558106	  	0.015463560104370118	  
    endloop
  endfacet
  facet normal	0.0	  0.001	  -0.0	  
    outer loop
      vertex		9.251858185612576e-19	  	0.011666666984558106	  	0.003	  
      vertex		-5.9934797738952354e-18	  	0.011666666984558106	  	0.015463560104370118	  
      vertex		0.02	  	0.011666666984558106	  	0.015463560104370118	  
    endloop
  endfacet
  facet normal	0.0	  0.001	  0.0	  
    outer loop
      vertex		9.251858185612576e-19	  	0.011666666984558106	  	0.003	  
      vertex		0.02	  	0.011666666984558106	  	0.015463560104370118	  
      vertex		0.02	  	0.011666666984558106	  	0.003	  
    endloop
  endfacet
  facet normal	0.0	  0.0	  0.001	  
    outer loop
      vertex		9.251858185612576e-19	  	0.011666666984558106	  	0.003	  
      vertex		0.02	  	0.011666666984558106	  	0.003	  
      vertex		0.02	  	0.01666666603088379	  	0.003	  
    endloop
  endfacet
  facet normal	-0.0	  0.0	  0.001	  
    outer loop
      vertex		2.0354089490655326e-18	  	0.01666666603088379	  	0.003	  
      vertex		9.251858185612576e-19	  	0.011666666984558106	  	0.003	  
      vertex		0.02	  	0.01666666603088379	  	0.003	  
    endloop
  endfacet
  facet normal	0.0	  -0.001	  0.0	  
    outer loop
      vertex		2.0354089490655326e-18	  	0.01666666603088379	  	0.003	  
      vertex		0.02	  	0.01666666603088379	  	0.003	  
      vertex		0.02	  	0.01666666603088379	  	0.015463560104370118	  
    endloop
  endfacet
  facet normal	0.0	  -0.001	  0.0	  
    outer loop
      vertex		-4.8832567492700795e-18	  	0.01666666603088379	  	0.015463560104370118	  
      vertex		2.0354089490655326e-18	  	0.01666666603088379	  	0.003	  
      vertex		0.02	  	0.01666666603088379	  	0.015463560104370118	  
    endloop
  endfacet
  facet normal	0.0	  0.0	  0.001	  
    outer loop
      vertex		-4.143107925014484e-18	  	0.02	  	0.015463560104370118	  
      vertex		-4.8832567492700795e-18	  	0.01666666603088379	  	0.015463560104370118	  
      vertex		0.02	  	0.01666666603088379	  	0.015463560104370118	  
    endloop
  endfacet
  facet normal	-0.0	  0.0	  0.001	  
    outer loop
      vertex		-4.143107925014484e-18	  	0.02	  	0.015463560104370118	  
      vertex		0.02	  	0.01666666603088379	  	0.015463560104370118	  
      vertex		0.02	  	0.02	  	0.015463560104370118	  
    endloop
  endfacet
  facet normal	0.0	  0.001	  -0.0	  
    outer loop
      vertex		4.440892098500626e-18	  	0.02	  	-1.1102230246251566e-17	  
      vertex		-4.143107925014484e-18	  	0.02	  	0.015463560104370118	  
      vertex		0.02	  	0.02	  	0.015463560104370118	  
    endloop
  endfacet
  facet normal	0.0	  0.001	  0.0	  
    outer loop
      vertex		4.440892098500626e-18	  	0.02	  	-1.1102230246251566e-17	  
      vertex		0.02	  	0.02	  	0.015463560104370118	  
      vertex		0.02	  	0.02	  	-3.3306690738754695e-18	  
    endloop
  endfacet
  facet normal	3.885780586188048e-19	  -5.551115123125783e-19	  -0.001	  
    outer loop
      vertex		0.0	  	0.0	  	0.0	  
      vertex		4.440892098500626e-18	  	0.02	  	-1.1102230246251566e-17	  
      vertex		0.02	  	0.02	  	-3.3306690738754695e-18	  
    endloop
  endfacet
  facet normal	3.885780586188048e-19	  -5.551115123125783e-19	  -0.001	  
    outer loop
      vertex		0.0	  	0.0	  	0.0	  
      vertex		0.02	  	0.02	  	-3.3306690738754695e-18	  
      vertex		0.02	  	-8.881784197001253e-18	  	7.771561172376097e-18	  
    endloop
  endfacet
  facet normal	-0.001	  0.0	  -7.771560642980504e-19	  
    outer loop
      vertex		-2.331468351712829e-18	  	0.01666666603088379	  	0.003	  
      vertex		-1.2017600117624449e-17	  	0.01666666603088379	  	0.015463560104370118	  
      vertex		-1.2017600117624449e-17	  	0.02	  	0.015463560104370118	  
    endloop
  endfacet
  facet normal	-0.001	  6.57312606368018e-26	  -7.771560642980504e-19	  
    outer loop
      vertex		-2.331468351712829e-18	  	0.01666666603088379	  	0.003	  
      vertex		-1.2017600117624449e-17	  	0.02	  	0.015463560104370118	  
      vertex		6.162975822039155e-33	  	0.02	  	-1.5543122344752193e-17	  
    endloop
  endfacet
  facet normal	-0.001	  0.0	  -7.771561172376096e-19	  
    outer loop
      vertex		-2.331468351712829e-18	  	0.011666666984558106	  	0.003	  
      vertex		-2.331468351712829e-18	  	0.01666666603088379	  	0.003	  
      vertex		6.162975822039155e-33	  	0.02	  	-1.5543122344752193e-17	  
    endloop
  endfacet
  facet normal	-0.001	  0.0	  -7.771560642980504e-19	  
    outer loop
      vertex		-2.331468351712829e-18	  	0.008333333015441894	  	0.003	  
      vertex		-1.2017600117624449e-17	  	0.008333333015441894	  	0.015463560104370118	  
      vertex		-1.2017600117624449e-17	  	0.011666666984558106	  	0.015463560104370118	  
    endloop
  endfacet
  facet normal	-0.001	  0.0	  -7.771560642980504e-19	  
    outer loop
      vertex		-2.331468351712829e-18	  	0.008333333015441894	  	0.003	  
      vertex		-1.2017600117624449e-17	  	0.011666666984558106	  	0.015463560104370118	  
      vertex		-2.331468351712829e-18	  	0.011666666984558106	  	0.003	  
    endloop
  endfacet
  facet normal	-0.001	  0.0	  -7.771560642980504e-19	  
    outer loop
      vertex		-2.331468351712829e-18	  	0.003333333253860474	  	0.003	  
      vertex		-1.2017600117624449e-17	  	1.7168000470546694e-18	  	0.015463560104370118	  
      vertex		-1.2017600117624449e-17	  	0.003333333253860474	  	0.015463560104370118	  
    endloop
  endfacet
  facet normal	-0.001	  0.0	  -7.771561172376096e-19	  
    outer loop
      vertex		0.0	  	0.0	  	0.0	  
      vertex		-2.331468351712829e-18	  	0.003333333253860474	  	0.003	  
      vertex		-2.331468351712829e-18	  	0.008333333015441894	  	0.003	  
    endloop
  endfacet
  facet normal	-0.001	  0.0	  -7.771561172376096e-19	  
    outer loop
      vertex		0.0	  	0.0	  	0.0	  
      vertex		-2.331468351712829e-18	  	0.008333333015441894	  	0.003	  
      vertex		-2.331468351712829e-18	  	0.011666666984558106	  	0.003	  
    endloop
  endfacet
  facet normal	-0.001	  -2.9582283945787943e-34	  -7.771561172376096e-19	  
    outer loop
      vertex		0.0	  	0.0	  	0.0	  
      vertex		-2.331468351712829e-18	  	0.011666666984558106	  	0.003	  
      vertex		6.162975822039155e-33	  	0.02	  	-1.5543122344752193e-17	  
    endloop
  endfacet
  facet normal	-0.001	  -6.573127325857629e-26	  -7.771560642980504e-19	  
    outer loop
      vertex		0.0	  	0.0	  	0.0	  
      vertex		-1.2017600117624449e-17	  	1.7168000470546694e-18	  	0.015463560104370118	  
      vertex		-2.331468351712829e-18	  	0.003333333253860474	  	0.003	  
    endloop
  endfacet
  facet normal	0.001	  -0.0	  0.0	  
    outer loop
      vertex		0.02	  	0.01666666603088379	  	0.015463560104370118	  
      vertex		0.02	  	0.01666666603088379	  	0.003	  
      vertex		0.02	  	0.02	  	0.015463560104370118	  
    endloop
  endfacet
  facet normal	0.001	  0.0	  0.0	  
    outer loop
      vertex		0.02	  	0.02	  	0.015463560104370118	  
      vertex		0.02	  	0.01666666603088379	  	0.003	  
      vertex		0.02	  	0.02	  	-7.771561172376097e-18	  
    endloop
  endfacet
  facet normal	0.001	  0.0	  0.0	  
    outer loop
      vertex		0.02	  	0.01666666603088379	  	0.003	  
      vertex		0.02	  	0.011666666984558106	  	0.003	  
      vertex		0.02	  	0.02	  	-7.771561172376097e-18	  
    endloop
  endfacet
  facet normal	0.001	  -0.0	  0.0	  
    outer loop
      vertex		0.02	  	0.008333333015441894	  	0.015463560104370118	  
      vertex		0.02	  	0.008333333015441894	  	0.003	  
      vertex		0.02	  	0.011666666984558106	  	0.015463560104370118	  
    endloop
  endfacet
  facet normal	0.001	  0.0	  0.0	  
    outer loop
      vertex		0.02	  	0.011666666984558106	  	0.015463560104370118	  
      vertex		0.02	  	0.008333333015441894	  	0.003	  
      vertex		0.02	  	0.011666666984558106	  	0.003	  
    endloop
  endfacet
  facet normal	0.001	  -0.0	  0.0	  
    outer loop
      vertex		0.02	  	-7.164983938188346e-18	  	0.015463560104370118	  
      vertex		0.02	  	0.003333333253860474	  	0.003	  
      vertex		0.02	  	0.003333333253860474	  	0.015463560104370118	  
    endloop
  endfacet
  facet normal	0.001	  -0.0	  0.0	  
    outer loop
      vertex		0.02	  	0.003333333253860474	  	0.003	  
      vertex		0.02	  	-8.881784197001253e-18	  	7.771561172376097e-18	  
      vertex		0.02	  	0.008333333015441894	  	0.003	  
    endloop
  endfacet
  facet normal	0.001	  -0.0	  0.0	  
    outer loop
      vertex		0.02	  	0.008333333015441894	  	0.003	  
      vertex		0.02	  	-8.881784197001253e-18	  	7.771561172376097e-18	  
      vertex		0.02	  	0.011666666984558106	  	0.003	  
    endloop
  endfacet
  facet normal	0.001	  0.0	  0.0	  
    outer loop
      vertex		0.02	  	0.011666666984558106	  	0.003	  
      vertex		0.02	  	-8.881784197001253e-18	  	7.771561172376097e-18	  
      vertex		0.02	  	0.02	  	-7.771561172376097e-18	  
    endloop
  endfacet
  facet normal	0.001	  0.0	  0.0	  
    outer loop
      vertex		0.02	  	-7.164983938188346e-18	  	0.015463560104370118	  
      vertex		0.02	  	-8.881784197001253e-18	  	7.771561172376097e-18	  
      vertex		0.02	  	0.003333333253860474	  	0.003	  
    endloop
  endfacet
endsolid Volume

Last edited by OskarT; September 23, 2019 at 11:39.
OskarT is offline   Reply With Quote

Old   September 25, 2019, 16:51
Default
  #2
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 15
clapointe is on a distinguished road
There are many cht tutorials distributed with OpenFOAM : https://github.com/OpenFOAM/OpenFOAM...ultiRegionFoam. I've not looked at them, but snappyMultiRegionHeater sounds like it'd be helpful.

Caelan
clapointe is offline   Reply With Quote

Reply

Tags
cht, heat transfer, multi region, snappyhexmesh


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 Parallelization Problem After AC Power Dropped pawl Hardware 5 November 13, 2016 07:08
using chemkin JMDag2004 OpenFOAM Pre-Processing 2 March 8, 2016 23:38
[snappyHexMesh] determining displacement for added points CFDnewbie147 OpenFOAM Meshing & Mesh Conversion 1 October 22, 2013 10:53
Cells with t below lower limit Purushothama Siemens 2 May 31, 2010 22:58
Warning 097- AB Siemens 6 November 15, 2004 05:41


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