CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

How to calculate the field value of a arbitrary point

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

Reply
 
LinkBack Thread Tools Display Modes
Old   April 11, 2005, 04:13
Default Given a position as (x,y,z), I
  #1
Member
 
Luckyluke
Join Date: Mar 2009
Posts: 51
Rep Power: 8
luckyluke is on a distinguished road
Given a position as (x,y,z), I want the u or p value in this point by using interpolation.

Thanks all.
luckyluke is offline   Reply With Quote

Old   April 11, 2005, 05:20
Default As a postprocessing step use t
  #2
Super Moderator
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,416
Rep Power: 16
mattijs is on a distinguished road
As a postprocessing step use the 'sample' utility.

Inside a code use the probe functionality (See e.g. oodles/createProbes.H). This does no interpolation however.
mattijs is offline   Reply With Quote

Old   April 11, 2005, 06:51
Default Hi,Mattijs. I can find out the
  #3
Member
 
Luckyluke
Join Date: Mar 2009
Posts: 51
Rep Power: 8
luckyluke is on a distinguished road
Hi,Mattijs. I can find out the cell which contain the given point (x,y,z) using mesh.finCell(), then how I can know the cell's neighbour cells?

Thanks.
luckyluke is offline   Reply With Quote

Old   April 11, 2005, 07:18
Default vector probePoint(x,y,z); lab
  #4
Senior Member
 
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 12
eugene is on a distinguished road
vector probePoint(x,y,z);
label probeCell = mesh.findCell(probePoint);

const labelList& probeCellNeighbours = mesh.cellCells()[probeCell];

forAll(probeCellNeighbours, cellI)
{
Do your stuff
}

But if you want to interpolate, you might want to look at the built-in interpolation classes.
eugene is offline   Reply With Quote

Old   April 11, 2005, 08:13
Default Thank all. By the way, if I kn
  #5
Member
 
Luckyluke
Join Date: Mar 2009
Posts: 51
Rep Power: 8
luckyluke is on a distinguished road
Thank all. By the way, if I knew the 'label' of one cell,e.g. cellI, then I can access the field value of this cell using U[cellI]. Is that right?

Can a field loop be performed as follows:
forALL(mesh.cells(),i) {U[i]=...}
Or
forALL(U,i) {U[i]=...}?

These are simple questions. Could anybody give me a answer?
luckyluke is offline   Reply With Quote

Old   April 11, 2005, 08:25
Default Right Both forALL(mesh.ce
  #6
Senior Member
 
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 12
eugene is on a distinguished road
Right

Both
forALL(mesh.cells(),i) {U[i]=...}
and
forALL(U,i) {U[i]=...}
will give you the same result, i.e. the ordering of cells and volFields are identical.

Most operations however do not require that you loop over the cells explicitly as they can be performed using field algebra.
eugene is offline   Reply With Quote

Old   October 19, 2012, 05:45
Default How can get my results at the patch using points' coordinates
  #7
hfs
Member
 
Join Date: Jul 2012
Posts: 60
Rep Power: 4
hfs is on a distinguished road
Quote:
Originally Posted by eugene View Post
vector probePoint(x,y,z);
label probeCell = mesh.findCell(probePoint);

const labelList& probeCellNeighbours = mesh.cellCells()[probeCell];

forAll(probeCellNeighbours, cellI)
{
Do your stuff
}

But if you want to interpolate, you might want to look at the built-in interpolation classes.

Hello,

I need the same BUT!:

I am doing a comparison between wind tunnel results and OpenFOAM simulation. Available from wind tunnel are the pressure coefficients (Cp) on 32 points. The coordinates of those points are available. I need to get P field on the body patch at those 32 points.

I mean, the coordinates of a point may not guarantee that It belongs to the patch (due to lack of accuracy of snappyHexMesh). How can get my results at the patch using points' coordinates?
hfs is offline   Reply With Quote

Old   February 28, 2014, 16:14
Default
  #8
New Member
 
Ripudaman Manchanda
Join Date: May 2013
Posts: 29
Rep Power: 4
ripudaman is on a distinguished road
HFS, were you able to find a solution to your problem? I have a similar concern. I am using stressAnalysisFoam and I need the D field on the body patch at a particular point as well.

Quote:
Originally Posted by hfs View Post
Hello,

I need the same BUT!:

I am doing a comparison between wind tunnel results and OpenFOAM simulation. Available from wind tunnel are the pressure coefficients (Cp) on 32 points. The coordinates of those points are available. I need to get P field on the body patch at those 32 points.

I mean, the coordinates of a point may not guarantee that It belongs to the patch (due to lack of accuracy of snappyHexMesh). How can get my results at the patch using points' coordinates?
ripudaman 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
How to find out the cell containing a arbitrary point luckyluke OpenFOAM Running, Solving & CFD 2 July 10, 2013 11:54
Torque Calculation at Arbitrary Point Mojtaba CFX 8 March 1, 2009 01:22
Torque Calculation at Arbitrary Point Mojtaba Main CFD Forum 0 February 14, 2009 01:58
Calculation torque on arbitrary point Mojtaba Main CFD Forum 0 February 9, 2009 01:08
Calculation torque on arbitrary point Mojtaba CFX 0 February 7, 2009 00:45


All times are GMT -4. The time now is 16:17.