|
[Sponsors] |
September 25, 2011, 18:52 |
Problem with pos() or Scalar.H
|
#1 | |
Member
Join Date: Aug 2011
Posts: 33
Rep Power: 15 |
Hi community,
I am trying to calculate the size of a wave segment. Herefore I use Code:
fvc::domainIntegrate(pos(u-1e-12)) This is the error message I get Quote:
But the Scalar.H file seems fine to me, is there any known problem with it? I am using Scalar.H because pos() is declared in it. Also I think the last error that } is missing is also related to that... cuz it disappears if I comment out the include Scalar.H Is anyone able to make more sense of it? I am happy about any suggestions. Thanks |
||
September 26, 2011, 06:03 |
|
#3 |
Member
Join Date: Aug 2011
Posts: 33
Rep Power: 15 |
Hi there,
I am using OF 2.0.0 I have had a look... even a Solver which is perfectly working doesnt compile anymore if I add the simple line Code:
#include "Scalar.H" I have attached the file if you want to have a look at it... I am really confused. Thank you for your help. Sebastian |
|
September 26, 2011, 06:20 |
|
#4 |
Senior Member
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 370
Rep Power: 23 |
Ok, don't include Scalar.H, it will compile fine. Scalar.H contains template specialisations for type Scalar. If you're interested have a look at http://www.cantrip.org/traits.html.
__________________
Laurence R. McGlashan :: Website |
|
September 26, 2011, 08:07 |
|
#5 |
Member
Join Date: Aug 2011
Posts: 33
Rep Power: 15 |
Yea the compilation works.
But I have a problem which I had before. The pos(u-1e-12) gives me values either 0 or 1 depending whether u>1e-12. Which is good But by doing Code:
double Size; S=pos(u-1e-12); Size = domainIntegrate(S).value() I encountered this problem before, that's why i figured I might need Scalar.H for a proper pos() function. My domain is a block of size 1000 * 1000 * 0.1 therefore the 90000 isnt even the size of my domain... Any idea why I get this constant value? |
|
September 27, 2011, 05:27 |
|
#6 |
Senior Member
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 370
Rep Power: 23 |
Well S will be a field of 1s and 0s. You're then integrating, which will mean you sum all the 1s multiplied by the size of the volume they are in.
Do it on a simpler field with a much smaller size that you know should give you a specific answer.
__________________
Laurence R. McGlashan :: Website |
|
September 27, 2011, 06:36 |
|
#7 |
Member
Join Date: Aug 2011
Posts: 33
Rep Power: 15 |
You are right. I got confused due to the complexity of my field. Thanks for the hints
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF compiling problem | Wouter | Fluent UDF and Scheme Programming | 6 | June 6, 2012 05:43 |
Gambit - meshing over airfoil wrapping (?) problem | JFDC | FLUENT | 1 | July 11, 2011 06:59 |
natural convection problem for a CHT problem | Se-Hee | CFX | 2 | June 10, 2007 07:29 |
Adiabatic and Rotating wall (Convection problem) | ParodDav | CFX | 5 | April 29, 2007 20:13 |
convergence problem | Trushar | Phoenics | 5 | August 28, 2002 00:40 |