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

[swak4Foam] groovyBC results diferent from funkySetBoundaryField?!

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 22, 2012, 09:52
Default groovyBC results diferent from funkySetBoundaryField?!
  #1
Member
 
Carlos Xisto
Join Date: Nov 2009
Location: Covilhã, Portugal
Posts: 53
Rep Power: 16
xisto is on a distinguished road
Send a message via MSN to xisto
Hello,

I'm trying to run a case with groovyBC because my boudary condition will need to change with time and I notice that time() is available there.

However when I'm running the case (without using time, check bottom expression) the correct values are putted on the boundary but the internal field it's not changing.
Code:
    Inlet
    {
        type             groovyBC;
        value uniform (0 0 0);
        variables        "bx=2.669/sqrt(pos().x*pos().x+pos().y*pos().y)*sin(atan(pos().y/pos().x));by=-2.669/sqrt(pos().x*pos().x+pos().y*pos().y)*cos(atan(pos().y/pos().x));";  
        valueExpression "vector(bx,by,0)"; 
    }
You may say that the problem could be with my equations, but when I using funkySetBoundaryField with the same expression to create my fixedValue nonuniform BC everything works..

Perhaps I'm doing something wrong with groovy?!
xisto is offline   Reply With Quote

Old   October 22, 2012, 15:28
Default
  #2
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 xisto View Post
Hello,

I'm trying to run a case with groovyBC because my boudary condition will need to change with time and I notice that time() is available there.

However when I'm running the case (without using time, check bottom expression) the correct values are putted on the boundary but the internal field it's not changing.
Code:
    Inlet
    {
        type             groovyBC;
        value uniform (0 0 0);
        variables        "bx=2.669/sqrt(pos().x*pos().x+pos().y*pos().y)*sin(atan(pos().y/pos().x));by=-2.669/sqrt(pos().x*pos().x+pos().y*pos().y)*cos(atan(pos().y/pos().x));";  
        valueExpression "vector(bx,by,0)"; 
    }
You may say that the problem could be with my equations, but when I using funkySetBoundaryField with the same expression to create my fixedValue nonuniform BC everything works..

Perhaps I'm doing something wrong with groovy?!
Looks alright to me. In later timesteps the output of groovyBC should be more verbose. Is the value of the field refValue the same (just check superficially) the same you get as when you used funkySetBoundaryField? What is the value of valueFraction?

BTW: which version of swak are you using? Check if there is an output "swakVersion: x.y.z" just below the regular OF-Header when you run funkySetBoundaryField. Not that I think that this is your problem because I'm not aware of a bug like this in the past
__________________
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   October 22, 2012, 16:05
Default
  #3
Member
 
Carlos Xisto
Join Date: Nov 2009
Location: Covilhã, Portugal
Posts: 53
Rep Power: 16
xisto is on a distinguished road
Send a message via MSN to xisto
The value and refValue are the same and both of them are the same as funkySetBoudary.

valueFraction should be "1" Drichilet BC

The version is 0.2.0. But, one strange thing happen, when I'm use a similar expression for a scalar its works.

Maybe its somehow related to my code (or not). At least I have find a way of get around this.

Thanks for your help Bernhard,

Carlos
xisto is offline   Reply With Quote

Old   October 22, 2012, 16:57
Default
  #4
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 xisto View Post
The value and refValue are the same and both of them are the same as funkySetBoudary.

valueFraction should be "1" Drichilet BC
And is it? "1" I mean
Quote:
Originally Posted by xisto View Post
The version is 0.2.0. But, one strange thing happen, when I'm use a similar expression for a scalar its works.

Maybe its somehow related to my code (or not). At least I have find a way of get around this.
If value is correct then it has something to do with your code. Because the value of value is not set by groovyBC but its super-class (mixed that is).

What you could do is: set the type of the BC to mixed. Set the refValue with funkySetBoundaryField to the value you want and try this. If the problem persists then it is a problem with mixed
__________________
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   October 22, 2012, 17:50
Default
  #5
Member
 
Carlos Xisto
Join Date: Nov 2009
Location: Covilhã, Portugal
Posts: 53
Rep Power: 16
xisto is on a distinguished road
Send a message via MSN to xisto
Yes it is "1".

I'm sure now that the problem is with my code. I'm working on a solution now..

Thanks,

Carlos
xisto is offline   Reply With Quote

Old   October 23, 2012, 06:59
Default
  #6
Member
 
Carlos Xisto
Join Date: Nov 2009
Location: Covilhã, Portugal
Posts: 53
Rep Power: 16
xisto is on a distinguished road
Send a message via MSN to xisto
Another question..

Imagine that in my BC I need to know the field value in the cell next to the wall and I need to know the distance from the BC to that cell.

Something like this
Code:
 
B[wall]=B[wall+1]/deltaY;
It is possible? In one of your presentations you say:

One feature that was suggested by a user for old-school
groovyBC was to access the values on other boundaries
• This is done via external variables
• For technical reasons only a single value (min, max, average) is
stored
• This has been extended for other entities (fields, sets, . . . )

Thanks,

Carlos
xisto is offline   Reply With Quote

Old   October 23, 2012, 08:23
Default
  #7
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 xisto View Post
Another question..

Imagine that in my BC I need to know the field value in the cell next to the wall and I need to know the distance from the BC to that cell.

Something like this
Code:
 
B[wall]=B[wall+1]/deltaY;
It is possible? In one of your presentations you say:
Been there. Done that. Have a look at http://openfoamwiki.net/index.php/Co...g_to_need_are: (you'll want delta() and internalField(B) )

Quote:
Originally Posted by xisto View Post
One feature that was suggested by a user for old-school
groovyBC was to access the values on other boundaries
• This is done via external variables
• For technical reasons only a single value (min, max, average) is
stored
• This has been extended for other entities (fields, sets, . . . )
Well. This is only for "other" boundaries. On the same you'll get what you want with the mentioned functions
__________________
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   October 23, 2012, 09:37
Default
  #8
Member
 
Carlos Xisto
Join Date: Nov 2009
Location: Covilhã, Portugal
Posts: 53
Rep Power: 16
xisto is on a distinguished road
Send a message via MSN to xisto
Great!!

Your utilities are the best...

Thanks,

Carlos
xisto is offline   Reply With Quote

Old   October 23, 2012, 10:15
Default
  #9
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 xisto View Post
Your utilities are the best...
Well. They're standing on the shoulders of giants: the functionality is all OpenFOAM. They just put a wrapper around it
__________________
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

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
[swak4Foam] groovyBC for oscillatory flow liybzd OpenFOAM Community Contributions 5 November 12, 2018 07:53
[swak4Foam] Change in alpha and U with groovyBC in twoPhaseEulerFoam dani2702 OpenFOAM Community Contributions 0 November 17, 2016 03:30
[swak4Foam] groovyBC issue - k and epsilon sagnikmazumdar OpenFOAM Community Contributions 24 March 1, 2015 07:16
Creating a tool to interpolate results Luis Batista OpenFOAM Running, Solving & CFD 2 April 11, 2013 08:15
[swak4Foam] groovyBC and Eqn.setReference() benk OpenFOAM Community Contributions 3 June 2, 2011 08:49


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