CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Pre-Processing

switch between existing BCs with groovyBC?!

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   August 31, 2013, 06:37
Default switch between existing BCs with groovyBC?!
  #1
Member
 
Michiel
Join Date: Oct 2010
Location: Delft, Netherlands
Posts: 97
Rep Power: 6
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, 06:54
Default
  #2
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Delft, Netherlands
Posts: 919
Rep Power: 17
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.
*Help define the OpenFOAM stackexchange Q&A site: http://area51.stackexchange.com/prop...oam-technology
akidess is offline   Reply With Quote

Old   September 2, 2013, 18:01
Default
  #3
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
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, 08:01
Default
  #4
Member
 
Michiel
Join Date: Oct 2010
Location: Delft, Netherlands
Posts: 97
Rep Power: 6
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

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
"field U not existing or of wrong type" groovyBC error. immortality OpenFOAM Running, Solving & CFD 1 February 4, 2013 16:08
how is it possible to apply different BC's for regime of flow in groovyBC? immortality OpenFOAM Running, Solving & CFD 1 February 4, 2013 02:55
Dealing with BC's in OF 1.6 vkrastev OpenFOAM Running, Solving & CFD 5 September 4, 2012 11:58
Understanding Code behind BCs Linse OpenFOAM Programming & Development 8 January 9, 2012 09:58
groovyBC and Eqn.setReference() benk OpenFOAM 3 June 2, 2011 08:49


All times are GMT -4. The time now is 10:55.