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

In pointPatchField, how to read coordinate values of mesh

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

Reply
 
LinkBack Thread Tools Display Modes
Old   December 18, 2014, 09:40
Default In pointPatchField, how to read coordinate values of mesh
  #1
New Member
 
Jarvis
Join Date: Jun 2013
Posts: 10
Rep Power: 5
nbyjn is on a distinguished road
Hello foamers:
I want to write a new boundary based on oscillatingDisplacementPointPatchField. I want to give this boundary different values based on the mesh's coordinate values. Not a single value of the patch's coordinate, I mean different values on different girds. In this field, I can't use mesh.C() because "mesh" is not defined.
Do you have any idea? Thank you!
nbyjn is offline   Reply With Quote

Old   December 18, 2014, 12:03
Default
  #2
Member
 
Jan
Join Date: Jul 2009
Location: Hamburg
Posts: 56
Rep Power: 12
JNSN is on a distinguished road
This may work
Code:
const polyMesh& mesh = this->dimensionedInternalField().mesh()();
JNSN is offline   Reply With Quote

Old   December 19, 2014, 06:51
Default
  #3
New Member
 
Jarvis
Join Date: Jun 2013
Posts: 10
Rep Power: 5
nbyjn is on a distinguished road
Quote:
Originally Posted by JNSN View Post
This may work
Code:
const polyMesh& mesh = this->dimensionedInternalField().mesh()();
Thank you for your quick reply!
But I think polyMesh only contains patch/face information, you can't get mesh coordinates from this.
nbyjn is offline   Reply With Quote

Old   December 19, 2014, 16:44
Default
  #4
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: Amherst, MA USA - San Diego, CA USA
Posts: 320
Rep Power: 10
kmooney is on a distinguished road
I'm a little confused. Are you trying to, from a boundary condition, access the point positions of boundary mesh?
kmooney is offline   Reply With Quote

Old   December 20, 2014, 00:52
Default
  #5
New Member
 
Jarvis
Join Date: Jun 2013
Posts: 10
Rep Power: 5
nbyjn is on a distinguished road
Quote:
Originally Posted by kmooney View Post
I'm a little confused. Are you trying to, from a boundary condition, access the point positions of boundary mesh?
Yes, that's my point! Please forgive my poor English.
Do you have any ideas?
Thank you!
nbyjn is offline   Reply With Quote

Old   December 20, 2014, 14:21
Default
  #6
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: Amherst, MA USA - San Diego, CA USA
Posts: 320
Rep Power: 10
kmooney is on a distinguished road
Try this from within updateCoeffs()

[CODE]
const pointPatch& ptPatch = this->patch();
pointField myPoints = ptPatch.localPoints();
[/CODE

I hope that helps!

We actually have a pretty thorough discussion of this type of boundary condition in The OpenFOAM Technology Primer:
http://www.sourceflux.de/book/

I urge you to consider picking up a copy!

Cheers,
Kyle
kmooney 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
Mesh Boundary Assignment Question Wandadars Mesh Generation & Pre-Processing 1 June 13, 2016 17:19
sliding mesh problem in CFX Saima CFX 45 September 22, 2015 10:53
Cannot read a Spider mesh into Foam evrikon OpenFOAM Meshing & Mesh Conversion 1 March 14, 2012 11:13
Mesh Reference Values problem. rezki STAR-CCM+ 7 July 19, 2010 05:30
external flow with snappyHexMesh chelvistero OpenFOAM 11 January 15, 2010 20:43


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