CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Open Source Meshers: Gmsh, Netgen, CGNS, ...

How to define these patches

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   September 9, 2008, 05:48
Default Dear all, First thank you f
  #1
Senior Member
 
ZHOU Bin
Join Date: Mar 2009
Location: Nanjing/Shanghai/Torino, Nanjing/Shanghai/Piemente, China/Italy
Posts: 164
Rep Power: 8
zhoubinwx is on a distinguished road
Send a message via ICQ to zhoubinwx Send a message via MSN to zhoubinwx Send a message via Skype™ to zhoubinwx
Dear all,

First thank you for your attention.

I want to name the circle patches as "circle1","circle2",....

I write the following code:

-----------------------
For t In {1:101}
char add= (char) t;
Physical Surface(StrCat("circle",add)) = {e1[8+4*t]:e1[11+4*t]} ;
EndFor
-----------------------

When it is loaded, I get:
problem 1. add: unknown variable,
problem 2. I visualize the patch, and I could only get one patch named "circleadd", NOT "circle1".

If some of you have this experience, would you please give me any suggestions?

Thank you very much.

Bin
zhoubinwx is offline   Reply With Quote

Old   September 9, 2008, 08:50
Default Have a look at the BNS syntax
  #2
Member
 
Martin Aunskjaer
Join Date: Mar 2009
Location: Denmark
Posts: 48
Rep Power: 8
aunola is on a distinguished road
Have a look at the BNS syntax of character expressions in Gmsh in section 2.1.2. It does not support a declaration like your 2nd line.

One suggestion is to simply replace what your are trying to do (convert t to a char and concatenate it with the string "circle") with the Sprintf() function. Have a look at the tutorial t8.geo in section 7.8 of the manual for an example of how this is done.
aunola is offline   Reply With Quote

Old   September 11, 2008, 03:20
Default Dear Martin, As you said, i
  #3
Senior Member
 
ZHOU Bin
Join Date: Mar 2009
Location: Nanjing/Shanghai/Torino, Nanjing/Shanghai/Piemente, China/Italy
Posts: 164
Rep Power: 8
zhoubinwx is on a distinguished road
Send a message via ICQ to zhoubinwx Send a message via MSN to zhoubinwx Send a message via Skype™ to zhoubinwx
Dear Martin,

As you said, it works now with the function "Sprintf()". Thank you.

Best regards,

Bin
zhoubinwx is offline   Reply With Quote

Old   September 12, 2008, 07:45
Default Dear Martin and other friends,
  #4
Senior Member
 
ZHOU Bin
Join Date: Mar 2009
Location: Nanjing/Shanghai/Torino, Nanjing/Shanghai/Piemente, China/Italy
Posts: 164
Rep Power: 8
zhoubinwx is on a distinguished road
Send a message via ICQ to zhoubinwx Send a message via MSN to zhoubinwx Send a message via Skype™ to zhoubinwx
Dear Martin and other friends,

When I want to define the boundary condition for my circles in the file 0/U, for an example,

I tried many ways, but failed:

// for (int t=1;t<=101;t++)
// {
// Sprintf("circle%g", t)
// "circle".merge(1:101);
// "circle".push_back(1)
// circle.merge(1)
"circle".append(1)
{
type slip;
}
// }

I write here, just to see if some one knows how to define those patches: circle1, circle2, ... Not by hand. Otherwise it is a lot of work.

Thank you for your attention.

Bin
zhoubinwx is offline   Reply With Quote

Old   September 12, 2008, 09:11
Default You are again using a syntax n
  #5
Member
 
Martin Aunskjaer
Join Date: Mar 2009
Location: Denmark
Posts: 48
Rep Power: 8
aunola is on a distinguished road
You are again using a syntax not recognized by Gmsh. For instance, the C++ string push_back() function for appending characters to a string is unknown to the Gmsh parser.

To name your circle patches it should be possible to get through it using the Sprintf() function provided by Gmsh, though I haven't tried.
aunola is offline   Reply With Quote

Old   September 12, 2008, 09:17
Default Ok, I see you have another pos
  #6
Member
 
Martin Aunskjaer
Join Date: Mar 2009
Location: Denmark
Posts: 48
Rep Power: 8
aunola is on a distinguished road
Ok, I see you have another post about the same problem and have received some hlp there:

http://www.cfd-online.com/OpenFOAM_D...es/1/8536.html
aunola is offline   Reply With Quote

Old   September 15, 2008, 08:52
Default Hi Martin, This problem is
  #7
Senior Member
 
ZHOU Bin
Join Date: Mar 2009
Location: Nanjing/Shanghai/Torino, Nanjing/Shanghai/Piemente, China/Italy
Posts: 164
Rep Power: 8
zhoubinwx is on a distinguished road
Send a message via ICQ to zhoubinwx Send a message via MSN to zhoubinwx Send a message via Skype™ to zhoubinwx
Hi Martin,

This problem is solved in the file 0/U and 0/p as the suggestions in the link.

I am implementing my boundary for those circles now, and I am sure to finish them soon.

Thank you.

Bin
zhoubinwx is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
StitchMesh on two patches anita OpenFOAM Native Meshers: blockMesh 31 April 4, 2013 11:51
define mass transfer - define source greg FLUENT 0 September 8, 2006 11:27
extruding patches Ben CD-adapco 7 June 23, 2004 02:56
rediation patches novice CD-adapco 2 February 25, 2004 04:53
define my own DEFINE macro? to model pithing naca calogero FLUENT 0 April 10, 2003 05:10


All times are GMT -4. The time now is 06:23.