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*(TinfT)/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*(TinfT)/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*(TinfT)/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.19999e08 diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 DILUPBiCG: Solving for Ux, Initial residual = 1, Final residual = 4.5435e09, No Iterations 1 DILUPBiCG: Solving for Uy, Initial residual = 1, Final residual = 5.34057e09, No Iterations 1 DILUPBiCG: Solving for Uz, Initial residual = 1, Final residual = 5.63e09, No Iterations 1 Max StCourant Number = 7.86393e07 Igniting cell 43926 state : 1 1 0.135 2.12673e13 Igniting cell 40685 state : 1 1 0.135 1.47286e13 Igniting cell 40686 state : 1 1 0.135 1.65015e13 Igniting cell 40687 state : 1 1 0.135 2.17713e13 Igniting cell 40866 state : 1 1 0.135 1.40006e13 Igniting cell 43925 state : 1 1 0.135 4.56461e13 Igniting cell 43927 state : 1 1 0.135 2.50109e13 Igniting cell 44106 state : 1 1 0.135 1.30268e13 DILUPBiCG: Solving for b, Initial residual = 1, Final residual = 4.10752e10, No Iterations 1 min(b) = 0.999976 DILUPBiCG: Solving for Su, Initial residual = 0.999994, Final residual = 1.49261e08, No Iterations 14 DILUPBiCG: Solving for Xi, Initial residual = 1, Final residual = 2.80249e07, No Iterations 16 max(Xi) = 1 max(XiEq) = 1.001 Combustion progress = 6.3418e08% > 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/OpenFOAM1.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 
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 
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(TinfT)*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 
Hi,
T is deduced from enthalpy not solved by a pdf. The good thing is that the enthalpy eq has builtin BC for wall heat transfer coeff and T_inf. Check the BC e.g. BuoyantFoam tutorials Bjorn 
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 
Thank you very much, Bjorn! :)

Did the proposal work for your case?
Bjorn 
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(TinfT)*htot))"; } Thanks a lot, gk 
All times are GMT 4. The time now is 00:25. 