CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[swak4Foam] switch between existing BCs with groovyBC?!

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 31, 2013, 07:37
Default switch between existing BCs with groovyBC?!
  #1
Member
 
Michiel
Join Date: Oct 2010
Location: Delft, Netherlands
Posts: 97
Rep Power: 16
michielm is on a distinguished road
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?!
michielm is offline   Reply With Quote

Old   September 2, 2013, 07:54
Default
  #2
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
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.
akidess is offline   Reply With Quote

Old   September 2, 2013, 19:01
Default
  #3
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by michielm View Post
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?!
Can't be done with groovyBC. I'm not even sure if such a switch between existing boundary conditions can be implemented in C++. If it can it will result in very ugly code.

Quote:
Originally Posted by akidess View Post
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.
Right.

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
gschaider is offline   Reply With Quote

Old   September 4, 2013, 09:01
Default
  #4
Member
 
Michiel
Join Date: Oct 2010
Location: Delft, Netherlands
Posts: 97
Rep Power: 16
michielm is on a distinguished road
Ok, thanks for the explanation guys. I will look into adapting an existing BC.
michielm 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
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


All times are GMT -4. The time now is 06:50.