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] Wall heat transfer using groovyBC (XiFoam solver) (https://www.cfd-online.com/Forums/openfoam-community-contributions/84647-wall-heat-transfer-using-groovybc-xifoam-solver.html)

usergk February 4, 2011 10:03

Wall heat transfer using groovyBC (XiFoam solver)
 
Hello,

I am trying to implement wall heat transfer boundary condition in XiFoam solver using groovyBC.

I implemented the following in the 0/T file. The boundary field is also defined below.

************************************************** **

dimensions [ 0 0 0 1 0 0 0 ];

internalField uniform 293;

boundaryField
{
inlet
{
type fixedValue;
value uniform 293;
}
outlet
{
type inletOutlet;
inletValue uniform 293;
value uniform 293;
}
upperWall
{
type groovyBC;
value uniform 293;
gradientExpression "gradT";
fractionExpression "0";
variables "htot=100.0;Tinf=298.15;Cp=1000;k=alphaEff*rho*Cp; gradT=htot*(Tinf-T)/k;";
}
lowerWall
{
type groovyBC;
value uniform 293;
gradientExpression "gradT";
fractionExpression "0";
variables "htot=100.0;Tinf=298.15;Cp=1000;k=alphaEff*rho*Cp; gradT=htot*(Tinf-T)/k;";
}
frontAndBack
{
type groovyBC;
value uniform 293;
gradientExpression "gradT";
fractionExpression "0";
variables "htot=100.0;Tinf=298.15;Cp=1000;k=alphaEff*rho*Cp; gradT=htot*(Tinf-T)/k;";
}

}

************************************************** **

(
inlet
{
type patch;
nFaces 600;
startFace 715675;
}
outlet
{
type patch;
nFaces 1140;
startFace 716275;
}
upperWall
{
type wall;
nFaces 4460;
startFace 717415;
}
lowerWall
{
type wall;
nFaces 5000;
startFace 721875;
}
frontAndBack
{
type wall; //cyclic;
nFaces 24450;
startFace 726875;
}
)

************************************************** **

However, I get the following error on running the case, after the first time step:

Time = 1.19999e-08

diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
DILUPBiCG: Solving for Ux, Initial residual = 1, Final residual = 4.5435e-09, No Iterations 1
DILUPBiCG: Solving for Uy, Initial residual = 1, Final residual = 5.34057e-09, No Iterations 1
DILUPBiCG: Solving for Uz, Initial residual = 1, Final residual = 5.63e-09, No Iterations 1
Max St-Courant Number = 7.86393e-07
Igniting cell 43926 state : 1 1 0.135 2.12673e-13
Igniting cell 40685 state : 1 1 0.135 1.47286e-13
Igniting cell 40686 state : 1 1 0.135 1.65015e-13
Igniting cell 40687 state : 1 1 0.135 2.17713e-13
Igniting cell 40866 state : 1 1 0.135 1.40006e-13
Igniting cell 43925 state : 1 1 0.135 4.56461e-13
Igniting cell 43927 state : 1 1 0.135 2.50109e-13
Igniting cell 44106 state : 1 1 0.135 1.30268e-13
DILUPBiCG: Solving for b, Initial residual = 1, Final residual = 4.10752e-10, No Iterations 1
min(b) = 0.999976
DILUPBiCG: Solving for Su, Initial residual = 0.999994, Final residual = 1.49261e-08, No Iterations 14
DILUPBiCG: Solving for Xi, Initial residual = 1, Final residual = 2.80249e-07, No Iterations 16
max(Xi) = 1
max(XiEq) = 1.001
Combustion progress = 6.3418e-08%


--> FOAM FATAL ERROR:
attempt to use janafThermo<equationOfState> out of temperature range 100 -> 5000; T = 0

From function janafThermo<equationOfState>::checkT(const scalar T) const
in file /home/gk/OpenFOAM/OpenFOAM-1.7.1/src/thermophysicalModels/specie/lnInclude/janafThermoI.H at line 63.

FOAM aborting (FOAM_ABORT set)

---------------------------------------------------

Could someone share where I may be going wrong? I'd appreciate it very much.

Another question I had is how can I access values used inside a solver (eg Cp) within the BC definition?

Thanks,
gk

bhh February 4, 2011 12:13

Hi,

Please note that Temperture T is not solved for - it is the energy eguation that is solved. I.e. the BC needs to be imposed on the enthalpy eq.

rgds
Bjorn

usergk February 4, 2011 12:21

Hello Bjorn

Thanks for your reply.

I tried to implement it this way:

{
type groovyBC;
value uniform 293;
variables "htot=100.0;Tinf=298.15;cp=1000;ktot=alphaEff*rho* cp;";
valueExpression "Tinf";
fractionExpression "1.0/(1.0 + ktot/(mag(Tinf-T)*htot))";
}

and it seemed to avoid the janafThermo error.

However, I am new to using this software, and don't quite understand what you mean by "BC needs to be imposed on the enthalpy eq".

Could you please provide some directions?

Also, how can I access the T and cp values in the BC from within the solver code?

Thanks a lot,
gk

bhh February 4, 2011 12:29

Hi,

T is deduced from enthalpy not solved by a pdf. The good thing is that the enthalpy eq has built-in BC for wall heat transfer coeff and T_inf. Check the BC e.g. BuoyantFoam tutorials

Bjorn

bhh February 4, 2011 13:10

Hi again;

Here is an example on how to set BC in 0/T:

sideWall
{
type wallHeatTransfer;
alphaWall 20;
Tinf 280.;
value 300.;
}
rgds
Bjorn

usergk February 4, 2011 13:21

Thank you very much, Bjorn! :)

bhh February 4, 2011 13:23

Did the proposal work for your case?
Bjorn

usergk February 4, 2011 13:36

Hi Bjorn,

Yes, the simulations ran properly using:

{
type wallHeatTransfer;
alphaWall uniform 20;
Tinf uniform 298;
value uniform 293;
}


The reason I had chosen groovyBc was because I wanted to implement:
q = - k_f * d(T)/dn = h_ext * (T_ext - T_w)

I'll run the case with the BC you mentioned and try to validate the results.

I am still not sure how to implement the groovyBC though. The simulations do run with the groovyBC I specified, but as you mentioned, the T specified is not being solved for (?), so I am not sure the results will be accurate.

{
type groovyBC;
value uniform 293;
variables "htot=100.0;Tinf=298.15;cp=1000;ktot=alphaEff* rho* cp;";
valueExpression "Tinf";
fractionExpression "1.0/(1.0 + ktot/(mag(Tinf-T)*htot))";
}


Thanks a lot,
gk


All times are GMT -4. The time now is 08:43.