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

How access member variable of a boundary condition

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 11, 2014, 08:38
Default How access member variable of a boundary condition
  #1
New Member
 
Join Date: Dec 2012
Posts: 13
Rep Power: 13
Vesposo is on a distinguished road
Hi,

i want to access in my own boundary condition a member variable of another boundary condition.

For example:

There is a boundary "anotherFvPatchScalarField" condition with the variable

word info = "anInfo";


in my own boundary condition I want to access the variable info:

word patchName = "patchWithVariableInfo";
label patchID = this->patch().boundaryMesh().findPatchID(patchName)

const fvPatch& anotherPatch = this->patch().boundaryMesh()[patchId_];


Info << reCast<anotherFvPatchScalarField>(anotherPatch).in fo;


But, there is a cast error in the last line.

Attempt to cast type wall to type anotherFvPatchScalarField.

Any hints?
Thanks

Last edited by Vesposo; March 11, 2014 at 14:55.
Vesposo is offline   Reply With Quote

Old   March 13, 2014, 08:49
Default
  #2
New Member
 
Join Date: Dec 2012
Posts: 13
Rep Power: 13
Vesposo is on a distinguished road
The problem is that

this->patch().boundaryMesh()[patchId_]

returns a fvPatch and not a specific fvPatchField like anotherFvPatchScalarField.

Is there a possibility in my boundary condition to access fvPatchFields from a specific fvPatch?
Vesposo 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
Variable names for mass flux for a recirculating-outlet boundary condition BRNN Fluent UDF and Scheme Programming 7 September 4, 2018 14:49
Dirichlet boundary condition for additional variable on the wall ftab CFX 13 January 27, 2013 13:24
Slip boundary condition what is inside normunds OpenFOAM Running, Solving & CFD 2 June 4, 2007 07:45
Additional variable - wall boundary condition flga CFX 2 May 30, 2007 04:14
Variable Boundary Condition Houman CFX 0 September 5, 2006 06:03


All times are GMT -4. The time now is 06:40.