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

How to get access to a certain boundary?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 28, 2013, 22:09
Question How to get access to a certain boundary?
  #1
New Member
 
Ke Li
Join Date: Oct 2013
Posts: 2
Rep Power: 0
TankTinyPig is on a distinguished road
Hello!
Good day to everyone!

I'm a beginner of operating OpenFOAM codes, I have some trouble in searching a certain class instance and accessing its memberfunctions. Details are listed below:

I'm going to simulate two solid body in fluid fields. One can move freely and the other must move according to the movement of the first one. So I use two boundary field type to abtain this goal. One is "sixDofSolidMotionDisplacement" named "wing" and the other is "angularOscillatingDisplacment" named "plate", and they are set in file "0/pointDisplacement".

Now, in order to make the forced move object rotate according to the movement of the first one, I have to modify the "angularOscillatingDisplacment" class to make "plate" be able to get information of the class instance "wing". Now it's time to ask the question:

I know the name is "wing", how can I find this class instance?

Thank you all!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
TankTinyPig is offline   Reply With Quote

Old   October 31, 2013, 06:03
Default
  #2
Senior Member
 
mkraposhin's Avatar
 
Matvey Kraposhin
Join Date: Mar 2009
Location: Moscow, Russian Federation
Posts: 355
Rep Power: 21
mkraposhin is on a distinguished road
Quote:
Originally Posted by TankTinyPig View Post
Hello!
Good day to everyone!

I'm a beginner of operating OpenFOAM codes, I have some trouble in searching a certain class instance and accessing its memberfunctions. Details are listed below:

I'm going to simulate two solid body in fluid fields. One can move freely and the other must move according to the movement of the first one. So I use two boundary field type to abtain this goal. One is "sixDofSolidMotionDisplacement" named "wing" and the other is "angularOscillatingDisplacment" named "plate", and they are set in file "0/pointDisplacement".

Now, in order to make the forced move object rotate according to the movement of the first one, I have to modify the "angularOscillatingDisplacment" class to make "plate" be able to get information of the class instance "wing". Now it's time to ask the question:

I know the name is "wing", how can I find this class instance?

Thank you all!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Code:
 label wingPatchID = mesh.boundary().findPatchID("wing");
 
 //for any field S of type T:
 fvPatchField<T>& pwing = S.boundaryField()[wingPatchID];
Have a look at the OpenFOAM source code documentation:

http://foam.sourceforge.net/docs/cpp/a00741.html

http://foam.sourceforge.net/docs/cpp/a01665.html
mkraposhin is offline   Reply With Quote

Old   October 31, 2013, 21:43
Default
  #3
New Member
 
Ke Li
Join Date: Oct 2013
Posts: 2
Rep Power: 0
TankTinyPig is on a distinguished road
oh! It works out! Thank you very much!!!!!!
TankTinyPig is offline   Reply With Quote

Reply

Tags
boundary, dynamic mesh, pimpledymfoam


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
Domain Imbalance HMR CFX 5 October 10, 2016 06:57
Implementation of boundary conditions for FVM Tom Main CFD Forum 7 August 26, 2014 06:58
Water subcooled boiling Attesz CFX 7 January 5, 2013 04:32
access to a property in a boundary condition using UDF Negin_Salehi Fluent UDF and Scheme Programming 3 November 16, 2012 17:11
Boundary conditions? Tom Main CFD Forum 0 November 5, 2002 02:54


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