CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [mesh manipulation] topoSet for stl files (https://www.cfd-online.com/Forums/openfoam-meshing/219362-toposet-stl-files.html)

Owais Shabbir July 24, 2019 11:55

topoSet for stl files
 
3 Attachment(s)
Dear All,

I am starting to work with topoSet and it is slightly confusing when it comes to using .stl files in it.
My goal is bring set of batteries generating heat due to charging in chtMultiRegion solver.

I have few questions that if someone could answer, it will be highly appreciated.

1) In snappyHexMeshDict when I set
Code:

  refinementSurfaces
    {
        batteries_c3  {        level (2 2);       
        faceZone batt1;
        cellZone batt1;
        cellZoneInside inside;
                }
    }

Is this cellZone that I created called batt1, be mentioned anywhere in topoSetDict file?

2) My geometry composes of 32 rectangular boxes, but when I try topoSet using
Code:

        name        battCellSet;
        type                cellSet;
        action        new;
        source        surfaceToCell;
        sourceInfo
        {       
                file "/mnt/...../refined1x_cht_toposet/constant/triSurface/batteries_c3.stl";
                useSurfaceOrientation false;
               
                outsidePoints        ((0.46 0.0345 -0.1445183)); //vector chosen from ASCII stl file line 18
               
                includeCut        true;
                includeInside true;
                includeOutside false;
                nearDistance -1;
                curvature 0.9;
        }
        }
            {
        name    batt;
        type    cellZoneSet;
        action  new;
        source  setToCellZone;
        sourceInfo
        {
            set battCellSet;
        }
    }

It creates cells only at the boundary of stl which are assigned to battCellSet. Which makes sense from the choice. But is there a way to chose even the cells inside? Because when I want to use the option of invert later to assign the remaing domain to fluid region, the hollow volume inside batteries creates cellSetZone together with the outer cellSetZone.

3) I would highly appreciate if someone could explain nearDistance and curvature values to me, what are the ranges of the values, etc. I tried reading through the topoSet.C file but my knowledge of understanding it is very low.

Attaching my *Dict files.
Thanks
Owais - new to OFv6

Owais Shabbir July 25, 2019 05:13

Resolved but splitMeshRegions gives a fatal error
 
Hi all,
I was able to resolve it. I figured out all the cells saved through SHMDict were saved in constant/polyMesh/cellZones
so the right settings for topoSet to utilise were these:
Code:

{
name        battCellSet;
type        cellSet;
action        new;
source        zoneToCell;
sourceInfo
{        name        "batt1"; //name assigned in SHMDict
}
}
    {
        name    batteries;
        type    cellZoneSet;
        action  new;
        source  setToCellZone;
        sourceInfo
        {
            set batteriesCellSet;
        }
    }

This works fine when seen through paraview.
Problem is when I use splitMeshRegions I get a Fatal Error!
Create time

Create mesh for time = 0

Using current faceZones to divide inter-region interfaces into multiple patches.
Code:

--> FOAM FATAL ERROR:
Cell 0 with cell centre (-0.026349986 -0.0021249995 -0.17876937) is multiple zones. This is not allowed.
It is in zone batt1 and in zone fluid

    From function void getZoneID(const Foam::polyMesh&, const cellZoneMesh&, Foam::labelList&, Foam::labelList&)
    in file splitMeshRegions.C at line 1225.

FOAM exiting

I have tried different options but this is something I can't get rid of.
Any help!

Thanks
Owais

Owais Shabbir July 25, 2019 06:46

Solution
 
Dear All,

So I figured out the error (well not really an error) was due to polyMesh/cellZones.
There were 3 regions instead of 2.
1st cellzone: batt1 defined by SHMDict
2nd cellzone: defined by topoSet called batteries
3rd cellzone: also defined by topoSet called fluid

learning: So just don't have additional names and it should be simple. Chose batt1 for both SHMDict and topoSet.

Have a nice day.

aerospace1365 October 21, 2020 12:04

request
 
Dear Sir,

Would you please contact me by aerospace1365@gmail.com.
Sincerely yours,
Hosein Faramarzpour

farzadmech November 8, 2020 18:42

Dear Owais Shabbir
I have a problem with my STL file. it must be binary or ascii? where should I put as external point? exactly at the surface?



Thanks,
Farzad



Quote:

Originally Posted by Owais Shabbir (Post 739983)
Dear All,

So I figured out the error (well not really an error) was due to polyMesh/cellZones.
There were 3 regions instead of 2.
1st cellzone: batt1 defined by SHMDict
2nd cellzone: defined by topoSet called batteries
3rd cellzone: also defined by topoSet called fluid

learning: So just don't have additional names and it should be simple. Chose batt1 for both SHMDict and topoSet.

Have a nice day.



All times are GMT -4. The time now is 08:37.