CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [swak4Foam] Warning running groovyBC: "min ... max ... differ, I will use the average" (https://www.cfd-online.com/Forums/openfoam-community-contributions/159461-warning-running-groovybc-min-max-differ-i-will-use-average.html)

mick223 September 15, 2015 22:39

Warning running groovyBC: "min ... max ... differ, I will use the average"
 
Hi everyone,

I'm running a case where heat loss is calculated through the walls using a groovyBC gradientExpression. The code used for this in 0/T is:

Code:

leftWall
    {
        type            groovyBC;
        refValue        uniform 1680;
        refGradient    uniform 0;
        valueFraction  uniform 1;
        value          uniform 1680;
        valueExpression "0";
        gradientExpression "(Toutlet > 1680) ? ((-(h*A*(Toutlet-T_inf)+esp*A*sig*(pow(Toutlet,4)-pow(T_surr,4))))/kl) : ((-(h*A*(Toutlet-T_inf)+esp*A*sig*(pow(Toutlet,4)-pow(T_surr,4))))/ks) ";
        fractionExpression "0";
        evaluateDuringConstruction 0;
        variables     
9
(
"h=10.0;"
"A=0.00845561879;"
"T_inf=297.0;"
"T_surr=297.0;"
"esp=0.3;"
"sig=5.67e-8;"
"ks=20;"
"kl=60;"
"Toutlet{leftWall}=oldTime(T);"
)
;
        timelines      (
);
        lookuptables    (
);
    }

The case runs and the results are similar to what is expected, however the warning:

Code:

--> FOAM Warning :
    From function ExpressionResult::getUniformInternal(const label size,bool noWarn)
    in file ExpressionResult/ExpressionResultI.H at line 350
    The minimum value 1674.98 and the maximum 1675.21 differ. I will use the average 1675.14
--> FOAM Warning :
    From function ExpressionResult::getUniformInternal(const label size,bool noWarn)
    in file ExpressionResult/ExpressionResultI.H at line 350
    The minimum value 1682.8 and the maximum 1959.02 differ. I will use the average 1838.05
--> FOAM Warning :
    From function ExpressionResult::getUniformInternal(const label size,bool noWarn)
    in file ExpressionResult/ExpressionResultI.H at line 350
    The minimum value 1682.8 and the maximum 1957.31 differ. I will use the average 1838.05

Any advice would be greatly appreciated. I have a feeling that it may be because of how Toutlet{backwall} is specified, it is looking to take data from another patch which would be required to be a uniform field, however I am not sure.

Thanks,

Mick.

mick223 September 21, 2015 10:52

For anyone that comes accross this wanting to know what the warning was for, the use of the {} bracketed terms eg
Code:

Toutlet{leftWall}=oldTime(T)
Indicates to the solver that the boundary condition is being taken from a remote patch, which must have a uniform condition, hence the average temperature is taken. To have it instead calculate the boundary condition on a cell by cell basis, simple remove the {} term (in this case {leftWall} ).

ancolli July 28, 2017 12:21

Quote:

Originally Posted by mick223 (Post 565006)
For anyone that comes accross this wanting to know what the warning was for, the use of the {} bracketed terms eg
Code:

Toutlet{leftWall}=oldTime(T)
Indicates to the solver that the boundary condition is being taken from a remote patch, which must have a uniform condition, hence the average temperature is taken. To have it instead calculate the boundary condition on a cell by cell basis, simple remove the {} term (in this case {leftWall} ).

But, if u remove that term, how u get access to the remote patch?

gschaider July 30, 2017 08:55

Quote:

Originally Posted by ancolli (Post 658759)
But, if u remove that term, how u get access to the remote patch?

General interpolation from one patch to another is tricky and would need additional specifications (especially if the patches are not conformal) so swak4Foam doesn't bother to even try and only accepts uniform patches. If the patches are coupled or mapped the functions neighbourField(T) or mapped(T) give the corresponding values. But oldTime won't work in these cases

Bana February 7, 2023 08:48

Quote:

Originally Posted by gschaider (Post 658887)
General interpolation from one patch to another is tricky and would need additional specifications (especially if the patches are not conformal) so swak4Foam doesn't bother to even try and only accepts uniform patches. If the patches are coupled or mapped the functions neighbourField(T) or mapped(T) give the corresponding values. But oldTime won't work in these cases

Too bad, I have been exactly looking for this application for groovyBC! Value on another patch for the oldTime()...

Seems there is no way other than doing it in C++


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