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

[swak4Foam] epsilon groovyBC problem

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 17, 2011, 17:48
Default epsilon groovyBC problem
  #1
New Member
 
Thomas Smyth
Join Date: Apr 2010
Posts: 14
Rep Power: 16
Thom is on a distinguished road
Hi everyone,

I am trying to create an epsilon inlet using groovyBC but am having a couple of problems. It is probably something very simple but I am hoping you can point me in the right direction!

here's my epsilon inlet condition:

Code:
inlet
     {
         type            groovyBC;
        variables      "uStar=0.005;z0=0.05;K=0.41;epsilon=pow(uStar,3)/K(pos().z+z0)";
         valueExpression "epsilon";
     value uniform 0;
        }
As I said sorry if this is probably very trivial but I am still very much an foam novice.

Thanks for your help and time
Thomas
Thom is offline   Reply With Quote

Old   May 18, 2011, 03:23
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 Thom View Post
Hi everyone,

I am trying to create an epsilon inlet using groovyBC but am having a couple of problems. It is probably something very simple but I am hoping you can point me in the right direction!

here's my epsilon inlet condition:

Code:
inlet
     {
         type            groovyBC;
        variables      "uStar=0.005;z0=0.05;K=0.41;epsilon=pow(uStar,3)/K(pos().z+z0)";
         valueExpression "epsilon";
     value uniform 0;
        }
As I said sorry if this is probably very trivial but I am still very much an foam novice.

Thanks for your help and time
Thomas
It would be easier to point you in the right direction if you said HOW the problem manifests itself.

Is your problem a syntax error? Because you're using K like a function.

Apart from that: Having a variable with the same name as the field might lead to weird behaviour (the variable should shadow the field value and your case should be alright anyway)

And one last thing: Never ever (not even for fun and not even in the "value"-field that is probably never going to be used) set epsilon to zero
gschaider is offline   Reply With Quote

Old   May 18, 2011, 05:15
Default
  #3
New Member
 
Thomas Smyth
Join Date: Apr 2010
Posts: 14
Rep Power: 16
Thom is on a distinguished road
Quote:
Originally Posted by gschaider View Post
It would be easier to point you in the right direction if you said HOW the problem manifests itself.

Is your problem a syntax error? Because you're using K like a function.

Apart from that: Having a variable with the same name as the field might lead to weird behaviour (the variable should shadow the field value and your case should be alright anyway)

And one last thing: Never ever (not even for fun and not even in the "value"-field that is probably never going to be used) set epsilon to zero

Hi Bernhard,

It was a floating point exception which led me to believe I was doing something mathematically incorrect. Thanks for pointing me in the right direction as the K was providing the problem. I appreciate your advice on the other issues too especially the epsilon value. I just realised how novice an error that was.

Thanks again for all your help,it seems to be working correctly now (hopefully!)

Thomas
Thom is offline   Reply With Quote

Old   May 18, 2011, 11:29
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 Thom View Post
Hi Bernhard,

It was a floating point exception which led me to believe I was doing something mathematically incorrect. Thanks for pointing me in the right direction as the K was providing the problem. I appreciate your advice on the other issues too especially the epsilon value. I just realised how novice an error that was.

Thanks again for all your help,it seems to be working correctly now (hopefully!)

Thomas
Interesting: you didn't get a syntax-error but a floating point exception? Strange
gschaider is offline   Reply With Quote

Old   October 25, 2012, 22:53
Default
  #5
Member
 
Gregoire Junqua
Join Date: Jun 2011
Location: China
Posts: 58
Blog Entries: 1
Rep Power: 14
gregjunqua is on a distinguished road
Hi did you solve your problem?
I am using this equation too as :

inlet
{
type groovyBC
variables "u_f=0.521;z0=0.001;z_f=pos().y;K=0.4;epsi = pow(u_f,3)/(K(z_f+z0))";
valueExpression "epsi";

}

i also got the following error :

From function groovyBCFvPatchField<Type>::groovyBCFvPatchField(c onst fvPatch& p,const DimensionedField<Type, volMesh>& iF,const dictionary& dict)
in file groovyBCFvPatchField.C at line 119
No value defined for epsilon on inlet therefore using 100{0}

I try many solution and none is working ...
is there something i had miss? because i do it for my wind condition and it work well ...
i guess because it's not a vector but i don't know how to solve this problem
gregjunqua is offline   Reply With Quote

Old   October 26, 2012, 05:16
Default
  #6
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 gregjunqua View Post
Hi did you solve your problem?
I am using this equation too as :

inlet
{
type groovyBC
variables "u_f=0.521;z0=0.001;z_f=pos().y;K=0.4;epsi = pow(u_f,3)/(K(z_f+z0))";
valueExpression "epsi";

}

i also got the following error :

From function groovyBCFvPatchField<Type>::groovyBCFvPatchField(c onst fvPatch& p,const DimensionedField<Type, volMesh>& iF,const dictionary& dict)
in file groovyBCFvPatchField.C at line 119
No value defined for epsilon on inlet therefore using 100{0}

I try many solution and none is working ...
is there something i had miss? because i do it for my wind condition and it work well ...
i guess because it's not a vector but i don't know how to solve this problem
What this warning (it is not an error because the simulation continues to run .... at that point) means is that during construction the valueExpression is not evaluated (that would lead to all kinds of circular dependencies in the cases with fields that are not yet constructed/loaded). So the constructor assumes that you define something like "value uniform 1e-2;" or so, which it uses only until all fields are being loaded. If you didn't define that groovyBC decides to play it nice and "fill in a value for you". The value that fits most situation which is 0. Problem is that 0 is not a very good choice for epsilon.

So declare an approximate 'value' for epsilon. It will only be used until all other fields are loaded. After that your valueExpression will be used
__________________
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

Tags
epsilon, groovybc


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
simpleFoam error - "Floating point exception" mbcx4jc2 OpenFOAM Running, Solving & CFD 12 August 4, 2015 02:20
[swak4Foam] Problem with fully developed velocity profile groovyBC in 2D axi-sym mesh harshad88 OpenFOAM Community Contributions 7 July 24, 2014 14:28
[swak4Foam] a problem in groovyBC: "syntax error, unexpected '('" immortality OpenFOAM Community Contributions 14 December 5, 2012 04:22
___Minus epsilon problem___ maysmech OpenFOAM 0 January 3, 2011 03:10
Problem with epsilon joshK OpenFOAM 1 October 8, 2010 01:55


All times are GMT -4. The time now is 22:45.