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

In pointPatchField, how to read coordinate values of mesh

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 18, 2014, 08:40
Default In pointPatchField, how to read coordinate values of mesh
  #1
New Member
 
Jarvis
Join Date: Jun 2013
Posts: 14
Rep Power: 12
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, 11:03
Default
  #2
Senior Member
 
JNSN's Avatar
 
Jan
Join Date: Jul 2009
Location: Hamburg
Posts: 137
Rep Power: 19
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, 05:51
Default
  #3
New Member
 
Jarvis
Join Date: Jun 2013
Posts: 14
Rep Power: 12
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, 15:44
Default
  #4
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 17
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 19, 2014, 23:52
Default
  #5
New Member
 
Jarvis
Join Date: Jun 2013
Posts: 14
Rep Power: 12
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, 13:21
Default
  #6
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 17
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


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


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