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

Implementation of boundary conditions

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By marupio

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 2, 2014, 15:24
Question Implementation of boundary conditions
  #1
New Member
 
anonymous
Join Date: May 2014
Posts: 1
Rep Power: 0
Floreas is on a distinguished road
Hi,

I try to understand how are the boundary conditions implemented in the source code of a certain application.
As a concrete example, let's say that the application is interFoam and the boundary condition is inletOutlet. My question is where in the code of interFoam are called (if they are) the functions of the class inletOutletFvPatchField.
May someone help me with some hints or links to some documentation?

Thanks in advance,
Daniel
Floreas is offline   Reply With Quote

Old   September 3, 2014, 04:24
Default
  #2
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 21
marupio is on a distinguished road
That's OpenFOAM's runtime selection mechanism. You won't find any reference to derived boundary conditions in the solvers (or you shouldn't... sometimes one may depend on a specific type). The solvers only need to know about fvPatch and fvPatchField (which are the base classes for the mesh boundary and the boundary condition). fvPatch and fvPatchField are smart enough that when you build the mesh in the solver (e.g. #include "createMesh.H") they will load the correct derived boundary conditions (e.g. inletOutletFvPatchField). The solver only needs interact with the base class, such as patch.correct() or .update() or whatever functions exist in fvPatchField.

The reason this mechanism exists is it allows you to add/modify/remove the boundary conditions, without having to change the code in the solvers... there's dozens of solvers, and that would be impractical.

The actual implementation of the runtime selection is a bit ugly with a lot of pre-defined macros. This attempts to describe it:

http://openfoamwiki.net/index.php/Op...tion_mechanism

Enjoy!
andyru likes this.
__________________
~~~
Follow me on twitter @DavidGaden
marupio 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
mesh file for flow over a circular cylinder Ardalan Main CFD Forum 7 December 15, 2020 13:06
Error finding variable "THERMX" sunilpatil CFX 8 April 26, 2013 07:00
CFX13 Post Periodic interface EtaEta CFX 7 December 8, 2011 17:15
Please help with flow around car modelling! Tudor Miron CFX 17 March 19, 2004 19:23
A problem about setting boundary conditions lyang Main CFD Forum 0 September 19, 1999 18:29


All times are GMT -4. The time now is 18:43.