|
[Sponsors] |
[swak4Foam] switch between existing BCs with groovyBC?! |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 31, 2013, 07:37 |
switch between existing BCs with groovyBC?!
|
#1 |
Member
Michiel
Join Date: Oct 2010
Location: Delft, Netherlands
Posts: 97
Rep Power: 16 |
Hi,
I have seen in the groovyBC documentation that you can switch between dirichlet and neumann BCs and I would like to use groovyBC for something similar but, I think, a bit more difficult. If possible, I would like to use groovyBC to set up a BC which switches between 2 existing BCs depending on the value of alpha1 in the boundary cell. I would like to switch between 2 contact angle BCs (constantAlphaContactAngle and dynamicAlphaContactAngle). Is groovyBC capable of calling existing BCs? If so, how can I do that? If not, would it be possible to plug in the functions used in the two contact angle BCs in some way? Or should I bypass groovyBC altogether and build my own BC from the mixedBC that is already present in OF?! |
|
September 2, 2013, 07:54 |
|
#2 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 |
GroovyBC is built on top of mixedFvPatchField, i.e. technically it is a mixed BC itself. From a coding perspective, mixed BC is not a combination of fixedGradient and fixedValue, but an implementation of the equation dT/dn = h(T-Tinf). Thus IMO neither groovyBC, nor mixedBC seem to be a good starting point for what you want to achieve.
__________________
*On twitter @akidTwit *Spend as much time formulating your questions as you expect people to spend on their answer. |
|
September 2, 2013, 19:01 |
|
#3 | ||
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Quote:
Easiest would probably be to base a new BC on dynamicContact. Isolate the lines were it differs from constantContact and put a "if" "else" around them. The "if" conditions could be the result of a groovy-swak evaluation but I don't think that you'd want to do that as you had to code something in C++ anyway
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
|||
September 4, 2013, 09:01 |
|
#4 |
Member
Michiel
Join Date: Oct 2010
Location: Delft, Netherlands
Posts: 97
Rep Power: 16 |
Ok, thanks for the explanation guys. I will look into adapting an existing BC.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to set BCs programmatically | incompressible | OpenFOAM Programming & Development | 6 | November 20, 2017 03:47 |
[swak4Foam] "field U not existing or of wrong type" groovyBC error. | immortality | OpenFOAM Community Contributions | 1 | February 4, 2013 16:08 |
[swak4Foam] how is it possible to apply different BC's for regime of flow in groovyBC? | immortality | OpenFOAM Community Contributions | 1 | February 4, 2013 02:55 |
Dealing with BC's in OF 1.6 | vkrastev | OpenFOAM Running, Solving & CFD | 5 | September 4, 2012 12:58 |
Understanding Code behind BCs | Linse | OpenFOAM Programming & Development | 8 | January 9, 2012 09:58 |