# Local values at BC cel-expressions

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

 October 28, 2013, 07:13 Local values at BC cel-expressions #1 New Member   Join Date: Oct 2013 Posts: 5 Rep Power: 4 Hello, I got a problem in CFX concerning the use of local values of variables in CEL-expressions implemented for boundary conditions. Here are the expressions (local values are red): 1) qRadPt = -EmPotat *EmWall *stefan *(Tpotat^4 -TavWlRf ^4)*1 2) qRadWlRf = EmPotat *EmWall *stefan *(TavPt^4 -T^4)*1 These expressions introduce a crude model of radiative heat transfer between surface of porous domain (T of solid porous body is represented with additional variable Tpotat, average value: areaAve(Tpotat)@IA_Pt Side 2) and wall/roof surface (T average value=TavWlRf). I set these expressions as boundary fluxes: 1) for additional variable Tpotat; 2) for energy Eqn on wall/roof surface. Initial conditions were set with res-file containing physically reliable solution of natural convection and conduction. During solver run overflow happened (in ~20 iterations). My investigation revealed that both surfaces undergo abnormal radiation heating from the very start of run. So, both Tpotat and T went to plus infinity. Then I checked all expressions several times and found no mistakes. I made modification of the expressions in the way that both radiative fluxes were calculated on the basis of only average values. The result is normal (eqns are OK!), but the surface distribution of Tpotat is not uniform and I still need to take into consideration its local values. Several days later idea came to me: In both expressions solver used zero K instead of real local temperature (Tpotat and T respectively)! I found no related info in CFX help and at web too. My question is how to construct expression or what option to check in order to make CFX-solver properly evaluate expressions with local values of variables. Thanks in advance for reply!

 October 28, 2013, 09:43 #2 Senior Member   Edmund Singer P.E. Join Date: Aug 2010 Location: Minneapolis, MN Posts: 512 Rep Power: 12 Not sure i understand. Did you redefine T? That is a inherent variable. Why do you need to use Tpotat if you just want the local T? Cant you just use T? Also these numbers will be a function of each other, and perhaps CFX isnt able to dampen the solution out on the walls until it becomes steady. Perhaps you can add a min,max on the outside to cap the q that will be transfered so that a steady solution could be more easily reached.

October 28, 2013, 15:11
#3
New Member

Join Date: Oct 2013
Posts: 5
Rep Power: 4
Quote:
 Why do you need to use Tpotat if you just want the local T? Cant you just use T
About the developed model. There is a kind of a room bounded with walls, roof, etc. Inside the room there is a porous domain. Solid part of the porous domain represents pieces of agricultural product. Fluid part - air flowing through pieces of product. I need to take into account both temperature fields in porous domain in order to model heat and mass transfer between solid and fluid parts (1. Tpotat – for product, implemented as additional variable; 2. T – for air in porous domain and for all other domains).
Radiation models in CFX (DTM etc) can calculate radiative fluxes only on the basis of inherent variable T for temperature. For my case it means taking into account temperature of air passing through pieces of product (T) instead of temperature of product (Tpotat). That is why I have to use CEL-expressions to model radiation HT.

Quote:
 ...perhaps CFX isnt able to dampen the solution out on the walls until it becomes steady. Perhaps you can add a min,max on the outside to cap the q that will be transfered so that a steady solution could be more easily reached.
Edmund, dampening is usefull when the reason is in numerical instability. Here the issue is of another kind. I already tried to set source coefficient. The result is getting some more iterations before overflow. Bounding upper level of T and Tpotat, may be, will help avoiding overflow, but will not help get adequate result.
The reason of rising both T and Tpotat to plus infinity on surfaces under radiation HT is in improper evaluation of CEL-expressions during solver run. As I mentioned above, replacing of local values (red coloured in first post) with area-averaged values helped to get solution. But since the temperature distribution both on product surface and wall/roof surface is not reasonably uniform, I still need to find a way to use CEL-expressions with local values. I mean, expression for product surface should contain local value of Tpotat (expression for wall/roof surface - local value of its T).

 October 29, 2013, 00:18 #4 Senior Member   Join Date: Feb 2011 Posts: 288 Rep Power: 9 The problem may be with 4 power of Temperature and BC dependent on solution. I had the same problem when tried to model radiative HF from nozzle wall. Initialy I used Heat Flux option for BC with Heat Flux in = -eps*stefan*T^4 and there was error. So I switched to Heat Transfer Coef option with Coef = -eps*stefan*T^3. Although in my case external temperature is zero, I think you may try to utilize such approach, but maybe with help of User Fortran. At the moment I solve problem where boundary flux depends exponentially on solution. Setting it through Flux In option (even using User Fortran) leading to overflow issue. So I had to switch to Transfer Coef option and calculate Coef and external value in my fortran routine to overcome it. In your case I think for qRadPt you'll get: Coef = -EmPotat *EmWall *stefan * 4 * Tpotat^3, Ext value = Tpotat + EmPotat *EmWall *stefan *(Tpotat^4 -TavWlRf ^4)*1 / Coef. At least for my current problem such approach works. Wonderz likes this.

October 29, 2013, 11:50
Thank you
#5
New Member

Join Date: Oct 2013
Posts: 5
Rep Power: 4
Thanks a lot, Antanas!
In a few days I will be able to test your idea in CFX.
Quote:
 In your case I think for qRadPt you'll get: Coef = -EmPotat *EmWall *stefan * 4 * Tpotat^3, Ext value = Tpotat + EmPotat *EmWall *stefan *(Tpotat^4 -TavWlRf ^4)*1 / Coef Coef = -EmPotat *EmWall *stefan * 4 * Tpotat^3
I made some mathematical transformations to check the idea and found that Coef have no influence on final result (I mean I get q = qRadPt, so your idea is right). But I wonder what does constant value of 4 in Coef mean? Is it a misprint or another coefficient used for numerical stabilization or whatever other purpose?

October 29, 2013, 13:41
#6
Senior Member

Join Date: Feb 2011
Posts: 288
Rep Power: 9
Quote:
 Originally Posted by Wonderz Thanks a lot, Antanas! In a few days I will be able to test your idea in CFX. I made some mathematical transformations to check the idea and found that Coef have no influence on final result (I mean I get q = qRadPt, so your idea is right). But I wonder what does constant value of 4 in Coef mean? Is it a misprint or another coefficient used for numerical stabilization or whatever other purpose?
The idea is to express your flux in form qRadPt = Coef * (Tpotat - Text) to be able to use Transfer Coef BC option, because it's better for solver (at least when flux depends on solution).

So we have -EmPotat *EmWall *stefan *(Tpotat^4 -TavWlRf ^4)*1 = Coef * (Tpotat - Text), and if we differentiate left and right by Tpotat, we get: -EmPotat *EmWall *stefan * 4 * Tpotat^3 = Coef. Next for external temperature we have Text = Tpotat - qRadPt / Coef.

You can make sure that these Coef and Text will give you the same flux.

I'm not sure that you'll be able to realize this through CEL, but with User Fortran I had no problem.

Last edited by Antanas; October 29, 2013 at 23:20.

October 30, 2013, 14:49
#7
New Member

Join Date: Oct 2013
Posts: 5
Rep Power: 4
Quote:
 So we have -EmPotat *EmWall *stefan *(Tpotat^4 -TavWlRf ^4)*1 = Coef * (Tpotat - Text), and if we differentiate left and right by Tpotat, we get: -EmPotat *EmWall *stefan * 4 * Tpotat^3 = Coef.
Thank you, Antanas! Now I see were this 4 comes from.

Quote:
 I'm not sure that you'll be able to realize this through CEL, but with User Fortran I had no problem.
Unfortunately I have no availability to apply User Fortran. The only way for me is using CEL.

I think that expression for Coef affects only numerical stability. And we can utilize any expression. It becomes obvious when we put Text = Tpotat - qRadPt / Coef
to qRadPt = Coef * (Tpotat - Text).
The only requirement is to avoid division by Coef = 0.

So my plan is to try expressions for Coef with a power of Tpotat from 3 to 1 until I get proper result.

 October 31, 2013, 11:50 Solved #8 New Member   Join Date: Oct 2013 Posts: 5 Rep Power: 4 I followed Antanas' recommendation and got proper result. But I tried my own variant of Coef. I thought the best is to take Tpotat in the power of 0. So I used Coef = 1 and succeeded. Also I found there is no possibility to implement such BC on interfaces of wall and roof. Only Flux and Total Source could be chosen for Energy equation. May be it is possible to use Coef and Text via User Fortran. But I analyzed my problem and understood that there is no need to utilize such approach for wall/roof surfaces.

 Tags cel expression, local value

 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 Heroic OpenFOAM Running, Solving & CFD 26 December 17, 2012 04:34 bookie56 OpenFOAM Installation 8 August 13, 2011 04:03 rbarrett CFX 3 July 6, 2011 10:13 Joseph CFX 14 April 20, 2010 15:45 Rob CFX 3 January 19, 2007 10:38

All times are GMT -4. The time now is 11:41.