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

Problem with topoSet

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 25, 2015, 22:00
Question Problem with topoSet
  #1
New Member
 
wangtianjian
Join Date: Dec 2014
Location: Beijing, China
Posts: 13
Rep Power: 11
wtjhaha is on a distinguished road
Hi all,
I am meshing a tube with a glass cover outside the tube, and I use the topoSetDIct to set the region of the air and the tube.But there is a bug when running topoSet.


Code:
--> FOAM FATAL IO ERROR: 
attempt to read beyond EOF

file: /home/wtj/OpenFOAM/wtj-2.3.1/run/tube1/system/topoSetDict.actions at line 34.
And this is my topoSetDict
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.3.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      topoSetDict;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

actions
(
    // Air
    {
        name    air;
        type    cellSet;
        action  new;
        source  cylinderToCell;
        sourceInfo
        {
            p1(0 0 0);
	    p2(0 0 0.5);
            radius 0.017;
        }
    }
    {
        name    air;
        type    cellZoneSet;
        action  new;
        source  setToCellZone;
        sourceInfo
        {
            set air;
            
        }
    }
    

    // Tube
   
    {
        name    tube;
        type    cellZoneSet;
        action  clear;
        
    }

    
    {
        name    tube;
        type    cellSet;
        action  add;
        source  cellToCell;
	sourceInfo
	{
		set air;
	}
        
    }
    {
        name    tube;
        type    cellZoneSet;
        action  new;
        source  setToCellZone;
        sourceInfo
        {
            set tube;
           
        }
    }
);

// ************************************************************************* //
Anybody can help me with this problem? I am stuck in it for several weeks and I really need help!
wtjhaha is offline   Reply With Quote

Old   May 27, 2015, 06:54
Default
  #2
Member
 
Nicole Andrew
Join Date: Sep 2014
Location: Pretoria, South Africa
Posts: 58
Rep Power: 11
Nicole is on a distinguished road
Hi,

I have not seen your error message before. Are you by any chance using blockMesh to mesh your domain?
Nicole is offline   Reply With Quote

Old   May 27, 2015, 08:22
Default
  #3
Senior Member
 
Alex
Join Date: Oct 2013
Posts: 337
Rep Power: 21
zfaraday will become famous soon enough
I'm not sure what this error means, although I think I had to face it in the past. However, by reading your topoSetDict file I saw something weird that can be causing the problem, or maybe can cause another problem instead. First of all, you are creating a cellSet named air which is a cylinder. After that it is converted into a cellZone. The next step consists in the creation of another cellSet called tube with the same cells that make up the air cellSet, next you convert it into another cellZone with the result of two diferents cellZones made up with the same cells... I'm not sure if it can be done...I think that if a cell already belongs to a cellZone it cannot be part of another cellZone.

As per my experience I think you may have missed a step in your topoSetDict, namenly the step when you invert your selection in odrer to select all the cells that don't belong to the air cellSet to create the tube cellSet. Am I right?

Hope it helps.

Alex
__________________
Web site where I present my Master's Thesis: foamingtime.wordpress.com

The case I talk about in this site was solved with chtMultiRegionSimpleFoam solver and involves radiation. Some basic tutorials are also resolved step by step in the web. If you are interested in these matters, you are invited to come in!
zfaraday is offline   Reply With Quote

Old   May 27, 2015, 21:01
Default
  #4
New Member
 
wangtianjian
Join Date: Dec 2014
Location: Beijing, China
Posts: 13
Rep Power: 11
wtjhaha is on a distinguished road
Quote:
Originally Posted by zfaraday View Post
I'm not sure what this error means, although I think I had to face it in the past. However, by reading your topoSetDict file I saw something weird that can be causing the problem, or maybe can cause another problem instead. First of all, you are creating a cellSet named air which is a cylinder. After that it is converted into a cellZone. The next step consists in the creation of another cellSet called tube with the same cells that make up the air cellSet, next you convert it into another cellZone with the result of two diferents cellZones made up with the same cells... I'm not sure if it can be done...I think that if a cell already belongs to a cellZone it cannot be part of another cellZone.

As per my experience I think you may have missed a step in your topoSetDict, namenly the step when you invert your selection in odrer to select all the cells that don't belong to the air cellSet to create the tube cellSet. Am I right?

Hope it helps.

Alex
Thank you for your reply, and I changed my topoSetDict, but unfortunately, it still doesn't work.
This is my new topoSetDict, is there still problems there?
Code:
actions
(
    // Air
    {
        name    air;
        type    cellSet;
        action  new;
        source  cylinderToCell;
        sourceInfo
        {
            p1(0 0 0);
	    p2(0 0 0.5);
            radius 0.017;
        }
    }
    {
        name    air;
        type    cellZoneSet;
        action  new;
        source  setToCellZone;
        sourceInfo
        {
            set air;
            
        }
    }
    

    // Tube
   
    {
        name    tube;
        type    cellZoneSet;
        action  clear;
        
    }

    
    
    {
        name    tube;
        type    cellSet;
        action  invert;
    }
    {
        name    tube;
        type    cellZoneSet;
        action  new;
        source  setToCellZone;
        sourceInfo
        {
            set tube;
           
        }
    }
);
Thanks again!
wtjhaha is offline   Reply With Quote

Old   May 27, 2015, 21:08
Default
  #5
New Member
 
wangtianjian
Join Date: Dec 2014
Location: Beijing, China
Posts: 13
Rep Power: 11
wtjhaha is on a distinguished road
Quote:
Originally Posted by Nicole View Post
Hi,

I have not seen your error message before. Are you by any chance using blockMesh to mesh your domain?
Thanks for your reply, but I am sorry I didn't really catch you. So can you explain for me in a common way?
wtjhaha is offline   Reply With Quote

Old   May 28, 2015, 04:57
Default
  #6
Senior Member
 
Alex
Join Date: Oct 2013
Posts: 337
Rep Power: 21
zfaraday will become famous soon enough
Quote:
Originally Posted by wtjhaha View Post
Thank you for your reply, and I changed my topoSetDict, but unfortunately, it still doesn't work.
This is my new topoSetDict, is there still problems there?
Code:
actions
(
    // Air
    {
        name    air;
        type    cellSet;
        action  new;
        source  cylinderToCell;
        sourceInfo
        {
            p1(0 0 0);
	    p2(0 0 0.5);
            radius 0.017;
        }
    }
    {
        name    air;
        type    cellZoneSet;
        action  new;
        source  setToCellZone;
        sourceInfo
        {
            set air;
            
        }
    }
    

    // Tube
   
    {
        name    tube;
        type    cellZoneSet;
        action  clear;
        
    }

    
    
    {
        name    tube;
        type    cellSet;
        action  invert;
    }
    {
        name    tube;
        type    cellZoneSet;
        action  new;
        source  setToCellZone;
        sourceInfo
        {
            set tube;
           
        }
    }
);
Thanks again!
Well, that's not exactly what I was suggesting... You have to invert your selection once you have selected the cells you want to dismiss. It would be something like:

Code:
actions
(
    // Air
    {
        name    air;
        type    cellSet;
        action  new;
        source  cylinderToCell;
        sourceInfo
        {
            p1(0 0 0);
	    p2(0 0 0.5);
            radius 0.017;
        }
    }
    {
        name    air;
        type    cellZoneSet;
        action  new;
        source  setToCellZone;
        sourceInfo
        {
            set air;
            
        }
    }
    

    // Tube
   
    {
        name    tube;
        type    cellZoneSet;
        action  clear;
        
    }
        
    {
        name    tube;
        type    cellSet;
        action  add;
        source  cellToCell;
	sourceInfo
	{
		set air;
	}
        
    }
    
    {
        name    tube;
        type    cellSet;
        action  invert;
    }
    {
        name    tube;
        type    cellZoneSet;
        action  new;
        source  setToCellZone;
        sourceInfo
        {
            set tube;
           
        }
    }
);
I haven't checked if the sintax of the invert action is correct, it may be wrong...

BTW, you should be more accurate in your questions in order to make it easy for the other users to help you, for instance you may have added the error message in your last post.

Regarding the question that @Nicole is pointing out, it's easy to understand, he/she is only asking if you created your mesh using blockMesh. However, if you didn't understand the question you may not even know what blockMesh is, so we can deduce that you meshed your geometry with other tool, did you?

Regards,

Alex
__________________
Web site where I present my Master's Thesis: foamingtime.wordpress.com

The case I talk about in this site was solved with chtMultiRegionSimpleFoam solver and involves radiation. Some basic tutorials are also resolved step by step in the web. If you are interested in these matters, you are invited to come in!
zfaraday is offline   Reply With Quote

Old   May 28, 2015, 05:12
Default
  #7
New Member
 
wangtianjian
Join Date: Dec 2014
Location: Beijing, China
Posts: 13
Rep Power: 11
wtjhaha is on a distinguished road
Quote:
Originally Posted by zfaraday View Post
Well, that's not exactly what I was suggesting... You have to invert your selection once you have selected the cells you want to dismiss. It would be something like:

Code:
actions
(
    // Air
    {
        name    air;
        type    cellSet;
        action  new;
        source  cylinderToCell;
        sourceInfo
        {
            p1(0 0 0);
	    p2(0 0 0.5);
            radius 0.017;
        }
    }
    {
        name    air;
        type    cellZoneSet;
        action  new;
        source  setToCellZone;
        sourceInfo
        {
            set air;
            
        }
    }
    

    // Tube
   
    {
        name    tube;
        type    cellZoneSet;
        action  clear;
        
    }
        
    {
        name    tube;
        type    cellSet;
        action  add;
        source  cellToCell;
	sourceInfo
	{
		set air;
	}
        
    }
    
    {
        name    tube;
        type    cellSet;
        action  invert;
    }
    {
        name    tube;
        type    cellZoneSet;
        action  new;
        source  setToCellZone;
        sourceInfo
        {
            set tube;
           
        }
    }
);
I haven't checked if the sintax of the invert action is correct, it may be wrong...

BTW, you should be more accurate in your questions in order to make it easy for the other users to help you, for instance you may have added the error message in your last post.

Regarding the question that @Nicole is pointing out, it's easy to understand, he/she is only asking if you created your mesh using blockMesh. However, if you didn't understand the question you may not even know what blockMesh is, so we can deduce that you meshed your geometry with other tool, did you?

Regards,

Alex
Thanks Alex,
I created my mesh using blockMesh, and it was posted in my first thread. I didn't post the error message for it was the same with the one I posted in my first thread. I am sorry for not claimed it. The error message is
Code:
--> FOAM FATAL IO ERROR: 
attempt to read beyond EOF

file: /home/wtj/OpenFOAM/wtj-2.3.1/run/tube/system/topoSetDict.actions at line 34.

    From function ITstream::read(token&)
    in file db/IOstreams/Tstreams/ITstream.C at line 83.

FOAM exiting
And I want to know what is the sintax of the invert and how can I check it? I am a greenhand in both OpenFOAM and English writing. So I am very eager for your help.
Best Regards.
And thanks again.
wtjhaha is offline   Reply With Quote

Old   May 28, 2015, 05:22
Default
  #8
Member
 
Nicole Andrew
Join Date: Sep 2014
Location: Pretoria, South Africa
Posts: 58
Rep Power: 11
Nicole is on a distinguished road
Hi,

I am definitely not as skilled with this as Alex, so I can't help you with the invert, but we found a really simple way to do this using blockmesh.

Firstly, when you define your hex blocks in blockMeshDict you simply define the "zone name" for example:

Code:
hex (1  0  9  12 16 15 24 27) Air (10 10 10) simpleGrading (1 1 1) //0
Then, in toposet all you need to do is this:

Code:
    // air
    {
        name    Air;
        type    cellSet;
        action  new;
        source  zoneToCell;
        sourceInfo
        {
            name "Air";
        }
    }
    {
        name    Air;
        type    cellZoneSet;
        action  new;
        source  setToCellZone;
        sourceInfo
        {
            set Air;
        }
    }
And you can do this for all of the zones to regions. I am not sure if this will work for you (I am a novice myself), but it worked really easily for us.

Regards,
Nicole
Nicole is offline   Reply With Quote

Old   May 28, 2015, 05:42
Default
  #9
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

Maybe I am late but the problem is in missing space between p1 and (0 0 0). You see, p1 is a label and it should be separated from the vector it labels The same thing with p2.
alexeym is offline   Reply With Quote

Old   May 28, 2015, 06:19
Default
  #10
Senior Member
 
Alex
Join Date: Oct 2013
Posts: 337
Rep Power: 21
zfaraday will become famous soon enough
Quote:
Originally Posted by Nicole View Post
Hi,

I am definitely not as skilled with this as Alex, so I can't help you with the invert, but we found a really simple way to do this using blockmesh.

Firstly, when you define your hex blocks in blockMeshDict you simply define the "zone name" for example:

Code:
hex (1  0  9  12 16 15 24 27) Air (10 10 10) simpleGrading (1 1 1) //0
Then, in toposet all you need to do is this:

Code:
    // air
    {
        name    Air;
        type    cellSet;
        action  new;
        source  zoneToCell;
        sourceInfo
        {
            name "Air";
        }
    }
    {
        name    Air;
        type    cellZoneSet;
        action  new;
        source  setToCellZone;
        sourceInfo
        {
            set Air;
        }
    }
And you can do this for all of the zones to regions. I am not sure if this will work for you (I am a novice myself), but it worked really easily for us.

Regards,
Nicole
Wow Nicole!! Your post really shocked me...

I totally agree with you with the first part of your post, defining your regions in blockMesh can ease the topology definition of your geometry. However, I don't get the second part... when you define your regions by naming the blocks in blockMesh you don't need to use topoSet because both actions have the same aim: to create cellZones. Thus, it makes no sense to me what you suggested because after you have named the blocks in blockMesh, the cells within the blocks become cellZones with the same name. Then, if you look at the topoSetDict you proposed, what you are doing is taking the cellZones created with blockMesh so as to create a cellSet and, after that, you take this cellSet to convert it AGAIN into a cellZone!!

Btw, is it correct to use quotation marks to encolse the name within when you define the name of the zone to be converted into a cellSet? Just asking... I'm not sure about it..

@alexeym: Thanks to point out that it only was a dumb mistake! :P Typical when you are new in this world, all of us have passed through it! I didn't even realised about this "little" mistake...

Regards,

Alex
__________________
Web site where I present my Master's Thesis: foamingtime.wordpress.com

The case I talk about in this site was solved with chtMultiRegionSimpleFoam solver and involves radiation. Some basic tutorials are also resolved step by step in the web. If you are interested in these matters, you are invited to come in!
zfaraday is offline   Reply With Quote

Old   May 28, 2015, 06:26
Default
  #11
Member
 
Nicole Andrew
Join Date: Sep 2014
Location: Pretoria, South Africa
Posts: 58
Rep Power: 11
Nicole is on a distinguished road
Hi Alex,

Thanks for the advice. I did this a while ago and it worked pretty well. Next time I work on a multiregion system I'll try without topoSet. Thanks!
Nicole is offline   Reply With Quote

Old   May 28, 2015, 21:19
Default
  #12
New Member
 
wangtianjian
Join Date: Dec 2014
Location: Beijing, China
Posts: 13
Rep Power: 11
wtjhaha is on a distinguished road
Quote:
Originally Posted by alexeym View Post
Hi,

Maybe I am late but the problem is in missing space between p1 and (0 0 0). You see, p1 is a label and it should be separated from the vector it labels The same thing with p2.
What a silly mistake I have made... Thank you for your help! It confused me a lot for a long time!
wtjhaha is offline   Reply With Quote

Old   May 28, 2015, 21:20
Default
  #13
New Member
 
wangtianjian
Join Date: Dec 2014
Location: Beijing, China
Posts: 13
Rep Power: 11
wtjhaha is on a distinguished road
Quote:
Originally Posted by Nicole View Post
Hi,

I am definitely not as skilled with this as Alex, so I can't help you with the invert, but we found a really simple way to do this using blockmesh.

Firstly, when you define your hex blocks in blockMeshDict you simply define the "zone name" for example:

Code:
hex (1  0  9  12 16 15 24 27) Air (10 10 10) simpleGrading (1 1 1) //0
Then, in toposet all you need to do is this:

Code:
    // air
    {
        name    Air;
        type    cellSet;
        action  new;
        source  zoneToCell;
        sourceInfo
        {
            name "Air";
        }
    }
    {
        name    Air;
        type    cellZoneSet;
        action  new;
        source  setToCellZone;
        sourceInfo
        {
            set Air;
        }
    }
And you can do this for all of the zones to regions. I am not sure if this will work for you (I am a novice myself), but it worked really easily for us.

Regards,
Nicole
Thank you for your advice! I will try it later on.
wtjhaha is offline   Reply With Quote

Old   May 28, 2015, 22:23
Default
  #14
New Member
 
wangtianjian
Join Date: Dec 2014
Location: Beijing, China
Posts: 13
Rep Power: 11
wtjhaha is on a distinguished road
Quote:
Originally Posted by zfaraday View Post
Wow Nicole!! Your post really shocked me...

I totally agree with you with the first part of your post, defining your regions in blockMesh can ease the topology definition of your geometry. However, I don't get the second part... when you define your regions by naming the blocks in blockMesh you don't need to use topoSet because both actions have the same aim: to create cellZones. Thus, it makes no sense to me what you suggested because after you have named the blocks in blockMesh, the cells within the blocks become cellZones with the same name. Then, if you look at the topoSetDict you proposed, what you are doing is taking the cellZones created with blockMesh so as to create a cellSet and, after that, you take this cellSet to convert it AGAIN into a cellZone!!

Btw, is it correct to use quotation marks to encolse the name within when you define the name of the zone to be converted into a cellSet? Just asking... I'm not sure about it..

@alexeym: Thanks to point out that it only was a dumb mistake! :P Typical when you are new in this world, all of us have passed through it! I didn't even realised about this "little" mistake...

Regards,

Alex
Thanks a lot! It's really kind of you to give me a lot of help in my OpenFOAM study!
wtjhaha is offline   Reply With Quote

Old   May 29, 2015, 02:13
Default
  #15
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Quote:
Originally Posted by wtjhaha View Post
What a silly mistake I have made... Thank you for your help! It confused me a lot for a long time!
In fact I would not call it "silly mistake" but "shitty, useless error message". Instead of limiting search range by sourceInfo sub-dictionary and failing with "p1 was not found", OpenFOAM decides to read till the end of the file.
alexeym is offline   Reply With Quote

Old   October 3, 2019, 06:01
Default Another "silly mistake"
  #16
Member
 
Rasmus Iwersen
Join Date: Jan 2019
Location: Denmark
Posts: 81
Rep Power: 8
Rasmusiwersen is on a distinguished road
Holy moly...

My error was somewhat the same as most recently suggested- Missing ";" in the end of each line (except sourceInfo) caused the same problem for me.

I know the post is hold, however this hopefully helps whoever might have the same problems.

/Rasmus
Rasmusiwersen is offline   Reply With Quote

Reply


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
UDF compiling problem Wouter Fluent UDF and Scheme Programming 6 June 6, 2012 04:43
Gambit - meshing over airfoil wrapping (?) problem JFDC FLUENT 1 July 11, 2011 05:59
natural convection problem for a CHT problem Se-Hee CFX 2 June 10, 2007 06:29
Adiabatic and Rotating wall (Convection problem) ParodDav CFX 5 April 29, 2007 19:13
Is this problem well posed? Thomas P. Abraham Main CFD Forum 5 September 8, 1999 14:52


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