|
[Sponsors] |
July 21, 2017, 05:11 |
Cannot evaluate field function Density
|
#1 |
New Member
Join Date: Jun 2016
Posts: 17
Rep Power: 10 |
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. |
|
July 21, 2017, 07:13 |
|
#2 |
Senior Member
Blanco
Join Date: Mar 2009
Location: Torino, Italy
Posts: 193
Rep Power: 17 |
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? |
|
July 21, 2017, 08:03 |
|
#3 |
New Member
Join Date: Jun 2016
Posts: 17
Rep Power: 10 |
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! |
|
July 21, 2017, 08:36 |
|
#4 | |
Senior Member
Blanco
Join Date: Mar 2009
Location: Torino, Italy
Posts: 193
Rep Power: 17 |
Quote:
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... |
||
July 25, 2017, 07:01 |
|
#5 |
New Member
Join Date: Jun 2016
Posts: 17
Rep Power: 10 |
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. |
|
February 25, 2021, 12:20 |
Cannot evaluate field function Centroid
|
#6 |
New Member
Prit K
Join Date: Jul 2020
Posts: 3
Rep Power: 6 |
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. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
is internalField(U) equivalent to zeroGradient? | immortality | OpenFOAM Running, Solving & CFD | 7 | March 29, 2013 02:27 |
[blockMesh] BlockMesh FOAM warning | gaottino | OpenFOAM Meshing & Mesh Conversion | 7 | July 19, 2010 15:11 |
Compilation errors in ThirdPartymallochoard | feng_w | OpenFOAM Installation | 1 | January 25, 2009 07:59 |
[blockMesh] Axisymmetrical mesh | Rasmus Gjesing (Gjesing) | OpenFOAM Meshing & Mesh Conversion | 10 | April 2, 2007 15:00 |