# Average value of expression in transient flow analysis

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

 May 22, 2013, 08:02 Average value of expression in transient flow analysis #1 New Member   Jacob Fogh Knudsen Join Date: May 2013 Location: Aarhus, Denmark Posts: 1 Rep Power: 0 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: I have set up the basic model and it runs. Created an expression for the drag coefficient: 2*force_x()@AntennaSurface/(areaAve(Density)@Inlet*(areaAve(Velocity u)@Inlet)^2*FrontalArea). Created an additional variable with: Type: Unspecified, Unit: [ ], Tensor Type: Scalar. Included the additional variable in my domain and set its value to the expression for the drag coefficient. 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!

 May 22, 2013, 08:52 #2 Senior Member   Lance Join Date: Mar 2009 Posts: 669 Rep Power: 21 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``` mvoss likes this.