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] whats wrong with groovyBC for nusselt number? (https://www.cfd-online.com/Forums/openfoam-community-contributions/173711-whats-wrong-groovybc-nusselt-number.html)

ranasa June 25, 2016 16:29

whats wrong with groovyBC for nusselt number?
 
hi everyone,

i intend simulating a routine heat transfer problem; i.e. 2D free convection of a circular cylinder in a closed cavity. cylinder is hot, side walls of constant temp.
AND
ceiling has a Neumann BC (convection), in contact with cavity's surrounding fluid.

i wanna get average Nusselt number over the cylinder surface

i use groovyBC in T file for ceiling

ceiling
{
type groovyBC;
gradientExpression "snGrad(T)";
fractionExpression "1";
variables
"htot=10;T_inf=293; snGrad(T)=htot*(T-T_inf);";
timelines (
);
}

and add libs. to controlDict

libs
(
"libOpenFOAM.so"
"libgroovyBC.so"
"libforces.so"
"libFVFunctionObjects.so"
"libsampling.so"
"libfieldFunctionObjects.so"
);


functions
{


NusseltNumber
{
functionObjectLibs
(
//"libsimpleFunctionObjects.so"
"libsimpleSwakFunctionObjects.so"

);
type patchExpression;
outputControlMode timeStep;
outputInterval 1;
patches
(
cyl
);
verbose true;
variables
(
"T_0=295;"
"D=0.014;"
);
expression "D*snGrad(T)/(T-T_0)";
accumulations
(
average
);
log true;
}

the plotted gnu for Nu looks absurd, goes up and down within a considerable range, say, 10 to 2000 during 1000 iteration! :|

the case is ok when i replace constant temp. for ceiling.

i really have now idea how to get this problem solved.

please give me some help

thanks in advance,
Rana

rapierrz June 27, 2016 02:49

Hi rana,

snGrad(T) is normal gradient of temperature,and you define it again in

variables section!!!

I have a question,What is your boundary condition???

ranasa June 27, 2016 04:06

hi Hesam,

actually a 2D hot cylinder is encompassed in a cavity, in which the side walls are remained at constant temp., bottom face is adiabatic, and, the ceiling transfers convective heat to the ambient; that is, "normal Grad(T)=htot*(T-T_inf)". htot is known from the experiments. T is the temperature of the ceiling that varies during solution.

here is my T file,

dimensions [0 0 0 1 0 0 0];

internalField uniform 295;

boundaryField
{
cyl
{
type fixedValue;
value uniform 300;
}
ceiling
{
type groovyBC;
gradientExpression "snGrad(T)";
fractionExpression "1";
variables
"htot=10;T_inf=293; snGrad(T)=htot*(T-T_inf);";
timelines (
);
}
bottom
{
type zeroGradient;
}

side
{
type fixedValue;
value uniform 295;
}

front-back
{
type empty;
}
}


a point to be said, i'm not sure about the temperature magnitudes given here, just tried to fulfill the required Ra.

i'll be glad to hear from you


regards

rapierrz June 27, 2016 04:11

As you say,if you want gradT=h(T - T_inf),you must define for example:

variables " dummy = h(T - T_inf);";

gradientExpression "dummy";

rapierrz June 27, 2016 04:15

Another thing,

You must put fractionExpression "0" in Neumann boundary condition.

ranasa June 27, 2016 05:32

3 Attachment(s)
thank you Hesam,

it looks better in oscillation now, but i really wonder if i could get such a Nu plot for the case.

first Nu is obtained for constant Ceiling temperature
the second one is for convective BC, applying your suggestion.
and the third one refers to the former convective BC that i wrote it goes up and down!

not sure,
but maybe something else is going wrong?! but actually i copy the folders and just adjust them!

bijan darbari June 27, 2016 06:25

Dear RANASA

I not sure but I think using " externalWallHeatFluxTemperature " BC can solve your problem. Did you try that??

http://foam.sourceforge.net/docs/cpp...3.html#details

ranasa June 27, 2016 07:48

it seems as an alternative for the groovyBC in this case :)

now i have problem defining kappa, i.e. thermal conductivity :confused:

the BC for ceiling is as follows,

ceiling
{
type externalWallHeatFluxTemperature;

kappa fluidThermo;
Ta uniform 293;
h uniform 10;
value uniform 293;
kappaName none;
Qr none;
relaxation 1;
}

openFoam says:

Kappa defined to employ fluidThermo method, but thermo package not available

does any other file expected to put in Constant folder?!

best regards

bijan darbari June 27, 2016 08:06

Use:

kappa lookup ;


All times are GMT -4. The time now is 16:32.