![]() |
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! |
Hi
See /opt/openfoam201/src/finiteVolume/fields/fvPatchFields/basic/fixedValue Good luck Ata |
Hi Ata!
Thank you already by now! This point truly is a good starting point for understanding the structure of the BCs! |
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 |
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! |
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
|
Quote:
Thanks, jack Zhou |
Hellokshitij ,
could you send me your bc-pdf too? I'm currently working on a internalfixedvalue-problem... Thanks in advance Andy |
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 08:51. |