CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   chtMultiRegionFoam + Sphere mesh + makeCellset.setSets (https://www.cfd-online.com/Forums/openfoam/86372-chtmultiregionfoam-sphere-mesh-makecellset-setsets.html)

alvora March 21, 2011 08:53

chtMultiRegionFoam + Sphere mesh + makeCellset.setSets
 
Hello friends,

I am using chtmultiregion foam to solve my problem. I changed the chtmultiregionFoam solve according to my requirement and I run on heater problem which gave perfect result.
But, I need sphere in my problem instead of heater. Two spheres are in one cube.

I also found the command "cylinderToCell" from utilities/mesh/manipulation/cellsets.

In heater problem, the geometry is simple, hence, it is easy to define by blockMesh and after that by makeCellSet.setSets. But, for sphere, how we can define in blockMeshDict and makecellSet.setSet file?
can we define cube in blockMeshDict and sphere from makecellset.setset file by using cylinderToCell command? if yes, how we can subtract a sphere from the cube?
Or should I have to use snappyHexMesh? then, can snappyHexMesh combine in shtmultiregionfom for two different region?

or should I have to make a geometry in gmsh or any other software and import in opefoam?

please, tell me which one is possible and easy..
Thanx in advance

kind regards
Alpesh

fcollonv March 21, 2011 09:49

Hello Alpesh,

It is even easier than that. You can use sphereToCell

cellSet c0 new sphereToCell (cx cy cz) R

Usage: sphereToCell (centreX centreY centreZ) radius
Select all cells with cellCentre within bounding sphere

Good luck,

Frederic

PS: Remember that the sphere won't have a spherical shape but will be approximate by the elements (probably hexahedrons) of the mesh. If you really need a good surface, you will have to move to dedicated mesh tools.

alvora March 21, 2011 10:08

Hi Frederic Collonval,

Thank you very much for your reply...

I tried with that and I got sphere shape but it is not really sphere.. I think I have to use very dense mesh..then surface will transform in spherical shape..
But, I am getting problem in surrounding air region.. should I have to define surrounding region in makecellsets.setset or in blockmeshDict?

regards
alpesh

fcollonv March 21, 2011 11:47

Generate geometry for multi-domain simulation
 
Quote:

Originally Posted by alvora (Post 300371)
I tried with that and I got sphere shape but it is not really sphere.. I think I have to use very dense mesh..then surface will transform in spherical shape..

It is what I meant with the PS before...


Quote:

But, I am getting problem in surrounding air region.. should I have to define surrounding region in makecellsets.setset or in blockmeshDict?
Okay let describe the Allrun script of the tutorial chtMultiRegionSimpleFoam
Code:

rm -rf constant/polyMesh/sets //remove the previous sub-parts of the mesh

runApplication blockMesh // create the mesh for all parts (don't care about the properties of the cells)
runApplication setSet -batch makeCellSets.setSet // split the mesh in sub region - the best is selected obvious part (like the sphere) in separate cellSet and select the other cells by selecting all the previously created parts and finally inverting the selection

rm -f constant/polyMesh/sets/*_old // Remove not needed part

runApplication setsToZones -noFlipMap // Transform the sets in Zones
runApplication splitMeshRegions -cellZones -overwrite // create the regions from the zones

So a solution is to create the mesh with blockMesh having the size of the cube. Then you select the two spheres in dedicated cellSet and create a last set containing every cells except those of the spheres.

Good luck,

Frederic

alvora March 22, 2011 02:44

Hi Frederic Collonval,

Thank you very much for your help..

I tried and it's working perfectly..
but, when I tried to make dense mesh, some pointer error came. so, I think I have to make mesh in other opensource pre-processing software to get perfect sphere shape. can I do that way?

again thanx alt..

regards
Alpesh


All times are GMT -4. The time now is 16:13.