CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   Local values at BC cel-expressions (https://www.cfd-online.com/Forums/cfx/125630-local-values-bc-cel-expressions.html)

Wonderz October 28, 2013 06:13

Local values at BC cel-expressions
 
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:confused:.
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!

singer1812 October 28, 2013 08:43

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.

Wonderz October 28, 2013 14:11

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).

Antanas October 28, 2013 23:18

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 October 29, 2013 10:50

Thank you
 
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?

Antanas October 29, 2013 12:41

Quote:

Originally Posted by Wonderz (Post 459682)
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.

Wonderz October 30, 2013 13:49

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.

Wonderz October 31, 2013 10:50

Solved
 
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.


All times are GMT -4. The time now is 03:58.