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

How to access to an fvpatchfiel object on a patch from other object on the same patch

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 11, 2018, 15:43
Default How to access to an fvpatchfiel object on a patch from other object on the same patch
  #1
New Member
 
SSSSS
Join Date: Jun 2011
Posts: 29
Rep Power: 15
doctorWho is on a distinguished road
Hi,


I am trying to make a boundary condition class.
For velocity, I have a class derived from fixedValueFvPatchVectorField class which has a public member function as follows:


class customUBoundary : public fixedValueFvPatchVectorField

{
...
public:
const fvScalar& Ustar();

}


another boundary condition, say customKBoundary which want to access to the public member function of customUBoundary.


I could find out a way to get the velocity field from the customKBoundary on the same boundary patch as follows:


const volVectorField& U = db().lookupObject<volVectorField>("U);
const fvMesh& mesh = U.mesh();
label patchId = mesh.boundaryMesh().findPatchID(this->patch().name());
const vectorField& velocityField = U.boundaryField()[patchId];


is there a way to get customUBoundary object so that customKBoundary class can call directly customUBoundary.Ustar() member function like


const customUBoundary& temp = dynamic_cast<customUBoundary>(U.boundaryField()[patchId])


Thanks in advance.
doctorWho 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
Problem with cyclic boundaries in Openfoam 1.5 fs82 OpenFOAM 36 January 7, 2015 01:31
chtMultiRegionFoam Tutorial m.nichols19 OpenFOAM 12 September 9, 2010 12:56
[Other] StarToFoam error Kart OpenFOAM Meshing & Mesh Conversion 1 February 4, 2010 05:38
CheckMeshbs errors ivanyao OpenFOAM Running, Solving & CFD 2 March 11, 2009 03:34
[blockMesh] BlockMeshmergePatchPairs hjasak OpenFOAM Meshing & Mesh Conversion 11 August 15, 2008 08:36


All times are GMT -4. The time now is 04:51.