CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

Problem with fvc::domainIntegrate

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By mturcios777

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 9, 2012, 11:06
Default Problem with fvc::domainIntegrate
  #1
Member
 
Join Date: Aug 2011
Posts: 33
Rep Power: 14
seboxx is on a distinguished road
Dear Foamers,

I have encountered a problem with the domainIntegrate function.
I actually don't understand why OpenFOAM gets this result and would be happy about suggestions.
Ok, here is the Problem:
I have created 2 geometries with blockMesh. One is a simple square as a reference and the other one is the same square with a hole cut out and a bump merged into it. (see attached files)

Clearly the domain with the bump should have a larger volume, but the result due to domainIntegrate is exactly the same.
I am using domainIntegrate that way:

Code:
 Info<< "wavesize= " << scale_spaceunit*fvc::domainIntegrate(pos(u-(1e-12))) << endl;
In this case I have given the function u = 1 a constant value.
The result is for both geometries
Quote:
wavesize= (scale_spaceunit*domainIntegrate(pos((u-1e-12)))) [0 0 0 0 0 0 0] 1600
What went wrong here?

Am I misunderstanding the purpose of domainIntegrate? Is volumeIntegrate working better for my purpose? Are there any other functions?

Oh btw. I am using OpenFOAM 2.0.0

I appreciate your time

seb
Attached Images
File Type: jpg square.jpg (42.0 KB, 20 views)
File Type: jpg bump.jpg (69.5 KB, 31 views)
seboxx is offline   Reply With Quote

Old   January 9, 2012, 12:40
Default
  #2
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
Try
Code:
 sum(mesh.V().field())
. Without knowing what is inside your blockMesh files, its possible that the number of cells in your domain might be the same? You could also try
Code:
 domainIntegrate(mesh.V().field())
.
mm.abdollahzadeh likes this.
mturcios777 is offline   Reply With Quote

Old   January 9, 2012, 12:55
Default
  #3
Member
 
Join Date: Aug 2011
Posts: 33
Rep Power: 14
seboxx is on a distinguished road
Thank you for the hint.
I am not sure what exactly
Quote:
Code:
 sum(mesh.V().field())
does, but I assume V is a vector field defined on my mesh right? In my case this would be u, but the point is I want to sum up only the cells where u>0 including the cells volume, thats why I use
Code:
pos(u-(1e-12))
I dont see how to incorporate that... Can you point me in a direction?

Also, if both meshes have the same number of cells, the volumes should still be different since I am looking for Volume and not number of cells...

What I am looking for is something like this pseude code:

If u>0:
calculate volume of cell

sum(volumes of all cells where u>0)

greets, seb
seboxx is offline   Reply With Quote

Old   January 9, 2012, 12:59
Default
  #4
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
Code:
mesh.V().field
is the field that has all the cell volumes. By summing them you obtain the total volume.
mturcios777 is offline   Reply With Quote

Old   January 14, 2012, 06:21
Default
  #5
Member
 
Join Date: Aug 2011
Posts: 33
Rep Power: 14
seboxx is on a distinguished road
Thanks for the hints,

I have realised the problem is actually not in the integration or the volume as such, but seems to be a more general problem. I guess I will just open a new thread, as the topic doesn't really fit anymore...
seboxx is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF compiling problem Wouter Fluent UDF and Scheme Programming 6 June 6, 2012 04:43
Gambit - meshing over airfoil wrapping (?) problem JFDC FLUENT 1 July 11, 2011 05:59
natural convection problem for a CHT problem Se-Hee CFX 2 June 10, 2007 06:29
Adiabatic and Rotating wall (Convection problem) ParodDav CFX 5 April 29, 2007 19:13
Is this problem well posed? Thomas P. Abraham Main CFD Forum 5 September 8, 1999 14:52


All times are GMT -4. The time now is 08:25.