CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   "field U not existing or of wrong type" groovyBC error. (http://www.cfd-online.com/Forums/openfoam-solving/112752-field-u-not-existing-wrong-type-groovybc-error.html)

immortality February 4, 2013 15:42

"field U not existing or of wrong type" groovyBC error.
 
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.

gschaider February 4, 2013 16:08

Quote:

Originally Posted by immortality (Post 405991)
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


All times are GMT -4. The time now is 19:40.