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

[swak4Foam] groovyBC synthax help

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 31, 2011, 22:08
Default groovyBC synthax help
  #1
New Member
 
Join Date: Mar 2009
Posts: 22
Rep Power: 17
Baldy is on a distinguished road
I'm trying to set a velocity profile at my inlet for a 2D laminar flow using 1.6-ext

The equation I'm trying to write is U(y)=3/2*U0*(1-(2*y^2)/b^2)

From looking at other threads this is the best I could come up with:

Code:
   inlet
    {
	type            groovyBC;
	value           uniform (0 0 0);
        variables 	  "U_0=2.17;b=0.01;profile=(3/2)*U_0*(1-((pos().y*2)^2)/b^2)";
	valueExpression	"vector (profile, 0, 0)";
    }
but I'm getting this error:


gradientInternalCoeffs cannot be called for a genericFvPatchField (actual type groovyBC)
on patch inlet of field U in file "/home/OpenFOAM/Simulation/test_1/0/U"
You are probably trying to solve for a field with a generic boundary condition.

From function genericFvPatchField<Type>::gradientInternalCoeffs( ) const
in file fields/fvPatchFields/basic/generic/genericFvPatchField.C at line 782.
Baldy is offline   Reply With Quote

Old   November 1, 2011, 02:23
Default
  #2
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25
nimasam is on a distinguished road
Quote:
Originally Posted by Baldy View Post
I'm trying to set a velocity profile at my inlet for a 2D laminar flow using 1.6-ext

The equation I'm trying to write is U(y)=3/2*U0*(1-(2*y^2)/b^2)

From looking at other threads this is the best I could come up with:

Code:
   inlet
    {
    type            groovyBC;
    value           uniform (0 0 0);
        variables       "U_0=2.17;b=0.01;profile=(3/2)*U_0*(1-((pos().y*2)^2)/b^2)";
    valueExpression    "vector (profile, 0, 0)";
    }
but I'm getting this error:


gradientInternalCoeffs cannot be called for a genericFvPatchField (actual type groovyBC)
on patch inlet of field U in file "/home/OpenFOAM/Simulation/test_1/0/U"
You are probably trying to solve for a field with a generic boundary condition.

From function genericFvPatchField<Type>::gradientInternalCoeffs( ) const
in file fields/fvPatchFields/basic/generic/genericFvPatchField.C at line 782.
you have two main obstacles
1) in syntacs why ^ use (2*pow(y,2)) for example for 2*y^2
2)you should add following sentence to the controlDict :
libs ("libOpenFOAM.so""libgroovyBC.so");
nimasam is offline   Reply With Quote

Old   November 13, 2011, 23:41
Default
  #3
New Member
 
Join Date: Mar 2009
Posts: 22
Rep Power: 17
Baldy is on a distinguished road
Works great. Thanks
Baldy is offline   Reply With Quote

Old   March 20, 2012, 09:39
Default
  #4
Senior Member
 
Goutam Saha
Join Date: Dec 2011
Location: UK
Posts: 131
Rep Power: 15
Goutam is on a distinguished road
Dear Badly,

Sorry...

Last edited by Goutam; March 20, 2012 at 11:19.
Goutam is offline   Reply With Quote

Old   March 20, 2012, 10:03
Default
  #5
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 Goutam View Post
Dear Badly,

where I will write libs("libOpenFOAM.so" "libgroovyBC.so"); ?
where is the location of controlDict?
I am using OF_2.1.0.

Thanks
controlDict has been in the same location since the beginning of mankind (OK. Almost. Since OF 1.0). Have a look at the user-guide, chapter 4 (in particular 4.3). But you must already have stumbled upon it when you were going through the first tutorial in the UG
gschaider is offline   Reply With Quote

Old   March 20, 2012, 11:18
Default
  #6
Senior Member
 
Goutam Saha
Join Date: Dec 2011
Location: UK
Posts: 131
Rep Power: 15
Goutam is on a distinguished road
Quote:
Originally Posted by gschaider View Post
controlDict has been in the same location since the beginning of mankind (OK. Almost. Since OF 1.0). Have a look at the user-guide, chapter 4 (in particular 4.3). But you must already have stumbled upon it when you were going through the first tutorial in the UG
Sorry, actually I am using OF 2.1.0 and I want to use groovyBC, I didn't find this. I see the link in openfoamwiki but it does not work. I just missed what I want to ask. Sorry...
Goutam 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 08:53
[swak4Foam] reactingMultiPhaseEulerFoam problems with groovyBC zanilu70 OpenFOAM Community Contributions 4 December 13, 2016 07:46
[swak4Foam] Change in alpha and U with groovyBC in twoPhaseEulerFoam dani2702 OpenFOAM Community Contributions 0 November 17, 2016 04:30
[swak4Foam] groovyBC issue - k and epsilon sagnikmazumdar OpenFOAM Community Contributions 24 March 1, 2015 08:16
[swak4Foam] groovyBC and Eqn.setReference() benk OpenFOAM Community Contributions 3 June 2, 2011 09:49


All times are GMT -4. The time now is 14:23.