# [swak4Foam] groovyBC problem with radiation boundary

 Register Blogs Members List Search Today's Posts Mark Forums Read

 April 29, 2013, 06:24 groovyBC problem with radiation boundary #1 Senior Member   Mohammad Shakil Ahmmed Join Date: Oct 2012 Location: AUS Posts: 132 Rep Power: 8 Hi, I am trying to use the following boundary condition with groovyBC: k*dT/dn = h*(T-Tinf)+(sigma*emissivity)*(T^4-Tinf^4) where, k= thermal conductivity=5.91 [W/mK] h = heat transfer coefficient =12.4 [W/m2K] Tinf =300K emissivity=0.775 What happens in my case is that the simulation diverges after some time steps. Does anyone implemented this boundary condition in OpenFOAM? or any idea how to solve this problem??? Thanks in advance.

April 29, 2013, 11:18
#2
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,045
Rep Power: 43
Quote:
 Originally Posted by ahmmedshakil Hi, I am trying to use the following boundary condition with groovyBC: k*dT/dn = h*(T-Tinf)+(sigma*emissivity)*(T^4-Tinf^4) where, k= thermal conductivity=5.91 [W/mK] h = heat transfer coefficient =12.4 [W/m2K] Tinf =300K emissivity=0.775 What happens in my case is that the simulation diverges after some time steps. Does anyone implemented this boundary condition in OpenFOAM? or any idea how to solve this problem??? Thanks in advance.
Have you analyzed HOW it diverges? My guess is that it starts oscillating because it over/undershots Tinf. Try smaller timesteps.
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request

Last edited by gschaider; April 29, 2013 at 14:01. Reason: Missing word

 May 3, 2013, 08:59 #3 Senior Member   Mohammad Shakil Ahmmed Join Date: Oct 2012 Location: AUS Posts: 132 Rep Power: 8 Thanks gschaider, yes it's because of time steps. When I minimize the time steps the problem solved

May 4, 2013, 07:12
#4
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,045
Rep Power: 43
Quote:
 Originally Posted by ahmmedshakil Thanks gschaider, yes it's because of time steps. When I minimize the time steps the problem solved
OK. You can stabilize it by implementing a mixed boundary with TInf as the Dirichlet-term (that would avoid overshooting). The fractionExpression is to be calculated according to the heat-flux
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request

August 31, 2013, 07:22
#5
Senior Member

Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Zanjan, Iran
Posts: 291
Rep Power: 9
Quote:
 Originally Posted by gschaider OK. You can stabilize it by implementing a mixed boundary with TInf as the Dirichlet-term (that would avoid overshooting). The fractionExpression is to be calculated according to the heat-flux
Dear Bernhard,
Can you please explain this a little bit more?

How can I avoid overshooting?
What does fractionExpression has to do with this?

Thank you,
Mojtaba
__________________
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"

September 2, 2013, 18:19
#6
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,045
Rep Power: 43
Quote:
 Originally Posted by Mojtaba.a Dear Bernhard, Can you please explain this a little bit more? How can I avoid overshooting? What does fractionExpression has to do with this? Thank you, Mojtaba
fractionExpression (switching between Neuman and Dirichlet is explained on the groovyBC-page)

The thing is that an infinitely fast heat transfer it is basically a Dirichlet condition. For a "very fast" HT it is something in between a Dirichlet and a Neuman. If you implement a pure Neuman you get the overshoots in this case (just sit down with pen an paper, discretize a boundary cell with a big temperatur difference, a big heat transfer coeff and a big timestep and you'll see the overshoot). You can get rid of this by making the timestep very small or by using a mixed conditon
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request

October 13, 2013, 05:44
#7
Senior Member

Alex
Join Date: Oct 2013
Posts: 336
Rep Power: 15
Quote:
 Originally Posted by ahmmedshakil Hi, I am trying to use the following boundary condition with groovyBC: k*dT/dn = h*(T-Tinf)+(sigma*emissivity)*(T^4-Tinf^4) where, k= thermal conductivity=5.91 [W/mK] h = heat transfer coefficient =12.4 [W/m2K] Tinf =300K emissivity=0.775 What happens in my case is that the simulation diverges after some time steps. Does anyone implemented this boundary condition in OpenFOAM? or any idea how to solve this problem??? Thanks in advance.

Could you, please, help me with the implementation of this boundary condition using groovyBC? I'm new in it and some days ago I was trying to solve a problem where I had to use exactly that BC but I didn't know how to do that using groovyBC. I have been reading and looking for more info about the use of groovyBC but I'm stuck with this problem...

__________________
Web site where I present my Master's Thesis: foamingtime.wordpress.com

The case I talk about in this site was solved with chtMultiRegionSimpleFoam solver and involves radiation. Some basic tutorials are also resolved step by step in the web. If you are interested in these matters, you are invited to come in!

 October 13, 2013, 21:08 #8 Senior Member   Mohammad Shakil Ahmmed Join Date: Oct 2012 Location: AUS Posts: 132 Rep Power: 8 Hi sorry for the late response. For implementing this boundary condition you can do as follows: type groovyBC; variables "h=10;k=50;sigma=5.6e-7;E=0.7;Tinf=300;"; gradientExpression "h/k*(T-Tinf)+(sigma/k)*E*(T-Tinf)*(T-Tinf)*(T-Tinf)*(T-Tinf)"; fractionExpression "0"; values are given as dummy. Use your time step smaller. Its works for me. cheers

 October 14, 2013, 08:28 #9 Senior Member   Alex Join Date: Oct 2013 Posts: 336 Rep Power: 15 Thank you Mohammad! Now I realised that maybe this is not exactly what I was looking for because in my case the radiation heat flux is known. Therefore, maybe i shoud make some change to adapt your boundary conditions to my case. Anyway, thank you so much! Your help was very useful to me and it helped me to understand a little how groovyBC works! Although I still need to practise quite a lote to learn the power of groovyBC... Cheers! __________________ Web site where I present my Master's Thesis: foamingtime.wordpress.com The case I talk about in this site was solved with chtMultiRegionSimpleFoam solver and involves radiation. Some basic tutorials are also resolved step by step in the web. If you are interested in these matters, you are invited to come in!

 October 18, 2013, 01:54 #10 Member   Alexander Join Date: Mar 2009 Posts: 49 Rep Power: 10 Apropos, you can solve the nonlinear equation k*dT/dn = h*(T-Tinf)+(sigma*emissivity)*(T^4-Tinf^4) concerning T by Newton method (few iterations are enough). And for better stability use a relaxation: Tnew=alpha*T+(1-alpha)*Told where alpha < 1. But it is necessary to rewrite k*dT/dn as k/delta*(T-Tinner). I do not know how to find Tinner exactly but something like that can be helpful: Tinner = Twall-snGrad(T)*mag(delta()). Mojtaba.a likes this.

June 29, 2015, 12:29
#11
Member

Colli, Alejandro
Join Date: Jan 2014
Posts: 54
Rep Power: 6
Quote:
 Originally Posted by sahas Apropos, you can solve the nonlinear equation k*dT/dn = h*(T-Tinf)+(sigma*emissivity)*(T^4-Tinf^4) concerning T by Newton method (few iterations are enough). And for better stability use a relaxation: Tnew=alpha*T+(1-alpha)*Told where alpha < 1. But it is necessary to rewrite k*dT/dn as k/delta*(T-Tinner). I do not know how to find Tinner exactly but something like that can be helpful: Tinner = Twall-snGrad(T)*mag(delta()).
Could you please explain it in a more detailed form? which function I have to use in Newton method? and how can I calculate the derivative of that function?
Thank you

June 29, 2015, 16:33
#12
Member

Alexander
Join Date: Mar 2009
Posts: 49
Rep Power: 10
Quote:
 Originally Posted by ancolli Could you please explain it in a more detailed form? which function I have to use in Newton method? and how can I calculate the derivative of that function? Thank you
It is simple. The function is:
f(T) = k*dT/dn - h*(T-Tinf)-(sigma*emissivity)*(T^4-Tinf^4)
You should solve the equation:
f(T) = 0.
dT/dn should be rewritten as
k*dT/dn = k/delta*(T-Tinner),
where Tinner = Twall-snGrad(T)*mag(delta()), Twall and snGrad(T) are from previous time step.
You should calculate df/dT:
df/dT = k/delta - h - 4*(sigma*emissivity)*T^3

Please check the signs - I am not sure
Hope this helps you.

June 30, 2015, 11:03
#13
Member

Colli, Alejandro
Join Date: Jan 2014
Posts: 54
Rep Power: 6
Quote:
 Originally Posted by sahas It is simple. The function is: f(T) = k*dT/dn - h*(T-Tinf)-(sigma*emissivity)*(T^4-Tinf^4) You should solve the equation: f(T) = 0. dT/dn should be rewritten as k*dT/dn = k/delta*(T-Tinner), where Tinner = Twall-snGrad(T)*mag(delta()), Twall and snGrad(T) are from previous time step. You should calculate df/dT: df/dT = k/delta - h - 4*(sigma*emissivity)*T^3 Please check the signs - I am not sure Hope this helps you.
Thank you!

Do you know how to control convergence of BC?. My problem has non-linear bc and takes 200 to 4000 (depending of parameters) iterations (when Newton's method is used). But I do not know how to control the convergence of bc, only modifying simple.correctNonOrthogonal() loop in laplacianFoam by trial and error.

June 30, 2015, 15:15
#14
Member

Alexander
Join Date: Mar 2009
Posts: 49
Rep Power: 10
Quote:
 Originally Posted by ancolli Thank you! Do you know how to control convergence of BC?. My problem has non-linear bc and takes 200 to 4000 (depending of parameters) iterations (when Newton's method is used). But I do not know how to control the convergence of bc, only modifying simple.correctNonOrthogonal() loop in laplacianFoam by trial and error.
You can make few iterations inside groovyBC. Unfortunately, groovyBC does not support loops (as I know), so you should expand the loop (copy loop body repeatedly)

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Guille1811 CFX 25 November 12, 2017 18:38 volleyHC CFX 5 April 3, 2016 05:41 Moinul Haque CFX 4 November 25, 2014 18:30 hinca CFX 15 January 26, 2014 18:11 CFD XUE FLUENT 0 July 8, 2010 06:49

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