How can I get the gradient of some transient statistics variable in CFX 11.0?


In a CEL function (user fortran), the gradient of a variable would be obtained by calling USER_GETVAR:

CALL USER_GETVAR(VariableName,
& CRESLT,pGRADPHI,CZ,DZ,IZ,LZ,RZ)

For the transient average velocity this would be

CALL USER_GETVAR('Water.Velocity.Trnavg.Gradient',
& CRESLT,pGRADPHI,CZ,DZ,IZ,LZ,RZ)

But unfortunately, the routine extract_solver_name called within USER_GETVAR does not return the correct solver name for transient statistics data. The sort of user variable names the routine can deal with are of the type:

Material.Variable.Operator or
Phase.Variable.Operator or
Phase.Material.Variable.Operator

In CFX-11, there is a workaround which consists in the following:

1. define the transient statistics for the variable you want, e.g.:

TRANSIENT STATISTICS: Transient Statistics 1
Option = Arithmetic Average
Output Variables List = Water.Velocity
END


2. define a vector Additional Variable (AV) which you assign to the velocity transient average. This is a CCL only feature and won`t work in Pre, since transient statistics data are not available for CEL expressions in Pre.

For this you will need to extract the ccl from the def file and define an AV with something like:

LIBRARY:
ADDITIONAL VARIABLE: VelTrnAvg
Option = Definition
Tensor Type= VECTOR
Units = [m/s ]
Variable Type = Unspecified
END
END

Later assigning VelTrnAvg with the following syntax:

ADDITIONAL VARIABLE: VelTrnAvg
Option = Vector Algebraic Equation
Vector xValue = Velocity u.Trnavg
Vector yValue = Velocity v.Trnavg
Vector zValue = Velocity w.Trnavg

3. In the CEL function (user fortran), you then have to call USER_GETVAR with:

CALL USER_GETVAR('Water.VelTrnAvg.Gradient',
& CRESLT,pGRADPHI,CZ,DZ,IZ,LZ,RZ)


An example ofsuch a set up is attached.





Show Form
No comments yet. Be the first to add a comment!