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

Understanding Code behind BCs

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 28, 2011, 06:30
Default Understanding Code behind BCs
  #1
Senior Member
 
Bernhard Linseisen
Join Date: May 2010
Location: Heilbronn
Posts: 183
Blog Entries: 1
Rep Power: 15
Linse is on a distinguished road
What do the Code parts of the BCs actually do?

While there already are several implemented boundary conditions and while groovyBC helps with even extending the range of BCs, sometimes it is necessary to do own BCs.

By now this is the case for me as well.
I will have to implement some boundary conditions even groovyBC is not capable of. Therefore I really need to understand how the BCs work, how/where from they get their values, how/where to they write the values to the fields after they maybe have changed them, how the changes of the values take place inside the BC...

I hope somebody can tell me a good starting point for understanding how the BCs work in the code-way. Maybe even the place of a very basic (and extensively commented?) BC would be enough...

To all: Feel free to add further questions on the code of the BCs and particularly the answers will be welcome!
Nevertheless, please avoid questions on the physics side of the BCs, as there are other threads for these!
Linse is offline   Reply With Quote

Old   October 29, 2011, 02:20
Default
  #2
ata
Senior Member
 
ata's Avatar
 
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 17
ata is on a distinguished road
Hi
See
/opt/openfoam201/src/finiteVolume/fields/fvPatchFields/basic/fixedValue
Good luck

Ata
ata is offline   Reply With Quote

Old   November 3, 2011, 17:43
Default
  #3
Senior Member
 
Bernhard Linseisen
Join Date: May 2010
Location: Heilbronn
Posts: 183
Blog Entries: 1
Rep Power: 15
Linse is on a distinguished road
Hi Ata!

Thank you already by now!
This point truly is a good starting point for understanding the structure of the BCs!
Linse is offline   Reply With Quote

Old   November 29, 2011, 03:33
Default
  #4
New Member
 
Ola Widlund
Join Date: Jun 2011
Location: Sweden
Posts: 13
Rep Power: 14
Ola Widlund is on a distinguished road
Hi,

I guess you're an expert on BC:s by now, but anyway.... What I did the first time was to copy a bc class that inherits from either fixedValue or mixed (depending on what is closest to your needs), then do search-replace on the calss name to make it your own. There are plenty of bc:s in the library that inherit and build on the basic classes. From there it's easy to see where in the code things are done.

Other complex bc:s also contain a lot of useful code snippets you could reuse. For example how to look up values of other fields, read variable settings from the dictionary of the bc, etc.

/Ola
Ola Widlund is offline   Reply With Quote

Old   November 30, 2011, 08:17
Default
  #5
Senior Member
 
Bernhard Linseisen
Join Date: May 2010
Location: Heilbronn
Posts: 183
Blog Entries: 1
Rep Power: 15
Linse is on a distinguished road
Hi Ola,
actually, I am not yet much more advanced concerning BCs.
I have the luxury of having several open problems to solve, so I first decided to work on two other major points while waiting for additional answers in this thread. ;-)

Thank you (and all who will follow with giving further enlightening answers!) for your answers and assistance!
Linse is offline   Reply With Quote

Old   November 30, 2011, 09:13
Default Hi Linse
  #6
Member
 
kshitij neroorkar
Join Date: Mar 2009
Location: Michigan, USA
Posts: 32
Rep Power: 17
kdneroorkar is on a distinguished road
I have a pdf document that I had made some time back for explaining how boundary conditions are implemented in OpenFOAM. I can send it to you if you give me your email address
kdneroorkar is offline   Reply With Quote

Old   December 13, 2011, 09:40
Default
  #7
New Member
 
jack zhou
Join Date: Dec 2011
Posts: 1
Rep Power: 0
jack zhou is on a distinguished road
Quote:
Originally Posted by kdneroorkar View Post
I have a pdf document that I had made some time back for explaining how boundary conditions are implemented in OpenFOAM. I can send it to you if you give me your email address
would you like to give me another copy?my E-address is mezjr@foxmail.com.
Thanks,
jack Zhou
jack zhou is offline   Reply With Quote

Old   January 8, 2012, 04:48
Default
  #8
Member
 
Andreas Ruopp
Join Date: Aug 2009
Location: Stuttgart / Germany
Posts: 31
Rep Power: 16
andyru is on a distinguished road
Hellokshitij ,

could you send me your bc-pdf too? I'm currently working on a internalfixedvalue-problem...

Thanks in advance

Andy
andyru is offline   Reply With Quote

Old   January 9, 2012, 08:58
Default
  #9
Member
 
kshitij neroorkar
Join Date: Mar 2009
Location: Michigan, USA
Posts: 32
Rep Power: 17
kdneroorkar is on a distinguished road
Hi Andy
can you please send me your email address, mine is kdneroorkar(at)gmail.com
Thanks
Kshitij
kdneroorkar 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
The FOAM Documentation Project - SHUT-DOWN holger_marschall OpenFOAM 242 March 7, 2013 12:30
Debugging Unsteady 2-D Panel Method Code: Wake Modeling RajeshAero Main CFD Forum 5 November 10, 2011 05:48
Understanding k-omega SST model source code tmhonka OpenFOAM Programming & Development 1 September 8, 2009 07:33
Design Integration with CFD? John C. Chien Main CFD Forum 19 May 17, 2001 15:56
What is the Better Way to Do CFD? John C. Chien Main CFD Forum 54 April 23, 2001 08:10


All times are GMT -4. The time now is 02:37.