How to integrate a parameter in whole domain(domainIntegrate(alfa))
Dear foamers
I want to use domainIntegrate(alfa) to integrate a parameter in all my domain. I checked the main code for domainIntegrate(alfa) in below address; https://cpp.openfoam.org/v3/a05655_source.html and it is written as below; Code:
if I want to integrate alfa over whole domain, I should use domainIntegrate(alfa), but what is alfa? I mean it is volScalarField? or Scalar? or dimensionedScalar? Thanks, Farzad |
Extra explanation
For clarification, I used pressure to integrate which is a volScalarField and it gives me error;
Code:
In file included from DPMFoamFarzadd.C:216:0: and it gives me this error; Code:
YO2cEqnYN2cEqn.H:20:40: error: cannot convert ‘Foam::dimensioned<double>’ to ‘Foam::scalar {aka double}’ in assignment Do you know why? Thanks, Farzad |
Answer!!!
Ok, instead of writing
Code:
fvc::domainIntegrate(p) Code:
fvc::domainIntegrate(p).value(); Farzad |
The clarification of the problem was discussed within 3 text messages in LinkedIn between him and myself., 😉
|
Thanks
Yes, Thanks a lot Tobias Holzmann. I am still working on other parts of domainIntegration and if I find something new, I will write it down in this post.
Quote:
|
New problem after integration
I am doing a lagrangian particel tracking using DPMFoam, and inside lagrangian part(src/lagrangian/intermediate/parcels/Templates/KinematicParcel), you need to add
Code:
#include "fvCFD.H" I did this, and code compiles and works fine, but still I have a problem after doing the integration. Let's I explain it; Code:
Code:
dMass[0] = 3.5044329e-28 Now, we have the value inside one cell, and the remaining cells are empty(initialized zero). After integration, integration results is 6 order magnitude less than the value inside one cell, why? Farzad |
I expect that domainIntegrate is not suitable for particles. Check out any lagrangian code to see how they create the overall mass or whatever you want to do.
|
All times are GMT -4. The time now is 21:40. |