CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Understanding Code behind BCs (http://www.cfd-online.com/Forums/openfoam-programming-development/93857-understanding-code-behind-bcs.html)

Linse October 28, 2011 06:30

Understanding Code behind BCs
 
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!

ata October 29, 2011 02:20

Hi
See
/opt/openfoam201/src/finiteVolume/fields/fvPatchFields/basic/fixedValue
Good luck

Ata

Linse November 3, 2011 18:43

Hi Ata!

Thank you already by now!
This point truly is a good starting point for understanding the structure of the BCs!

Ola Widlund November 29, 2011 04:33

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

Linse November 30, 2011 09:17

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!

kdneroorkar November 30, 2011 10:13

Hi Linse
 
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

jack zhou December 13, 2011 10:40

Quote:

Originally Posted by kdneroorkar (Post 334131)
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

andyru January 8, 2012 05:48

Hellokshitij ,

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

Thanks in advance

Andy

kdneroorkar January 9, 2012 09:58

Hi Andy
can you please send me your email address, mine is kdneroorkar(at)gmail.com
Thanks
Kshitij


All times are GMT -4. The time now is 16:39.