
[Sponsors] 
April 4, 2010, 01:46 
Mixed BC  heat transfer  laplacianFoam

#1 
Member
Bjorn H. Hjertager
Join Date: Mar 2009
Posts: 72
Rep Power: 16 
I am working with heat transfer in solid material and using laplacianFoam. I have the possibility to impose
1) fixed temperature and 2) fixed temperature gradient (fixed heat flux (dT/dn)_w = q_w/k; q_w is given, k is the conductivity of the solid material) on the walls. Often it is needed to set the heat flux on a boundary given by the heat transfer coefficient (h) and the outside temperature(T_inf) 3) (dT/dn)_w=h/k (T_w T_inf). h and T_inf are given, k is the conductivity of the solid material and T_w is the wall temperature (Varies during the computations and along BC patch). How can I get access to the mixed conditon ( 3) above)? regards Bjorn 

April 11, 2010, 04:40 

#2 
Member
Bjorn H. Hjertager
Join Date: Mar 2009
Posts: 72
Rep Power: 16 
Often it is needed to set the heat flux on a boundary given by the heat transfer coefficient (h) and the outside temperature(T_inf)
3) (dT/dn)_w=h/k (T_w T_inf). h and T_inf are given, k is the conductivity of the solid material and T_w is the wall temperature (Varies during the computations and along BC patch). Can anybody give some hints on how to do this in laplacianFoam? rgds Bjorn 

April 11, 2010, 07:02 

#3 
Member
MSR CHANDRA MURTHY
Join Date: Mar 2009
Posts: 33
Rep Power: 16 
did u try groovyBC ?. http://openfoamwiki.net/index.php/Contrib_groovyBC


July 21, 2010, 04:17 

#4 
Member
Join Date: Nov 2009
Location: Germany
Posts: 96
Rep Power: 15 
Hi Bjorn,
did you succeed implementing your BC in laplacianFoam? Regards, Toni 

July 21, 2010, 04:24 

#5 
Member
Bjorn H. Hjertager
Join Date: Mar 2009
Posts: 72
Rep Power: 16 
Hi Toni,
No, unfortunately I did not manage to find a solution. The use of groovyBC for this problem seems to unclear for my level of understanding. rgds Bjorn 

July 21, 2010, 08:51 

#6 
Member
Join Date: Nov 2009
Location: Germany
Posts: 96
Rep Power: 15 
Hi bhh,
i found these 2 threads: http://www.cfdonline.com/Forums/ope...roperties.html http://www.cfdonline.com/Forums/ope...fficients.html I will try it out and let you know about it. 

July 22, 2010, 03:54 

#7 
Member
Bjorn H. Hjertager
Join Date: Mar 2009
Posts: 72
Rep Power: 16 
Hi,
I finally got around to use groovyBC for my problem. The following seemed to work after installation of the groovyBC ( http://openfoamwiki.net/index.php/Contrib_groovyBC )and using it in laplacianFoam: rightWall { type groovyBC; gradientExpression "gradT"; fractionExpression "0"; variables "htot=100.0;Tinf=20.0;rho=800.0;cp=385.0;gradT=hto t/(DT*rho*cp)*(TinfT);"; timelines ( ); } This seemed to work OK. However, when I raised the heat transfer coefficient, htot, to large values the solution diverged for a steady state heat conduction problem. For large values of htot I should find that the wall temperature should approach Tinf. My guess is that the BC should be handled through a source term addition to the CV close to the boundary to handel large values of htot. Any comments to this? rgds Bjorn 

July 22, 2010, 04:21 

#8 
Senior Member
Stefan Herbert
Join Date: Dec 2009
Location: Darmstadt, Germany
Posts: 129
Rep Power: 16 
Hi Bjorn,
I have had the same problem with diverging results. You can formulate different (and more implicit) to get a stable and faster converging solution. Code:
rightWall { type groovyBC; variables "htot=1000.0;Tinf=20.0;rho=800.0;cp=385.0;k=DT*rho*cp;"; valueExpression "Tinf"; fractionExpression "1.0/(1.0 + k/(mag(delta())*htot))"; } Regards, Stefan Last edited by herbert; July 22, 2010 at 05:27. Reason: Syntax error 

July 22, 2010, 04:53 

#9 
Member
Bjorn H. Hjertager
Join Date: Mar 2009
Posts: 72
Rep Power: 16 
Hi Stefan,
This is probably what is needed. However when I used your expression I got this error: Time = 1 > FOAM FATAL ERROR: Parser Error at "1.33" :"invalid character" "1.0/(1.0 + k/(mag(delta())*htot));" " ^" From function parsingValue in file PatchValueExpressionDriver.C at line 188. FOAM exiting Any idea what went wrong? rgds Bjorn 

July 22, 2010, 04:57 

#10 
Member
Bjorn H. Hjertager
Join Date: Mar 2009
Posts: 72
Rep Power: 16 
Hi Stefan,
It was the ; that should be changed: fractionExpression "1.0/(1.0 + k/(mag(delta())*htot))"; Now it runs! Thank you very much for your help! rgds Bjorn 

July 22, 2010, 05:27 

#11 
Senior Member
Stefan Herbert
Join Date: Dec 2009
Location: Darmstadt, Germany
Posts: 129
Rep Power: 16 
Hi Bjorn,
sorry, such mistakes are my personal special when writing code to posts. I'll edit it. Regards, Stefan 

August 13, 2010, 03:36 

#12 
Member
Join Date: Nov 2009
Location: Germany
Posts: 96
Rep Power: 15 
Hi Bjorn,
i also managed to solve a problem with laplacianFoam and groovyBC. Did you realize you set your Tinf to 253 °C ? Code:
"htot=100.0;Tinf=20.0;rho=800.0;cp=385.0;gradT=hto t/(DT*rho*cp)*(TinfT);"; Code:
type groovyBC; variables "htot=100.0;Tinf=298.15;rho=2700.0;cp=900.0;k=DT*rho*cp;"; valueExpression "Tinf"; fractionExpression "1.0/(1.0 + k/(mag(delta())*htot))"; Regards, Toni 

August 13, 2010, 05:59 

#13 
Member
Bjorn H. Hjertager
Join Date: Mar 2009
Posts: 72
Rep Power: 16 
Hi,
I now only use the proposal from Stefan and abandoned my own proposal. Stefans code is much more stable and can accomodate the Tinf= 252. value rgds Bjorn 

December 6, 2010, 16:00 

#14  
Senior Member
Ben K
Join Date: Feb 2010
Location: Ottawa, Canada
Posts: 140
Rep Power: 18 
Hi, I'm trying to set exactly the same boundary condition: dT/dx = h/k (T_w T_inf)
I've installed groovyBC but when I try the following: Quote:
Quote:
Quote:
Quote:


December 6, 2010, 19:42 

#15 
Senior Member
Ben K
Join Date: Feb 2010
Location: Ottawa, Canada
Posts: 140
Rep Power: 18 
Whoops, I forgot to add libs ( "libgroovyBC.so" ) ; to my system/controlDict file...it seems to be working now.
But...can anybody explain how dT/dx = h/k (T_w T_inf) becomes 1.0/(1.0 + k/(mag(delta())*h))? 

February 3, 2011, 16:34 

#16 
Member
Join Date: Nov 2010
Posts: 54
Rep Power: 14 
Hello,
Can someone reply what does DT refer to in the code above? I got the following error: > FOAM FATAL ERROR: Parser Error at "1.12" :"field DT not existing or of wrong type" "DT*rho*cp" " ^^ " From function parsingValue in file PatchValueExpressionDriver.C at line 192. FOAM aborting (FOAM_ABORT set) Thanks gk 

February 3, 2011, 16:58 

#17 
Senior Member
Ben K
Join Date: Feb 2010
Location: Ottawa, Canada
Posts: 140
Rep Power: 18 
DT is a volumeScalarField in this case. You got an error because in your solver the field DT must not exist. You may not need this field, you just have to make sure that your thermal conductivity (k) is defined properly in your solver.


February 15, 2011, 10:55 
Robin BC, groovyBC, value in the cell center

#18  
New Member
Raimonds Vilums
Join Date: Oct 2010
Posts: 17
Rep Power: 15 
I have two questions which bothers me last few days concerning implementation of Robin boundary conditions by groovyBC:
1) I also cannot fully understand how the equality was obtained which was mentioned before: Quote:
If I linearize the derivative, I could use (T_center  T_face) instead of Tinf 2) Is it possible to get this T_center, i.e., cellcentervalue in groovyBC? I saw "this>patchInternalField()" in the source code of the original mixedFixedValue. Can I access it somehow similar in groovyBC? 

February 17, 2011, 07:18 

#19 
New Member
Raimonds Vilums
Join Date: Oct 2010
Posts: 17
Rep Power: 15 
At last, I've got it. It seems that I am not so stupid as I thought
groovyBC is based on mixed BC. Algorithm in the function "evaluate" of the file mixedFvPatchField.C (src » finiteVolume » fields » fvPatchFields » basic » mixed) states that Tface = f*refValue + (1f)*(Tcenter + refGrad * delta) where f is valueFraction, delta is distance between Tcenter and Tface (OpenFOAM's 1/deltaCoeffs() or groovyBC's mag(delta())). If we take boundary condition k*dT/dn + h*(TfaceTinf) = 0 linearize derivative k*(TfaceTcenter)/delta + h*(TfaceTinf) = 0 divide by h and isolate Tface, we obtain Tface = (1/(1+C))*Tinf + (1  1/(1+C))*Tcenter where C=k/(h*delta). As you can see, comparison of this equation to the first one gives f = 1/(1+C) refValue = Tinf refGrad = 0 Concerning approximation, it is the first order approximation if I understand it correctly. Does anybody knows if there are any 2nd order approximations in OpenFOAM for derivatives on the boundary. I know that it is possible to implement 2nd order approximation, but it would use values from previous timestep. Not sure if this possible with groovyBC, isn't it? 

March 20, 2011, 23:40 
2nd Order?

#20 
New Member
Brent Craven
Join Date: Mar 2009
Location: University Park, PA, USA
Posts: 21
Rep Power: 16 
I agree that this implementation of the mixed BC is first order. Has anyone come up with a way to implement 2nd order?


Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Heat transfer coefficient  what is waht  Stan  FLUENT  28  December 29, 2021 16:29 
Convective / Conductive Heat Transfer in Hypersonic flows  enigma  Main CFD Forum  2  November 1, 2009 22:53 
How can I increase Heat Transfer at Domain Interf?  B.Simon  CFX  3  October 28, 2008 18:53 
CFX Heat Transfer  RJamison  CFX  0  July 24, 2008 12:11 
Convective Heat Transfer  Heat Exchanger  Mark  CFX  6  November 15, 2004 15:55 