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

Access patch geometrical variables using fvPatchVectorField

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By massive_turbulence
  • 1 Post By vishalsacharya

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 26, 2019, 08:06
Default Access patch geometrical variables using fvPatchVectorField
  #1
Senior Member
 
Join Date: Dec 2017
Posts: 153
Rep Power: 8
AliE is on a distinguished road
Dear all,

I know that I can obtain the required info from the mesh directly, but, in any case, do you know a way to access patches and thier geometrical quantities from fvPatchVectorField ?

With the following line, I can get the patch field number patchi:

- const fvPatchVectorField& Up = U.boundaryField()[patchi];

Starting from Up, can I get faceCells in some way or Cf() for example?

Thank you!
AliE is offline   Reply With Quote

Old   February 26, 2019, 08:57
Default
  #2
Senior Member
 
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 13
massive_turbulence is on a distinguished road
Quote:
Originally Posted by AliE View Post
Dear all,

I know that I can obtain the required info from the mesh directly, but, in any case, do you know a way to access patches and thier geometrical quantities from fvPatchVectorField ?

With the following line, I can get the patch field number patchi:

- const fvPatchVectorField& Up = U.boundaryField()[patchi];

Starting from Up, can I get faceCells in some way or Cf() for example?

Thank you!
The object fvPatchVectorField seems to be initialized in fvPatchFields.H
and going back to the object itself seen here it's fvPatchFields.

Code:
 makeFvPatchField(fvPatchScalarField)
 makeFvPatchField(fvPatchVectorField)//line 587 in fvPatchField.h
 makeFvPatchField(fvPatchSphericalTensorField)
 makeFvPatchField(fvPatchSymmTensorField)
 makeFvPatchField(fvPatchTensorField)
Looking through the
header for fvPatchField it seems you should be able to call patch() and snGrad(); these two caught my eye but there are many other functions and it's time consuming to trace down what they all do.
AliE likes this.
massive_turbulence is offline   Reply With Quote

Old   February 26, 2019, 11:55
Arrow
  #3
Member
 
Vishal Achasrya
Join Date: Nov 2011
Posts: 38
Rep Power: 15
vishalsacharya is on a distinguished road
Quote:
Originally Posted by AliE View Post
Dear all,

I know that I can obtain the required info from the mesh directly, but, in any case, do you know a way to access patches and thier geometrical quantities from fvPatchVectorField ?

With the following line, I can get the patch field number patchi:

- const fvPatchVectorField& Up = U.boundaryField()[patchi];

Starting from Up, can I get faceCells in some way or Cf() for example?

Thank you!
Which version of OF are you using?
You can try...

const fvPatchVectorField& Up = U.boundaryField()[patchI];
const labelList faceCellList = Up.patch().faceCells();

you can also access it as a subList using labelList::subList.
Hope this helps?
AliE likes this.
vishalsacharya is offline   Reply With Quote

Old   February 26, 2019, 12:05
Default
  #4
Senior Member
 
Join Date: Dec 2017
Posts: 153
Rep Power: 8
AliE is on a distinguished road
Hello guys,

thank you for the help.

Yes that workd

I have also find out that this is working as well:

- const fvPatch& ptch=U.boundaryField()[patchI].patch();

and then I can acces to the info using ptch.faceCells()


Cheers and Thank you!
AliE 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
[Commercial meshers] Fluent msh and cyclic boundary cfdengineering OpenFOAM Meshing & Mesh Conversion 48 January 25, 2013 04:28
Cyclic Boundary Condition Luiz Eduardo Bittencourt Sampaio (Sampaio) OpenFOAM Running, Solving & CFD 36 July 2, 2012 13:23
chtMultiRegionFoam Tutorial m.nichols19 OpenFOAM 12 September 9, 2010 12:56
Multicomponent fluid Andrea CFX 2 October 11, 2004 06:12
access to variables at interface of porous media? Mazyar FLUENT 0 October 10, 2003 15:59


All times are GMT -4. The time now is 22:46.