CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   STAR-CCM+ (https://www.cfd-online.com/Forums/star-ccm/)
-   -   Cannot evaluate field function Density (https://www.cfd-online.com/Forums/star-ccm/190738-cannot-evaluate-field-function-density.html)

karahan July 21, 2017 04:11

Cannot evaluate field function Density
 
Hello Everybody,

I am trying to simulate a relative simple incompressible flow field. Density is constant in the model physics and is defined. However, when I want to define a Report, in which a variable is dependent from the field function ${Density}, I receive an error in the beginning of the Simulation saying "Cannot evaluate field function Density".

I can overcome the Problem using a user-defined field function or a Report, where I insert the value of the constant density again.

Thank you for the answers.

Blanco July 21, 2017 06:13

Which version are you using?

Maybe I'm missing something from your post, but if you define a report and want it to calculate, as an example, the surface average of density on a section plane, you just have to select density in the field function drop down menu, and it works as expected.

If you define a field function using density, e.g. ${Density}*${Pressure}, and you want to monitor its value, you have to create a report and refer to the name of your filed function (UserFieldFunction_1 or anything else you wrote). This also works as expected on my pc.

These, of course, after initialization of the simulation.

Can you further describe your problem?

karahan July 21, 2017 07:03

The Version I am using is 12.02.010.

I am trying to calculate the volumetric flow rate (l/h) from the mass flow rate (kg/s). For that, I wrote in the Definition of the Report this expression: abs(${MassFlowAtPosition1})*3600*1000/${Density}. And the density is already defined in the physics continuum as constant integer (1000 kg/m3).

I am now using my own User-defined density function and it works well. But it shouldn't be necessary of course. I would be happy, if somebody has a solution. When not, at least this error is documented here.

thanks!

Blanco July 21, 2017 07:36

Quote:

Originally Posted by karahan (Post 657916)
The Version I am using is 12.02.010.

I am trying to calculate the volumetric flow rate (l/h) from the mass flow rate (kg/s). For that, I wrote in the Definition of the Report this expression: abs(${MassFlowAtPosition1})*3600*1000/${Density}. And the density is already defined in the physics continuum as constant integer (1000 kg/m3).

I am now using my own User-defined density function and it works well. But it shouldn't be necessary of course. I would be happy, if somebody has a solution. When not, at least this error is documented here.

thanks!

That's strange because if I use the same version it works for me:

abs(${MassFlow1Report})*1000*3600/${Density}

and it works even as

abs(${MassFlow1Report})*1000*3600/$Density

NOTE: in the field-function definition tab notes I get "floating point exception, invalid operation", stating that the function cannot be evaluated, but if I create a scalar scene or a report and I refer to the field function just created it works properly.

I've had a similar problem in the past, in another field function where there was a long-enough formula...I ended up in splitting the formula in single field-functions, and at the end the final field function was just a division of two: $num/$den. With this definition everything worked properly, even if formally there were no difference compared to a single formula...

karahan July 25, 2017 06:01

I couldn't remove the issue but I came to the conclusion that it has something to do with writing the density in the denominator. If the density is in the nominator, there is no error. This might be a bug or something like that.

Thank you for your answer.

Pkanugov February 25, 2021 11:20

Cannot evaluate field function Centroid
 
Hello everyone,

I am trying to create a variable density ( varying with height ) profile in a rectangular domain and the equation I'm using is:

0.2257*(pow($$Centroid[1],3))-0.4868*(pow($$Centroid[1],2))+0.06016*(pow($$Centroid[1],1))+1.301

I'm first generating a report using the expression and when I try to run the report ( after initialization ) I get an error saying:

Cannot evaluate field function Centroid.

Can someone please help me with this.

Thank you in advance.


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