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

[swak4Foam] "field U not existing or of wrong type" groovyBC error.

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 4, 2013, 15:42
Default "field U not existing or of wrong type" groovyBC error.
  #1
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
hi
my BC on T is as below:
Code:
right
    {
        type            groovyBC;
        refValue        uniform 0;
        refGradient     uniform 0;
        valueFraction   uniform 1;
        value           uniform 973;
        valueExpression "((t1+c2<time()&&time()<t1+c3)||(t2+c2<time()&&time()<t2+c3)||(t3+c2<time()&&time()<t3+c3)||(t4+c2<time()&&time()<t4+c3)||(t5+c2<time()&&time()<t5+c3)||(t6+c2<time()&&time()<t6+c3)||(t7+c2<time()&&time()<t7+c3)||(t8+c2<time()&&time()<t8+c3)||(t9+c2<time()&&time()<t9+c3)||(t10+c2<time()&&time()<t10+c3)||(t11+c2<time()&&time()<t11+c3))? T0_4-(gamma-1)*magSqr(internalField(U))/(2*gamma*R) : T0_2-(gamma-1)*magSqr(internalField(U))/(2*gamma*R)";
        gradientExpression "0";
        fractionExpression "(((t1+c2<time()&&time()<t1+c3)||(t2+c2<time()&&time()<t2+c3)||(t3+c2<time()&&time()<t3+c3)||(t4+c2<time()&&time()<t4+c3)||(t5+c2<time()&&time()<t5+c3)||(t6+c2<time()&&time()<t6+c3)||(t7+c2<time()&&time()<t7+c3)||(t8+c2<time()&&time()<t8+c3)||(t9+c2<time()&&time()<t9+c3)||(t10+c2<time()&&time()<t10+c3)||(t11+c2<time()&&time()<t11+c3))||(t1<time()&&time()<t1+c1)||(t2<time()&&time()<t2+c1)||(t3<time()&&time()<t3+c1)||(t4<time()&&time()<t4+c1)||(t5<time()&&time()<t5+c1)||(t6<time()&&time()<t6+c1)||(t7<time()&&time()<t7+c1)||(t8<time()&&time()<t8+c1)||(t9<time()&&time()<t9+c1)||(t10<time()&&time()<t10+c1)||(t11<time()&&time()<t11+c1))&&(phi<=0)?1:0";
        evaluateDuringConstruction 1;
        variables       
           (

"r=0.02325;"
"rpm=32151;"
"omega=rpm*pi/30;"
"v_r=r*omega;"
"w_cell=.004;"
"n=1;"
"w_w0=n*w_cell;"
"w_w3=(21.6-0)*r*pi/180;"
"w_w4=(83-61.6)*r*pi/180;"
"w_w5=(180-128)*r*pi/180;"
"w_p2=(71.1-21.6)*r*pi/180;"
"w_p4=(129-84)*r*pi/180;"
"c1=w_p2/v_r;"
"c2=(w_p2+w_w4)/v_r;"
"c3=(w_p2+w_w4+w_p4)/v_r;"
"c4=(w_p2+w_w4+w_p4+w_w5+w_w3)/v_r;"
"t1=(w_w0+w_w3-pos().y)/v_r;"
"t2=t1+c4;"
"t3=t1+2*c4;"
"t4=t1+3*c4;"
"t5=t1+4*c4;"
"t6=t1+5*c4;"
"t7=t1+6*c4;"
"t8=t1+7*c4;"
"t9=t1+8*c4;"
"t10=t1+9*c4;"
"t11=t1+10*c4;"

"p0_2=1023382.5;"
"T0_4=973;"
"gamma=1.4;"
"R=287.14;"
)
;
        timelines       (
);
        lookuptables    (
);
    }

and this strange error displayed:
Code:
Create time

Create mesh for time = 0


PIMPLE: max iterations = 3
field "(U|k|omega)"	: relTol 0, tolerance 1e-10

Reading thermophysical properties

Selecting thermodynamics package hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>
swak4Foam: Allocating new repository for sampledGlobalVariables


--> FOAM FATAL ERROR:
Parser Error at "1.373" :"field U not existing or of wrong type"
"((t1+c2<time()&&time()<t1+c3)||(t2+c2<time()&&time()<t2+c3)||(t3+c2<time()&&time()<t3+c3)||(t4+c2<time()&&time()<t4+c3)||(t5+c2<time()&&time()<t5+c3)||(t6+c2<time()&&time()<t6+c3)||(t7+c2<time()&&time()<t7+c3)||(t8+c2<time()&&time()<t8+c3)||(t9+c2<time()&&time()<t9+c3)||(t10+c2<time()&&time()<t10+c3)||(t11+c2<time()&&time()<t11+c3))? T0_4-(gamma-1)*magSqr(internalField(U))/(2*gamma*R) : T0_2-(gamma-1)*magSqr(internalField(U))/(2*gamma*R)"
"                                                                                                                                                                                                                                                                                                                                                                                     ^                                                                   "

From function parsingValue
in file lnInclude/CommonValueExpressionDriverI.H at line 802.

FOAM exiting
what may be the cause of it?
thanks for consideration.
immortality is offline   Reply With Quote

Old   February 4, 2013, 16: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 immortality View Post
hi
my BC on T is as below:
Code:
right
    {
        type            groovyBC;
        refValue        uniform 0;
        refGradient     uniform 0;
        valueFraction   uniform 1;
        value           uniform 973;
        valueExpression "((t1+c2<time()&&time()<t1+c3)||(t2+c2<time()&&time()<t2+c3)||(t3+c2<time()&&time()<t3+c3)||(t4+c2<time()&&time()<t4+c3)||(t5+c2<time()&&time()<t5+c3)||(t6+c2<time()&&time()<t6+c3)||(t7+c2<time()&&time()<t7+c3)||(t8+c2<time()&&time()<t8+c3)||(t9+c2<time()&&time()<t9+c3)||(t10+c2<time()&&time()<t10+c3)||(t11+c2<time()&&time()<t11+c3))? T0_4-(gamma-1)*magSqr(internalField(U))/(2*gamma*R) : T0_2-(gamma-1)*magSqr(internalField(U))/(2*gamma*R)";
        gradientExpression "0";
        fractionExpression "(((t1+c2<time()&&time()<t1+c3)||(t2+c2<time()&&time()<t2+c3)||(t3+c2<time()&&time()<t3+c3)||(t4+c2<time()&&time()<t4+c3)||(t5+c2<time()&&time()<t5+c3)||(t6+c2<time()&&time()<t6+c3)||(t7+c2<time()&&time()<t7+c3)||(t8+c2<time()&&time()<t8+c3)||(t9+c2<time()&&time()<t9+c3)||(t10+c2<time()&&time()<t10+c3)||(t11+c2<time()&&time()<t11+c3))||(t1<time()&&time()<t1+c1)||(t2<time()&&time()<t2+c1)||(t3<time()&&time()<t3+c1)||(t4<time()&&time()<t4+c1)||(t5<time()&&time()<t5+c1)||(t6<time()&&time()<t6+c1)||(t7<time()&&time()<t7+c1)||(t8<time()&&time()<t8+c1)||(t9<time()&&time()<t9+c1)||(t10<time()&&time()<t10+c1)||(t11<time()&&time()<t11+c1))&&(phi<=0)?1:0";
        evaluateDuringConstruction 1;
        variables       
           (

"r=0.02325;"
"rpm=32151;"
"omega=rpm*pi/30;"
"v_r=r*omega;"
"w_cell=.004;"
"n=1;"
"w_w0=n*w_cell;"
"w_w3=(21.6-0)*r*pi/180;"
"w_w4=(83-61.6)*r*pi/180;"
"w_w5=(180-128)*r*pi/180;"
"w_p2=(71.1-21.6)*r*pi/180;"
"w_p4=(129-84)*r*pi/180;"
"c1=w_p2/v_r;"
"c2=(w_p2+w_w4)/v_r;"
"c3=(w_p2+w_w4+w_p4)/v_r;"
"c4=(w_p2+w_w4+w_p4+w_w5+w_w3)/v_r;"
"t1=(w_w0+w_w3-pos().y)/v_r;"
"t2=t1+c4;"
"t3=t1+2*c4;"
"t4=t1+3*c4;"
"t5=t1+4*c4;"
"t6=t1+5*c4;"
"t7=t1+6*c4;"
"t8=t1+7*c4;"
"t9=t1+8*c4;"
"t10=t1+9*c4;"
"t11=t1+10*c4;"

"p0_2=1023382.5;"
"T0_4=973;"
"gamma=1.4;"
"R=287.14;"
)
;
        timelines       (
);
        lookuptables    (
);
    }

and this strange error displayed:
Code:
Create time

Create mesh for time = 0


PIMPLE: max iterations = 3
field "(U|k|omega)"	: relTol 0, tolerance 1e-10

Reading thermophysical properties

Selecting thermodynamics package hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>
swak4Foam: Allocating new repository for sampledGlobalVariables


--> FOAM FATAL ERROR:
Parser Error at "1.373" :"field U not existing or of wrong type"
"((t1+c2<time()&&time()<t1+c3)||(t2+c2<time()&&time()<t2+c3)||(t3+c2<time()&&time()<t3+c3)||(t4+c2<time()&&time()<t4+c3)||(t5+c2<time()&&time()<t5+c3)||(t6+c2<time()&&time()<t6+c3)||(t7+c2<time()&&time()<t7+c3)||(t8+c2<time()&&time()<t8+c3)||(t9+c2<time()&&time()<t9+c3)||(t10+c2<time()&&time()<t10+c3)||(t11+c2<time()&&time()<t11+c3))? T0_4-(gamma-1)*magSqr(internalField(U))/(2*gamma*R) : T0_2-(gamma-1)*magSqr(internalField(U))/(2*gamma*R)"
"                                                                                                                                                                                                                                                                                                                                                                                     ^                                                                   "

From function parsingValue
in file lnInclude/CommonValueExpressionDriverI.H at line 802.

FOAM exiting
what may be the cause of it?
thanks for consideration.
You're using "evaluateDuringConstruction". At the time when this field is created U has not been created and will therefor not be found.

Exactly because of this type of dependency evaluateDuringConstruction is NOT set by default. Switch it off
__________________
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
Compile calcMassFlowC aurore OpenFOAM Programming & Development 13 March 23, 2018 08:43
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
OpenFOAM without MPI kokizzu OpenFOAM Installation 4 May 26, 2014 10:17
Compiling dynamicTopoFvMesh for OpenFOAM 2.1.x Saxwax OpenFOAM Installation 25 November 29, 2013 06:34
Pressure instability with rhoSimpleFoam daniel_mills OpenFOAM Running, Solving & CFD 44 February 17, 2011 18:08


All times are GMT -4. The time now is 07:28.