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] OpenFoam 2.1.0/x: creation of sets and cellZones. (https://www.cfd-online.com/Forums/openfoam-meshing/99331-openfoam-2-1-0-x-creation-sets-cellzones.html)

ebah6 March 31, 2012 19:49

OpenFoam 2.1.0/x: creation of sets and cellZones.
 
Dear all,

I exported a mesh to OpenFoam and the files I got are: boundary, faces, neighbour, owner and points.
How can I proceed to create cellZones to define rotating parts?
I saw that earlier versions have cellSet utilities which I can not find.

Can anyone help on this issue?

Thank you all.

sail March 31, 2012 21:37

Quote:

Originally Posted by ebah6 (Post 352485)
Dear all,

I exported a mesh to OpenFoam and the files I got are: boundary, faces, neighbour, owner and points.
How can I proceed to create cellZones to define rotating parts?
I saw that earlier versions have cellSet utilities which I can not find.

Can anyone help on this issue?

Thank you all.

CellSet have been replaced by setSet

ebah6 March 31, 2012 22:13

Thanks Sail,

Can you please elaborate on how to use this feature.
I did try to utilise it but doesn't require that a set exists in the constant/polyMesh/sets directory?
So how would go along from the primary faces, points, etc. files to that that set then to the cellZones?

Thanks very much for your time.

ebah6 March 31, 2012 23:27

Hello Vieri,

I think I get how to do it.

Again, thank you.

mm.abdollahzadeh April 1, 2012 09:20

Quote:

Originally Posted by ebah6 (Post 352491)
Hello Vieri,

I think I get how to do it.

Again, thank you.


Dear ebah6

Could you please help me how setSet is working, please?
I am looking at the the Openfoam tutorial files for chtMultiRegionFoam and they used the same utility. but i can not understand how it is working.
i was thinking that for specifinng a part of mesh as new one , i need to input the number of grids or the coordinates


Best Mehdi

nimasam April 1, 2012 10:57

send me a private message contains your email to send you a tutorial in persian

ebah6 April 1, 2012 18:44

Quote:

Originally Posted by mm.abdollahzadeh (Post 352540)
Dear ebah6

Could you please help me how setSet is working, please?
I am looking at the the Openfoam tutorial files for chtMultiRegionFoam and they used the same utility. but i can not understand how it is working.
i was thinking that for specifinng a part of mesh as new one , i need to input the number of grids or the coordinates


Best Mehdi


Hello Mehdi,

I just did it on a dummy example for to see first how to get it.
So consider the following:
setSet
faceSet f0 new patchToFace bc_patch
cellSet c0 new faceToCell f0 any
cellZoneSet c0 new setToCellZone c0

Note: bc_patch is the boundary that you want to use for the cellZone.

Hope this helps.

lovecraft22 April 1, 2012 19:13

I think you could also use topoSet instead of setSet.
I tried both of them and I got the same result. The only difference is that topoSet seems to be easier to use…

mm.abdollahzadeh April 2, 2012 10:56

thanks all
I understand how setSet utility is working :D.
today i tried to test a case with chtMultiregionFoam.
my case includes natural convection in an enclosure with a block at the bottom. the bottom surface of block was heated.
the strange thing is that the temperature is not passing throgh solid zone to fluid zone. I am using turbulentTemperatureCoupledBaffleMixed as the boundary condition on the interface of soid and liquid zone.
I thinck there should be sth related to boundary condition. I will be too much thankful to recive you oponions :).

Best
Mehdi

ebah6 April 2, 2012 11:39

Quote:

Originally Posted by mm.abdollahzadeh (Post 352713)
thanks all
I understand how setSet utility is working :D.
today i tried to test a case with chtMultiregionFoam.
my case includes natural convection in an enclosure with a block at the bottom. the bottom surface of block was heated.
the strange thing is that the temperature is not passing throgh solid zone to fluid zone. I am using turbulentTemperatureCoupledBaffleMixed as the boundary condition on the interface of soid and liquid zone.
I thinck there should be sth related to boundary condition. I will be too much thankful to recive you oponions :).

Best
Mehdi


I fear I do not know about this issue; I am beginner.
Hope someone can help.

Regards.

samiam1000 April 10, 2012 06:16

Hi All,

I would need help about using the topoSet feature.

I have a .msh mesh imported from Fluent. I give the fluent3DMeshToFoam command and I have a cell zones (in the cellZone file!).

Which is the right topoSetDict in order to be able to run chtMultiRegion properly?

Thanks a lot,
Samuele

mm.abdollahzadeh April 10, 2012 07:01

Dear all

I don't know how to work with toposet. but the easiest way in my opinion is to export your mesh from fluent to openfoam. if you have just one interface between your solid and interface zone . just create the different zones in gambit and after exporting your grid use

runApplication fluentMeshToFoam name.msh -writeSets
runApplication setsToZones -noFlipMap
runApplication splitMeshRegions -cellZones -overwrite

but if you have a more complicated situation. for example that you have a block in the steam of fluid and half of th block surface is insulated and the other half is conductive. if you use the above command you will have just one interface and you can not be able to define different boundary condition. but instead you can create the mesh of different zones separately in gambit and export them separately to openfoam and place them in the folders with name of zones. then if u want conjugate heat transfer at an interface use this boundary condition other wise use other boundary condition:
**** it is the boundary in solid zone
heater_to_surrondingAir2
{
type compressible::turbulentTemperatureCoupledBaffleMix ed;
neighbourFieldName T;
K solidThermo;
KName none;
value uniform 300;
}

* it is the boundary in fluid zone

surrondingAir_to_heater2
{
type compressible::turbulentTemperatureCoupledBaffleMix ed;
neighbourFieldName T;
K basicThermo;
KName none;
value uniform 300;
}

samiam1000 April 10, 2012 09:26

When I give the
Code:

splitMeshRegions -cellZones -overwrite
I get this error:
Code:

lab@lab-laptop:~/Documenti/cases_OF/OF_case11_test$ splitMeshRegions -cellZones -overwrite
/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.1.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 2.1.0-0bc225064152
Exec  : splitMeshRegions -cellZones -overwrite
Date  : Apr 10 2012
Time  : 14:11:09
Host  : "lab-laptop"
PID    : 5028
Case  : /home/lab/Documenti/cases_OF/OF_case11_test
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Creating single patch per inter-region interface.

Trying to match regions to existing cell zones.


Number of regions:5

Writing region per cell file (for manual decomposition) to "/home/lab/Documenti/cases_OF/OF_case11_test/constant/cellToRegion"

Writing region per cell as volScalarField to "/home/lab/Documenti/cases_OF/OF_case11_test/0/cellToRegion"

Region        Cells
------        -----
0        15450
1        9450
2        81885
3        2940
4        54675

Region        Zone        Name
------        ----        ----
0        0        door
1        4        roof
2        2        internal_air
3        3        infinite_air
4        1        external_air

Sizes of interfaces between regions:

Interface        Region        Region        Faces
---------        ------        ------        -----
0                3        4        420
1                0        1        150
2                1        2        795
3                0        4        1545
4                0        2        1545
5                1        4        1095

Reading volScalarField Ypmma


--> FOAM FATAL IO ERROR:
inconsistent patch and patchField types for
    patch type symmetryPlane and patchField type calculated

file: /home/lab/Documenti/cases_OF/OF_case11_test/0/Ypmma::boundaryField::.* from line 25 to line 26.

    From function fvPatchField<Type>::New(const fvPatch&, const DimensionedField<Type, volMesh>&, const dictionary&)
    in file /home/opencfd/OpenFOAM/OpenFOAM-2.1.0/src/finiteVolume/lnInclude/fvPatchFieldNew.C at line 164.

FOAM exiting

lab@lab-laptop:~/Documenti/cases_OF/OF_case11_test$

Any idea?

mm.abdollahzadeh April 10, 2012 09:30

i am not sure but I guess sth,
you may have putted some dictionys for your variables in 0 folder which are not empty.
may be the problem is related that.

Budlo May 15, 2012 07:51

compressible::turbulentTemperatureCoupledBaffle
 
Hi dear
I want set a boundary condition for conjugate boundary in chtMultiRegionFoam.
But I dont find any information about this.

What boundary condition we can set for conjugate boundary? (please discribe it)

mm.abdollahzadeh May 21, 2012 14:15

Dear namdar

As i know you can use

type compressible::turbulentTemperatureCoupledBaffleMix ed;
neighbourFieldName T;
K basicThermo;
KName none;
value uniform 300;

for conjucate heat transfer....
K is the name of your diffusity

Budlo May 22, 2012 03:03

Why we use uniform value(300) in conjugate B.C ? (the conjugate boundary must to be solve)
What is diferent between: Compressible::turbulentTemperatureCoupledBaffleMix ed,
Compressible::turbulentTemperatureCoupledBaffle,

samiam1000 May 22, 2012 03:04

Dear mm.abdollahzadeh,

does this allow you to have 2 fluid regions that have a coincident interface?

Budlo May 23, 2012 07:51

Hi All

1-Why we use uniform value(300) in conjugate B.C ? (the conjugate boundary must to be solve)
What is diferent between: Compressible::turbulentTemperatureCoupledBaffleMix ed,
Compressible::turbulentTemperatureCoupledBaffle,

2- In chtMultiRegionFoam in OpenFoam 2011:
What is Ychar and Ypmma files in boundary condition ?

jiejie June 17, 2012 20:40

Dear foamers

For those who are doing rotating mesh with AMI. I have summarized the procedures after I received the advice from ebah6. I was using GGI from the OF1.6-ext and the procedure was a bit different in the OF2.1.x.

Since I am using ICEM for the mesh, I created a rotor zone (an inner-cycliner) inside a stator zone (a hollow cylinder around the rotor zone). The interfaces between the rotor zone and the stator zone are defined as AMI1 and AMI2 (AMI1=AMI2, I am not sure whether you can leave a tiny gap in between as the old GGI requires a small gap in between). Save the mesh as fluent format.

1. use fluent3DMeshToFoam to convert the icem mesh to openfoam compatible.
2. set up the AMI boundaries under case/constant/boundary:

AMI_1
{
type cyclicAMI;
nFaces 17893;
startFace 721902;
matchTolerance 0.0001;
neighbourPatch AMI_2;
transform noOrdering;
}

AMI_2
{
type cyclicAMI;
nFaces 6844;
startFace 741999;
matchTolerance 0.0001;
neighbourPatch AMI_1;
transform noOrdering;
}

3. Create Sets and cellZones (here is what I received from ebah6):

Suppose that your rotating block is comprised within a cylinder of axis z and that the points of intersection of this axis with the bases of the cylinder are (0 0 0) and (0 0 1); and your cylinder radius is 0.5.
All you need in such a case is to use the setSet command as follows: only that which is between quotes without the quotes.
0) type "setSet" from your case directory.
1) "cellSet c0 new cylinderToCell (0 0 0) (0 0 1) 0.5"
2) "cellZoneSet c0Zone new setToCellZone c0"
your rotating zone will be c0Zone.
by the way, c0 ans c0Zone are just made-up names, you can choose your own.

I think the simulation is ready to go now. Hopefully this is handy to whoever whats to use AMI.

Jie

mm.abdollahzadeh June 17, 2012 20:49

Quote:

Originally Posted by samiam1000 (Post 362352)
Dear mm.abdollahzadeh,

does this allow you to have 2 fluid regions that have a coincident interface?

Dear Samuele

I am also a beginner in Openfoam. but i think it is possible. you can have more than one solid or fluid zones. But in diffrent situation you may need to modify the boundary condition

mm.abdollahzadeh June 17, 2012 20:51

Quote:

Originally Posted by Budlo (Post 362664)
Hi All

1-Why we use uniform value(300) in conjugate B.C ? (the conjugate boundary must to be solve)
What is diferent between: Compressible::turbulentTemperatureCoupledBaffleMix ed,
Compressible::turbulentTemperatureCoupledBaffle,

2- In chtMultiRegionFoam in OpenFoam 2011:
What is Ychar and Ypmma files in boundary condition ?

Dear namdar

I just know that the temperature that you are giving is an initial guess for the temperature of the wall to allow calculation of heat flux on diffrent side of interface.

ebah6 June 17, 2012 21:23

Thanks Jie for updating the thread.

my best regards.

samiam1000 June 18, 2012 03:22

Quote:

Originally Posted by mm.abdollahzadeh (Post 366930)
Dear Samuele

I am also a beginner in Openfoam. but i think it is possible. you can have more than one solid or fluid zones. But in diffrent situation you may need to modify the boundary condition

Dear Mahadi,

any idea about how to do this? Just an hint to begin..

Thanks,

Samuele

lovecraft22 June 18, 2012 05:37

Thank you Jie, that's great. But, how do you find the numbers to enter within the boundary file?

ebah6 June 18, 2012 07:16

Hi Lore,

The boundary file should be created automatically when you export to openFoam. The same thing with the other four files (faces, points, etc.)

Myself, I use pointwise. The only things I add to the boundary file after exporting from PointWise to OpenFoam are:
* to make sure I get cyclicAMI instead of just cyclic.
* the matchTolerance, the neighbourPatch, and the transform items.
Regarding the matchTolerance I think (but not sure) that it is at 1e-4 by default.
The neighbourPatch is the other of the pair rotor/stator. The example by Jie is explicit in this regard.

I hope this helps.

lovecraft22 June 18, 2012 07:21

Thank you ebah, so you don't need to set nFaces and startFace.

Also, what are the advantages of using pointwise (or any other software) compared to snappy? Can all of this be done using snappy only?

ebah6 June 18, 2012 07:32

I guess you can use snappy.
One thing is that if you are already familiar with a software pointwise or anyone else that can export to openFoam format, it save you some time.
Personally, I run into a bit of trouble with snappy, I couldn't solve it. So I switch to what I was a bit more familiar with.

Sorry, to answer to your question, even when you are using the OpenFoam embedded mesh generator with the blockMeshDict, all you deal with is this file; the boundary file and others are generated when you run the blockMesh command.

jiejie June 28, 2012 00:31

Hi Guys

Would you be able to share the set up for fvScehem and fvSolution when using AMI interface? I tried to re-use the propeller mesh from the GGI (openfoam-1.6-ext) with AMI (openfoam-2.1.1), but I found the simulation is very unstable with AMI (pressure solver is doing more than 400 iterations for every timestep), which is stable with GGI. I used the same fvScheme and fvSolution from the propeller tutorial for my case with AMI. I remember I did change some of the schemes with the GGI, but some of those schemes are not available in openfoam-2.1.1.

It will be really great if anyone can share some advice about this.

Thanks

Jie

mm.abdollahzadeh June 28, 2012 00:43

Dear Jie

Could you please tell me which solver of Openfoam you are using for turbomachinary?

I am new in Openfoam, and I want to model a rotor blade (NACA67).

Best
Mahdi

jiejie June 28, 2012 00:46

Hi Mahbi

I am just using the standard pimpleDyMFoam.

Jie

mm.abdollahzadeh July 23, 2012 08:35

Dear Samuel

if you have just two fluid zone with a interface between them. you can do this.

1-create the Mesh of each zone separately
2-Setup a running folder according to Chtmultiregion tutorial
( i mean create folders with the name of your zones and etc ... )
3-for creating coupled interfaces forexample for conjucate heat tarnafer , you should edit the type of your boundary condition in the boundary file in polymesh for each zone.
you need to replace it with :

type directMappedWall;
nFaces 350;
startFace 119925;
sampleMode nearestPatchFace;
sampleRegion Zone2; // name of the neighbor zone
samplePatch interfaceD; // name of the coincident boundary
offsetMode uniform;
offset (0 0 0);

4- then you need just to apply the correct boundary conditions in your Zero Folder.
for a scaler which is solving in both region and the interface boundary is coupled between the two zone you can use , turbulentTemperatureCoupledBaffleMixed.

Best
Mahdi

turbulencious August 1, 2012 11:59

hello Madi,

I found your last post here very relevant to the problem that I encounter. Can you elaborate more? I have followed the steps that you give here (change the boundary files in polyMesh from mappedWall to directMappedWall) but I find difficulties to chose a BC to couple the temperature between solid and fluid. My flow is laminar and I want to couple the temperature. When I use zeroGradient the temperature of the solid does not change at all

solver:chtMultiRegionFoam
version: OF-2.1.1

thank you very much in advance
cordially,
giorgos

mm.abdollahzadeh August 2, 2012 10:40

Quote:

Originally Posted by turbulencious (Post 374870)
hello Madi,

I found your last post here very relevant to the problem that I encounter. Can you elaborate more? I have followed the steps that you give here (change the boundary files in polyMesh from mappedWall to directMappedWall) but I find difficulties to chose a BC to couple the temperature between solid and fluid. My flow is laminar and I want to couple the temperature. When I use zeroGradient the temperature of the solid does not change at all

solver:chtMultiRegionFoam
version: OF-2.1.1

thank you very much in advance
cordially,
giorgos

Dear giorgos

So you can change the type of boudary to directmappedwall.
the next step is to use the follwing boundary conditions in 0 folder for temperature :
Example usage:

myInterfacePatchName
{
type compressible::turbulentTemperatureCoupledBaffle;
neighbourFieldName T;
K lookup;
KName K; // or none
value uniform 300;
}

or

myInterfacePatchName
{
type compressible::turbulentTemperatureCoupledBaffleMix ed;
neighbourFieldName T;
K lookup;
KName K;
value uniform 300;
}

Best
Mahdi

turbulencious August 8, 2012 04:05

thank you very much!

maHein August 13, 2012 12:12

When I try directMappedWall, I get an error message:

Code:

--> FOAM FATAL ERROR:

    patch type 'genericPatch' not type 'mappedPatchBase'
    for patch contact_fluid of field T in file "/disk401/home/heinri8/Simulation/FlatPlate/flatPlate_LTS/0/fluid/T"

    From function turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
(
    const fvPatch& p,
    const DimensionedField<scalar, volMesh>& iF,
    const dictionary& dict
)

    in file derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C at line 99.

FOAM exiting

Looks like directMappedWall has been renamed to mappedWall in 2.1.0, (see official 2.1.0 release announcement)

sivakumar October 18, 2012 17:47

Hi Guys,
I have problem to create Sets and cellZones, I tried to follow Jiejie steps (he explained the steps in the previous post) .
while executing setSet, I am getting the following error,

Create time

Create polyMesh for time = 0

Time:0 cells:460000 faces:1402700 points:483021 patches:12 bb:(-1.06977 -0.559055 0.177709) (3.08761 0.0363306 0.771367)
cellSets:
fan size:0

cellZones:
fluid size:460000
faceZones:
default-interior size:1357300

Time = 0
mesh not changed.
Please type 'help', 'quit' or a set command after prompt.
readline>

I dont know why the cellSets: fan size 0
can you guys help me to sort out this problem.

Thanks for your time and answers,

Sivakumar

hfs November 12, 2012 15:45

Hello!

I have an STL and want to get faceZones according to it
how can I use setSet to do that?


Thank you!

reza1111 June 18, 2013 07:21

Hi everybody

I am new in OF and I am going to use AMI capability. my rotary interface isn't cylindrical.
my case is a rotary spheroidal zone in a cubic domain . can I do my case using OF?
Please give me some hints about AMI ability.
Thanks in advance,

Reza

reza1980 July 16, 2013 04:55

Hi All,
I hope you are fine. I am working on AMI to handle a propeller case through OF2.1x. My results seems not acceptable.
would you please let me your instruction to implement AMI.
I use this:

* Export two parts like Stator and Rotor from pointwise to OpenFoam
* Merge to parts as mergeMeshes Stator Rotor
* Update Boundary (Add cyclicAMi and tolerance)
* Use splitMeshRegions -makeCellZones -overwrite to make cellZones



Reza


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