CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   Average value of expression in transient flow analysis (https://www.cfd-online.com/Forums/cfx/118181-average-value-expression-transient-flow-analysis.html)

JFK May 22, 2013 08:02

Average value of expression in transient flow analysis
 
Hi,

I am currently trying to set up a transient flow analysis of an aerofoil. I want to extract the average drag coefficient as a parameter for a study, but have run into some problems.

Currently i am so far:
  1. I have set up the basic model and it runs.
  2. Created an expression for the drag coefficient: 2*force_x()@AntennaSurface/(areaAve(Density)@Inlet*(areaAve(Velocity u)@Inlet)^2*FrontalArea).
  3. Created an additional variable with: Type: Unspecified, Unit: [ ], Tensor Type: Scalar.
  4. Included the additional variable in my domain and set its value to the expression for the drag coefficient.
  5. In the "Trn Stats" tab under "Output control" I have created a Transient Statistics Object and added the additional value and set the "Option" to "Arithmetic Average".

When I run the model I get an instant error saying:

| PROBLEM ENCOUNTERED WHEN EXECUTING CFX EXPRESSION LANGUAGE |
| |
| The CFX expression language was evaluating: |
| Additional Variable Value |
| |
| The problem was: |
| DIVIDE-BY-ZERO |


Have I missed some small detail or am I doing it completely wrong?

Please help. Thanks!

Lance May 22, 2013 08:52

I've done almost the same thing as you, but used two AVs and the .Trnavg operator instead. It worked for me.
edit: what was the initial condition for your AV? If it was set to zero it could explain your error.

Code:

LIBRARY:
  ADDITIONAL VARIABLE: Additional Variable 1
    Boundary Only Field = On
    Option = Definition
    Tensor Type = SCALAR
    Units = [Pa]
    Variable Type = Unspecified
  END
  ADDITIONAL VARIABLE: Additional Variable 2
    Boundary Only Field = On
    Option = Definition
    Tensor Type = SCALAR
    Units = [Pa]
    Variable Type = Unspecified
  END

and

FLUID MODELS:
  ADDITIONAL VARIABLE: Additional Variable 1
    Additional Variable Value = areaAve(Pressure)@boundary <--- your expression
    Option = Algebraic Equation
  END
  ADDITIONAL VARIABLE: Additional Variable 2
    Additional Variable Value = Additional Variable 1.Trnavg <--- time average
    Option = Algebraic Equation
  END



All times are GMT -4. The time now is 17:40.