CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   CFX (http://www.cfd-online.com/Forums/cfx/)
-   -   CEL and Variables (http://www.cfd-online.com/Forums/cfx/21360-cel-variables.html)

stex June 21, 2005 10:48

CEL and Variables
 
I'm working with CEL in Pre.

Usually you need to evaluate areaAve(<variable>)@Plane and it works.

I tried areaAve(<variable1> * <variable2>)@Plane and it doesn't work......anyone knows why?!?!

e.g.

areaAve(p)@inlet ----> OK

areaAve(p*T)@inlet ----> PROBLEMS!!!!

Rui June 21, 2005 11:50

Re: CEL and Variables
 
Hi,

Are you using CFX-5.7?In Post, <font color="blue">function(variable1*variable2)@locator </font> doesn't work in version 5.7, but it works in versions 5.6 and 5.7.1.So, the same may happen in Pre.

Regards,

Rui

JP June 21, 2005 11:51

Re: CEL and Variables
 
try this: PT=p*T areaAve(PT)@inlet

Juan Carlos June 21, 2005 15:28

Re: CEL and Variables
 
Unfortunately, the expressions within callbacks is not supported within CFX-Pre and CFX-Solver.

However, there is a workaround. Create an Algebraic Equation Additional Variable equal to your expression, and apply the callback function on this new variable.

Good luck, Juan Carlos


stex June 22, 2005 04:52

Re: CEL and Variables
 
I use 5.6 version!

stex June 22, 2005 04:52

Re: CEL and Variables
 
Already done. It doesn't work :(

stex June 22, 2005 05:33

Re: CEL and Variables
 
Thanks for the good idea. I tried:

LIBRARY: ADDITIONAL VARIABLE: dummy

Option = Algebraic Equation

Additional Variable Value = 2 * T

Units = [ K ]

Variable Type = Unspecified END # ADDITIONAL VARIABLE:dummy END # LIBRARY:

just to try a dummy variable ( 2 * temperature) , but when I call the variable in the expression editor (e.g.: dummyAVE = areaAve(dummy)@Plane1) I've no problems. The problem is in the SOLVER, because it writes:

"Error in setting: "dummyAVE" via the expression: areaAve(dummy)@Plane1 areaAve( : read successfully, and then error found at item: dummy unrecognised name

Error processing expression: Expression Value = dummyAVE"

Moreover in PRE, right-clicking in the expression editor I cannot find "dummy" in the variable list after I've created....how it is possible Juan?

many thanks.

stex June 22, 2005 05:43

Re: CEL and Variables
 
errata corrige: Now I find the additional variable "dummy" right-clicking in the expression editor.......but the solver don't want to recognize it....

Rui June 22, 2005 10:15

Re: CEL and Variables
 
Hi,

Usually I create additional variables.For example, in CFX-Pre I create a new variable Source heat set the type to Unspecified and the units to [J m^-3 s^-1], I create an expression Sq, and when I define the Domain, in the Fluid Models tab I select the variable Source heat chose the option Algebaric Equation and set it to expression Sq. And in CFX-5.6 the .ccl and the .out files are like this (which looks a little bit different from what you posted):
LIBRARY :
ADDITIONAL VARIABLE : Source heat
Option = Definition
Units = [ J m^-3 s^-1 ]
Variable Type = Unspecified
END
.....
.....
CEL :
EXPRESSIONS :
.....
.....
Sq = Hr*Km*(Co^2)*(1-alfa)^2
.....
.....
END
END
END
FLOW :
.....
.....
DOMAIN : Domain 1
.....
.....
FLUID MODELS :
.....
.....
ADDITIONAL VARIABLE : Source heat
Additional Variable Value = Sq
Option = Algebraic Equation
END
END
END
.....
.....
ENDRegards,

Rui

stex June 22, 2005 10:45

Re: CEL and Variables
 
Many thanks Rui, but it seems that in CFX-Pre is impossible to evaluate a areaAve (or areaInt) of a composite variable...I will try...

Juan Carlos June 22, 2005 10:58

Re: CEL and Variables
 
Hi,

I just repeated your example above, and it works for me.. Are you sure there isn't a typo that we cannot see because of the html?

Is Plane 1 a boundary condition location? The CFX solver only supports callback on location that are either boundaries, subdomain, domain, monitor points or source points. Plane 1 sounds like a user defined location in the middle of a domain.

Good luck, Juan Carlos

stex June 22, 2005 11:27

Re: CEL and Variables
 
no, plane1 is a periodic boundary.

The methodology you suggest works for entities like density, temperature, but I tried with velocity and in that case the solver write "Details of error:-

----------------

Error detected by routine PEEKCA

CDANAM = /FLOW/GETVAR/MESH_DIR/CZIF

CRESLT = NONE

+--------------------------------------------------------------------+

| Writing crash recovery file |

+--------------------------------------------------------------------+

+--------------------------------------------------------------------+

| ERROR #001100279 has occurred in subroutine ErrAction. |

| Message: |

| Stopped in routine MEMERR |

| |

| |

| |

| |

| |

+--------------------------------------------------------------------+

My problem is that I would like to write an expression of the moment source in function of the areaAve(density* vel)


Juan Carlos June 22, 2005 12:50

Re: CEL and Variables
 
Stex,

density * vel is a vector and you are using a Algebraic scalar equation. It is not what you want, I believe.

Have you tried using the velocity components as

- Av expression 1= density*u

- Av expression 2= density*v

- ...

and use them individually in the momemtum source..

I am guessing here since I do not know what you are trying to do..

Perhaps the callback function are not fully supported on periodic domain interfaces..Have you tried using on WALL or INLET, just to verify your syntax is correct.

Are you using 5.7.1 or 5.6? I would not continue unless you check with support and they confirm it should work on either of them.

Regards, Juan Carlos

stex June 23, 2005 06:24

Re: CEL and Variables
 
Dear Juan, now I can explain.......I did many tests. So,let's try a simple case, you can try by yourself if you don't believe me.

if you define in Pre an expression as areaAve(u)@Periodic_boundary ....it works.

if you define a additional variable u_new with an algebraic equation u_new = u and then you change the expression like this... areaAve(u_new)@Periodic_boundary ....it doesn't works.

Why is not possible??

Rui June 23, 2005 08:32

Re: CEL and Variables
 
Hi Stex,

I have tried in CFX-5.6:

areaAve(T)@boundary and areaAve(u)@boundary work for all type of boundaries

Variable T_new = T, areaAve(T_new) works for all type of boundaries

Variable u_new = u, areaAve(u_new) works for all type of boundaries <u>except periodic boundaries</u>. I got the same error as you: Error detected by routine PEEKCA
CDANAM = /FLOW/GETVAR/MESH_DIR/CZIF
CRESLT = NONE
I tried in CFX-5.7.1 (with SP1):

Variable u_new = u, areaAve(u_new) works for <u>all type of boundaries</u>.

So it seems it was some problem that has been fixed in CFX-5.7.

Regards,

Rui

stex June 23, 2005 09:25

Re: CEL and Variables
 
In fact I use 5.6, and I just finish to try all the variables and boundary as you did. Thanks for all your kindness. I hope we will keep in contact.

stpieri@units.it

Regards

stex June 23, 2005 09:37

Re: CEL and Variables
 
PS: Rui, have you ever find a way to calculate massFLOW in a periodic boundary???

Thanks

Rui June 23, 2005 11:41

Re: CEL and Variables
 
Ciau Stex,

In both CFX-5.6 and 5.7.1, when calculating massFlow()@inter Side1 Boundary1 (inter was defined as a Periodic Domain Interface), I got this error message:ERROR #001100279 has occurred in subroutine ErrAction.
Message:
An invalid request to calculate IP mass flows was found for the s-
ymmetry or periodic boundary named: inter Side1 Boundary1However, in CFX-5.7.1 it's possible to calculate massFlowInt(var)@inter Side1 Boundary1 and massFlowAve(var)@inter Side1 Boundary1, while in CFX-5.6 it isn't.

To calculate the mass flow a this boundary, in CFX-5.7 you can do something like areaInt(Density * Velocity dot n)@Periodic_boundary, where n is the outward normal vector. If the boundary is perpendicular to the x-axis, the mass flow would be areaInt(Density * u)@Periodic_boundary.If your fluid density is constant, in CFX-5.6 you can create an expression to calculate the volume flow as Vflow = areaInt(u)@Periodic_boundary, and create another expression to calculate the mass flow as Mflow = Vflow * Density. But if the fluid density isn't constant, it seems there is no way to calculate the mass flow at a periodic boundary.

But I think you should contact the CFX support and ask them how to have the mass flow through a periodic boundary available at the Solver.

Regards,

Rui

stex June 27, 2005 05:50

Re: CEL and Variables
 
"ERROR #001100279 has occurred in subroutine ErrAction."

Yes, I know this ERROR...

Now I've just installed 5.7 ....so right now I can calculate the massFlowAve(Temperature)@Periodic_boundary and I'm really happy about it.......

I've got the last problem with the mass flow....infact I defined a Den_U=density*u variable, but I' ve the same error when I evaluate the areaInt(Den_U)@Periodic_boundary so (as you suggested) the solution is to setup a constant density and calculate the areaInt(u)@Periodic_boundary. This solution works, but is not really what I want...so I will contact CFX support.

Thanks.


All times are GMT -4. The time now is 06:47.