Mixed BC  heat transfer  laplacianFoam
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 
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 
did u try groovyBC ?. http://openfoamwiki.net/index.php/Contrib_groovyBC

Hi Bjorn,
did you succeed implementing your BC in laplacianFoam? Regards, Toni 
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 
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. 
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 
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 Regards, Stefan 
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 
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 
Hi Bjorn,
sorry, such mistakes are my personal special when writing code to posts. ;) I'll edit it. Regards, Stefan 
Hi Bjorn,
i also managed to solve a problem with laplacianFoam and groovyBC. Did you realize you set your Tinf to 253 °C ? :D Code:
"htot=100.0;Tinf=20.0;rho=800.0;cp=385.0;gradT=hto t/(DT*rho*cp)*(TinfT);"; Code:
type groovyBC; Regards, Toni 
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 
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:

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))? 
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 
Quote:

Robin BC, groovyBC, value in the cell center
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? 
At last, I've got it. It seems that I am not so stupid as I thought :cool:
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? 
2nd Order?
I agree that this implementation of the mixed BC is first order. Has anyone come up with a way to implement 2nd order?

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