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

Random Access To Arbitrary Points In Solution Domain

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 8, 2007, 07:16
Default Hi everybody I want to acce
  #1
Senior Member
 
Marhamat Zeinali
Join Date: Mar 2009
Location: Tehran, Tehran, iran
Posts: 107
Rep Power: 17
marhamat is on a distinguished road
Hi everybody

I want to access to given points in the solution domain randomly.

Do OpenFOAM have useful libraries or functions for this goal?

If not,How i can do that?
Ideas are welcome. (-:

With kind regards
Marhamat
marhamat is offline   Reply With Quote

Old   November 8, 2007, 10:20
Default Hi Marhamat! I want to acce
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Hi Marhamat!

Quote:
I want to access to given points in the solution domain randomly.
Could you be a bit more precise? I guess what you wanted to say is: "I want to access the value of a field at one (or more) points in space". If that is so and you are satisfied with cell values (=no interpolation) and you have the point stored in the variable pt you might do it like this:

lable cellID=mesh.findCell(pt);
if(cellID>=0) {
Info << "Value: " << T[cellID] << endl;
} else {
Info << pt << " is outside" << endl;
}

Bernhard
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   November 8, 2007, 17:11
Default Thanks alot Bernhard Clearl
  #3
Senior Member
 
Marhamat Zeinali
Join Date: Mar 2009
Location: Tehran, Tehran, iran
Posts: 107
Rep Power: 17
marhamat is on a distinguished road
Thanks alot Bernhard

Clearly the coordinate of grids in some limited points is important for me.
But i want to access these points randomly and in different time steps.
For example in a channel that it's dimensions are(8 4 4)m , with (100*60*60)grids I want to find the coordinate of 100 points that limited in (2<x<4;1<y<2;1<z<2).
And this stochatic access be reptatable in different time steps.

Regards
Marhamat
marhamat is offline   Reply With Quote

Old   November 8, 2007, 18:43
Default Hi Marhamat! Look in the Do
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Hi Marhamat!

Look in the Doxygen for the Random-class. Use that to construct your points. Then apply the above recipie.

Bernhard
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Arbitrary lagrangianeulerian ALE chegdan OpenFOAM Running, Solving & CFD 2 March 12, 2008 20:29
Is there any functionality of OpenFOAM to solve multiblock domain without merging the domain swlee OpenFOAM Running, Solving & CFD 4 January 23, 2008 13:18
CEL insertion of points into domain? Adrijana CFX 1 December 7, 2006 08:48
Error : access : Unknown variable & Phase-domain MKP FLUENT 0 August 28, 2006 04:40
Random points in 3D circle ZZ Main CFD Forum 1 December 23, 2003 10:22


All times are GMT -4. The time now is 10:29.