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

[swak4Foam] GroovyBC problem in the defining inlet velocity

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By gschaider

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 1, 2011, 23:32
Question GroovyBC problem in the defining inlet velocity
  #1
New Member
 
Quan Zhou
Join Date: Jul 2010
Posts: 5
Rep Power: 15
iampolaris is on a distinguished road
Hello, every one!
As defining inlet velocity of a two-phase flow bed, in which the voidage is constant, i need to ensure that the inlet mass flux of one phase is equal to the outlet flux from the top patch. Based on the groovyBC utility, i have defined Ua(volvectorField of one phase) in the inlet boundary, as shown below. UsL and UsR are both the inlet boundary.
boundaryField
20 {
21 UsL
22 {
23 type groovyBC;
24 valueExpression "0.5*flux";
25 variables "totalArea@UsL=sum(mag(Sf()));
flux@top=sum(phia())/totalArea/ 929.5;";
26 value uniform ( 0 0 0 );
27 }
28
29 UsR
30 {
31 type groovyBC;
32 valueExpression "0.5*flux";
33 variables "totalArea@UsR=sum(mag(Sf()));
flux@top=sum(phia())/totalArea/ 929.5;";
34 value uniform ( 0 0 0 );
35 }

35 }
........
However, when i ran the case, there were errors displayed on the screen.
"
--> FOAM FATAL IO ERROR:
problem while reading header for object Ua

file: /home/zhouquan/OpenFOAM/zhouquan-1.7.1/run/tutorials/multiphase/twoPhaseEulerFoam/bed3/0/Ua at line 1.

From function regIOobject::readStream()
in file db/regIOobject/regIOobjectRead.C at line 69.
"
Who can tell me how to do with it?
Thank you!
iampolaris is offline   Reply With Quote

Old   August 2, 2011, 05:08
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 iampolaris View Post
However, when i ran the case, there were errors displayed on the screen.
"
--> FOAM FATAL IO ERROR:
problem while reading header for object Ua

file: /home/zhouquan/OpenFOAM/zhouquan-1.7.1/run/tutorials/multiphase/twoPhaseEulerFoam/bed3/0/Ua at line 1.

From function regIOobject::readStream()
in file db/regIOobject/regIOobjectRead.C at line 69.
"
Who can tell me how to do with it?
Thank you!
"reading header" means that OF has a problem with the meta-information at the top of the file (the stuff in the "FoamFile" dictionary). IS it possible that you accidentially damaged that while editing?
gschaider is offline   Reply With Quote

Old   August 2, 2011, 08:27
Question
  #3
New Member
 
Quan Zhou
Join Date: Jul 2010
Posts: 5
Rep Power: 15
iampolaris is on a distinguished road
Quote:
Originally Posted by gschaider View Post
"reading header" means that OF has a problem with the meta-information at the top of the file (the stuff in the "FoamFile" dictionary). IS it possible that you accidentially damaged that while editing?
Bernhard, Thank you for you reply!
As you pointed out, It's the error that i deleted the top of the file by accident. However, after correcting the mistake and running the case, there was another error.
"
file: /home/zhouquan/OpenFOAM/zhouquan-1.7.1/run/tutorials/multiphase/twoPhaseEulerFoam/bed3/0/Ua::boundaryField::UsL from line 25 to line 28.

From function fvPatchField<Type>::New(const fvPatch&, const DimensionedField<Type, volMesh>&, const dictionary&)
in file /opt/openfoam171/src/finiteVolume/lnInclude/newFvPatchField.C at line 110.

FOAM exiting
"
What's wrong with the usage of groovyBC utility in my case? Besides, I have thought about the message and had a questions about it. As for defining the volvectorField with groovyBC utility in the boundary, it only gives the definition of "variables" and "valueExpression", but without direction of the vector(eg. Ua in my definition). How does it work?
iampolaris is offline   Reply With Quote

Old   August 2, 2011, 12:55
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 iampolaris View Post
Bernhard, Thank you for you reply!
As you pointed out, It's the error that i deleted the top of the file by accident. However, after correcting the mistake and running the case, there was another error.
"
file: /home/zhouquan/OpenFOAM/zhouquan-1.7.1/run/tutorials/multiphase/twoPhaseEulerFoam/bed3/0/Ua::boundaryField::UsL from line 25 to line 28.

From function fvPatchField<Type>::New(const fvPatch&, const DimensionedField<Type, volMesh>&, const dictionary&)
in file /opt/openfoam171/src/finiteVolume/lnInclude/newFvPatchField.C at line 110.

FOAM exiting
"
What's wrong with the usage of groovyBC utility in my case? Besides, I have thought about the message and had a questions about it. As for defining the volvectorField with groovyBC utility in the boundary, it only gives the definition of "variables" and "valueExpression", but without direction of the vector(eg. Ua in my definition). How does it work?
No idea what the problem might be now as there is only a part of the error message there. Did you load the groovyBC.so in the libs-list in the controlDict. Apart from that my guess is that you forgot a } or a ; somewhere
gschaider is offline   Reply With Quote

Old   August 3, 2011, 23:28
Post
  #5
New Member
 
Quan Zhou
Join Date: Jul 2010
Posts: 5
Rep Power: 15
iampolaris is on a distinguished road
Quote:
Originally Posted by gschaider View Post
No idea what the problem might be now as there is only a part of the error message there. Did you load the groovyBC.so in the libs-list in the controlDict. Apart from that my guess is that you forgot a } or a ; somewhere
Thank you very much! After following your advice, i have checked the errors and found that i have wrongly defined the boundary and interfacialproperties. But, as i redefined the boundaryfield in case/0/Ua shown below
"
boundaryField
22 {
23 UsL
24 {
25 type groovyBC;
26 variables "area1@UsL=sum(mag(Sf()));flux1@outlet=sum(phi a)/ area1/929.5;";
27 valueExpression "0.5*flux1";
28 value uniform ( 0 0 0 );
29 }
30
31 UsR
32 {
33 type groovyBC;
34 variables "area2@UsR=sum(mag(Sf()));flux2@outlet=sum(phi a)/ area2/929.5;";
35 valueExpression "0.5*flux2";
36 value uniform ( 0 0 0 );
37 }
"
and ran the case with "twoPhaseEulerFoam", there was error message listed below.
"
--> FOAM FATAL ERROR:
Parser Error at "1.11-15" :"field area1 not existing or of wrong type"
"sum(phia)/area1/929.5"
" ^^^^^ "

From function parsingValue
in file PatchValueExpressionDriver.C at line 192.

I have searched the relevant information, but nothing useful in the web. Why did it say that field area1 is not existing, which i have defined in the "variables" ?
Looking forward to answer, thank you!
iampolaris is offline   Reply With Quote

Old   August 4, 2011, 07:17
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 iampolaris View Post
Thank you very much! After following your advice, i have checked the errors and found that i have wrongly defined the boundary and interfacialproperties. But, as i redefined the boundaryfield in case/0/Ua shown below
"
boundaryField
22 {
23 UsL
24 {
25 type groovyBC;
26 variables "area1@UsL=sum(mag(Sf()));flux1@outlet=sum(phi a)/ area1/929.5;";
27 valueExpression "0.5*flux1";
28 value uniform ( 0 0 0 );
29 }
30
31 UsR
32 {
33 type groovyBC;
34 variables "area2@UsR=sum(mag(Sf()));flux2@outlet=sum(phi a)/ area2/929.5;";
35 valueExpression "0.5*flux2";
36 value uniform ( 0 0 0 );
37 }
"
and ran the case with "twoPhaseEulerFoam", there was error message listed below.
"
--> FOAM FATAL ERROR:
Parser Error at "1.11-15" :"field area1 not existing or of wrong type"
"sum(phia)/area1/929.5"
" ^^^^^ "

From function parsingValue
in file PatchValueExpressionDriver.C at line 192.

I have searched the relevant information, but nothing useful in the web. Why did it say that field area1 is not existing, which i have defined in the "variables" ?
Looking forward to answer, thank you!
Hmm. Strange. Two things I noticed:
a) you're using the old syntax for remote variables so you're using the old-school groovyBC (not the one that comes with swak4Foam). I havn't activly worked on that for over a year and will only fix this bug if it is easy to do
b) area1 and area2 do not have to be remote variables because they are defined on the same patch as the BC. Unlikely, but maybe this is the problem

I'll have a look when I find time. A bug report on the OF-extend-Mantis would speed this up

Bernhard
gschaider is offline   Reply With Quote

Old   October 18, 2014, 08:33
Default
  #7
New Member
 
sd
Join Date: May 2014
Posts: 14
Rep Power: 11
OvGU is on a distinguished road
I am using twoPhaseEulerFoam to simulate gas-solid flow.
My question is - I can easily calculate min fluidization velocity (so no need mass flow rate initially ).
But when I need to consider recirculating flow I only can set mass flow rate. How I change B.C ???
OvGU is offline   Reply With Quote

Old   October 18, 2014, 09:25
Default
  #8
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 OvGU View Post
I am using twoPhaseEulerFoam to simulate gas-solid flow.
My question is - I can easily calculate min fluidization velocity (so no need mass flow rate initially ).
But when I need to consider recirculating flow I only can set mass flow rate. How I change B.C ???
This is a classic example for a question that will go unanswered:
- it has no relation to the topic of the thread (so the people in the thread will not be interested. And those people interested in twoPhaseEulerFoam will not find it)
- it is very brief and to answer it one must guess what you mean with certain formulations (rule of thumb: don't expect anyone to spend more time on an answer than you spent on formulating the question)

So the only answer I can give to your question ist: "Carefully"

Have a look at https://openfoamwiki.net/index.php/H..._Message_Board and then retry in a proper place
wc34071209 likes this.
__________________
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
boundary condition u, groovybc, openfoam 1.7.1, twophaseeulerfoam


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 do I prescribe Average Velocity /Total Inlet Flow for a simple channel problem? skuznet OpenFOAM Pre-Processing 4 February 16, 2022 09:44
3-D parabolic velocity Inlet - Steady state - UDF Turbulent Flow mohibanwar Fluent UDF and Scheme Programming 10 May 18, 2015 10:34
[swak4Foam] Power law inlet velocity using groovyBC aviator OpenFOAM Community Contributions 3 November 13, 2013 10:50
Velocity inlet BC problem Figd84 FLUENT 5 October 16, 2009 01:46
UDF paraboloid velocity inlet Ronak Shah FLUENT 0 June 4, 2003 09:44


All times are GMT -4. The time now is 00:46.