On Nov 29, 2012, at 10:49 AM, Adrian Jacobo wrote:

> Hi,
> 
>  Thank you for your answer.
>>>  I'm solving an equation in 3d and I need to calculate the integral of the 
>>> field. What is the most convenient/fast way of doing this?
>> 
>> int = var.cellVolumeAverage * var.mesh.numberOfCells
> Just to clarify, as it might be useful for somebody else, this 
> expression needs to be multiplied for dx (or dx*dy*dz in my case) to 
> give the proper value of the integral. Is this correct?

Indeed, cellVolumeAverage needs to be multiplied by the total volume, not the 
number of cells:

int = var.cellVolumeAverage * numerix.sum(var.mesh.cellVolumes)





_______________________________________________
fipy mailing list
[email protected]
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

Reply via email to