CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   loss of dimensions during integration... (http://www.cfd-online.com/Forums/openfoam/77451-loss-dimensions-during-integration.html)

Cyp June 23, 2010 08:36

loss of dimensions during integration...
 
Hi!

I have a little problem during an integration. I have 2 volScalarField (T and phase_gamma) and a dimensionedScalar (V_gamma).

the dimensions are the following :

T [-1 3 1 0 0 0 0]
phase_gamma [0 0 0 0 0 0 0]
V_gamma [0 3 0 0 0 0 0]

during my process, I need to reassign T according to :

T = phase_gamma*INTEGRAL(phase_gamma*T,V_gamma)/V_gamma

I use the following code:
T=phase_gamma*sum(fvc::volumeIntegrale(phase_gamma *T))/V_gamma

The compilations is ok. However I obtain an error during the execution of the code ("different dimensions"). It looks as if the operation "sum(fvc::volumeIntegrale(phase_gamma*T))" do not account for the dimension.

Do you have any idea ?
Thank you for your help,
Cyprien

herbert June 23, 2010 09:33

Hi Cyprien,

I think "sum" is not taking dimensions into account. Try fvc::domainIntegrate("field") instead of sum(fvc::volumeIntegrale("field")).

Regards,
Stefan

Cyp June 23, 2010 11:50

It works !! thank you very much !

ingrid July 7, 2010 13:33

Hi,

I'm a beginner with openfoam and I need to integrate a pressure by a length (r_1). I've tried plenty of things but it doesn't work. I ended up with this :

scalar pression1= ((gamma1*gamma1)/(4*pi*pi))*fvc::r_1integrate((1-::exp(-(r_1*r_1)/(r_eq1*r_eq1)))*(1-::exp(-(r_1*r_1)/(r_eq1*r_eq1)))/(r_1*r_1*r_1));

could you please tell me what is wrong.

Otherwise I also wanted to write directly the integral but unfortunately I need to use the exponential integral (Ei)function and I don't know how to implement it in my program.
Don't you have any idea how to use it?

Thank you in advance,

Ingrid


All times are GMT -4. The time now is 11:38.